RFR: 8307084: C2: Vectorized drain loop is not executed for some small trip counts [v4]
Fei Gao
fgao at openjdk.org
Thu Jan 22 16:33:12 UTC 2026
On Wed, 21 Jan 2026 10:50:44 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>>> One more question here: could it be that one node that you now conservatively pin further down actually already has a use in a predicate further up, and now we'd create a `bad graph` cycle?
>>
>> If a node has a `use` that is attached to a predicate further up, then that `use` would also be pinned down to the loop `entry control`. Since we also fix the control of the `use`, which is itself a cloned node, I would expect that we wouldn’t end up creating a bad control-flow cycle. Does that make sense?
>
> But what if such a predicate uses the node as an input? Then the node is pinned below its use.
I haven’t observed such cases so far, and I’m not sure whether this scenario can actually occur. That said, I understand your concern.
I believe it should be possible to address this by offloading part of the logic into an extended version of `initialize_assertion_predicates_for_post_loop()`. This would allow us to identify the precise corresponding taken node for each predicate instance, rather than sinking all predicates together.
I’ll try this approach, and if it works, I’ll include the fix in the next commit.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22629#discussion_r2717234335
More information about the hotspot-compiler-dev
mailing list