RFR: JDK-8287284: C2: loop optimization performs split_thru_phi infinitely many times [v3]
Emanuel Peter
epeter at openjdk.org
Mon Oct 30 10:52:36 UTC 2023
On Wed, 25 Oct 2023 14:05:09 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> `moved_to_inner_loop()` returns true if the clone may end up in an inner loop but it could return true and the clone be in the outer loop: `moved_to_inner_loop()` tests the early control but the clone will be assigned control that is as late as possible as long as it doesn't cause a node to move in a loop. In short that test is not exact. I would adjust the comment to reflect that. I also think this happens because the node that's cloned is a `Load` and anti dependence analysis is conservative and pushes it in the inner loop so we could apply the `moved_to_inner_loop()` test only to loads. Not sure if it's worth doing though.
So you think this problem only exists for Loads? Can we not have a similar split_thru_phi problem with another node?
As you say: early control is not sufficient, as it could still have all uses outside the inner loop and would then be scheduled after the inner loop (ending up in the outer loop). I guess we could just check for the late control then?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15536#issuecomment-1784931659
More information about the hotspot-compiler-dev
mailing list