RFR: 8173709: Fix VerifyLoopOptimizations - step 1 - minimal infrastructure [v4]
Emanuel Peter
epeter at openjdk.org
Thu Mar 30 06:37:10 UTC 2023
On Thu, 30 Mar 2023 06:21:47 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> 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.
Side note:
Before my patch, we did not check if `loop_verify` had any loops that we did not have in `this`. That is why we did not have to deal with suddenly appearing infinite loops.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13207#discussion_r1152791851
More information about the hotspot-compiler-dev
mailing list