RFR: JDK-8287284: C2: loop optimization performs split_thru_phi infinitely many times [v3]
Roland Westrelin
roland at openjdk.org
Mon Nov 6 08:59:10 UTC 2023
On Mon, 30 Oct 2023 10:49:22 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> So you think this problem only exists for Loads? Can we not have a similar split_thru_phi problem with another node?
The exit of the inner loop has to be some control split with a projection that's in the outer loop. The cloned node should be assigned that projection as control (in the outer loop) unless there's something pushing it in the inner loop which I assume in this case is a store. Not sure how that would happen with other nodes.
> 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?
Yes, late control would be better but it's unclear to me how straightforward it is and given this is a corner case, a simple solution is likely good enough.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15536#issuecomment-1794348236
More information about the hotspot-compiler-dev
mailing list