RFR: 8352418: Add verification code to check that the associated loop nodes of useless Template Assertion Predicates are dead

Emanuel Peter epeter at openjdk.org
Wed Apr 2 07:41:09 UTC 2025


On Mon, 31 Mar 2025 12:28:59 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> As already suggested in https://github.com/openjdk/jdk/pull/23823, I want to do the following additional verification:
> 
> After `eliminate_useless_predicates()` all now useless `OpaqueTemplateAssertionPredicate` nodes should not have any references to `CountedLoop` nodes that are still in the graph (otherwise, they would have been marked useful). This verification did not work reliably without the full Assertion Predicates fix [JDK-8350577](https://bugs.openjdk.org/browse/JDK-8350577). Since JDK-8350577 is now integrated, I propose to add this additional verification code.
> 
> Thanks,
> Christian

Looks reasonable, nice to see more verification code :)

src/hotspot/share/opto/predicates.cpp line 1250:

> 1248: // graph (otherwise, they would have been marked useful instead). This is verified in this method.
> 1249: void EliminateUselessPredicates::verify_loop_nodes_of_useless_templates_assertion_predicates_are_dead() const {
> 1250:   Unique_Node_List loop_nodes_of_useless_template_assertion_predicates =

Should we add `ResourceMark` here, or is there one close by that suffices?

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

Marked as reviewed by epeter (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24326#pullrequestreview-2734938554
PR Review Comment: https://git.openjdk.org/jdk/pull/24326#discussion_r2024248198


More information about the hotspot-compiler-dev mailing list