As a follow up to JDK-8350579, we should add verification code to check the following: The associated loop nodes of all newly marked useless Template Assertion Predicates during PhaseIdealLoop::eliminate_useless_predicates() should not exist in the graph anymore.
We could walk through all OpaqueTemplateAssertionPredicate nodes and collect the loop nodes of the useless ones. Then we walk through the loop tree and verify that no loop node can be found on this list.
I actually wanted to add this with JDK-8350579 but we require the fixes from JDK-8350577 to make this reliably working.