RFR: 8366702: C2 SuperWord: refactor VTransform vector nodes
Christian Hagedorn
chagedorn at openjdk.org
Mon Sep 8 06:47:12 UTC 2025
On Mon, 8 Sep 2025 06:01:35 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>>> we can just use the CountedLoop as control, which is good enough
>>
>> For my understanding: this is because we can only vectorize if there are no other control dependencies in the loop?
>
> Setting control is only for PhaseIdealLoop. It sets the internal ctrl that other loop-opts would rely on if we kept on optimizing the loop in the same PhaseIdealLoop. But if we set major progress, that means that we have messed up the graph so much that the state of PhaseIdealLoop may no longer be correct/accurate enough.
>
> So if we set major progress, we are essencially allowed to mess up the PhaseIdealLoop state. I still have to set ctrl, but it does not matter if it is not correct ;)
I think it should generally still be correct but might not need to be as accurate as possible. You'll never know if some code will rely on the correctness later in the same loop opts - might not today but at some point, especially when trying to add some verification code. So, IIUC, you are just more conservative/less accurate now while still being correct. Maybe you can tweak the comment to express that more clearly since "not always correct" could also imply some actual illegal control.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27056#discussion_r2329284434
More information about the hotspot-compiler-dev
mailing list