RFR: 8360510: C2: Template Assertion Predicates are not cloned to the inner counted loop with -XX:+StressDuplicateBackedge

Roland Westrelin roland at openjdk.org
Fri Nov 21 09:51:26 UTC 2025


On Thu, 20 Nov 2025 10:26:01 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> Not sure if I understand your question. The Template Assertion Predicates themselves are never executed and just serve as templates to create Initialized Assertion Predicates from which will result in a halt if they fail at runtime.

Right. But if I remember correctly, the false projection of nodes 309 and 321 (in your graph snippets) is an uncommon trap. That uncommon trap has incorrect state if it can be reached between the outer and inner loop. That's harmless, because when a predicate is initialized, it is wired to a halt node directly. Is this correct?

If it is, then, I would add a comment so the state of the uncommon trap is not used by accident in some later change. Or is it possible to wire the template assertion predicate directly to a `Halt` node when it's cloned?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28389#issuecomment-3562221771


More information about the hotspot-compiler-dev mailing list