RFR: 8173709: Fix VerifyLoopOptimizations - step 1 - minimal infrastructure [v4]

Emanuel Peter epeter at openjdk.org
Thu Mar 30 06:24:18 UTC 2023


On Wed, 29 Mar 2023 17:00:14 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Restrict VerifyLoopOptimizations to ASSERT / DEBUG_ONLY
>
> src/hotspot/share/opto/loopnode.cpp line 4885:
> 
>> 4883:         // Irreducible loops can pick a different header (one of its entries).
>> 4884:       } else if (child_verify->_head->as_Region()->is_in_infinite_subgraph()) {
>> 4885:         // Infinite loops do not get attached to the loop-tree on their first visit.
> 
> Can you explain why you don't check `child` for infinite subgraph?

As the comment here says, infinite loops are not attached the first time we run `build_loop_tree`.
But from the second time on, we have the `NeverBranch` added, so it has a "fake" exit, and is not really an infinite loop any more, so it will always be found and attached to the loop tree.
`this` runs before `loop_verify`, so it is possible that `child` does not have the loop, but `child_verify` finds it. It is not possible the other way around.
I can add a comment to the code for that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13207#discussion_r1152784489


More information about the hotspot-compiler-dev mailing list