RFR: 8333334: C2: Make result of `Node::dominates` more precise to enhance scalar replacement [v3]
MaxXing
duke at openjdk.org
Thu Jun 13 09:44:14 UTC 2024
On Thu, 13 Jun 2024 05:36:55 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> Are we sure that what we detect as "dead code" can always be removed by IGVN? Otherwise, we risk an endless loop of putting the LoadNode back on the worklist and finding the dead code again, right?
We can sure that when we detect dead code, either one of the address and memory input of the load is top, or the control node chain of the address phi (or the memory phi) ends up connecting to top. For the previous case, the load will eventually be removed from the worklist and replaced by top. For the latter case, the control node chain should be replaced by top and then eliminated (otherwise there must be something suboptimal).
> I think it would be great to have a standalone test, did you try with `-XX:+StressIGVN` and or `-XX:+StressIncrementalInlining`?
I have already added a standalone IR test that does not rely on `ConcurrentHashMap` to this patch.
I tried all tier1-4 tests, which contain tests that require `-XX:+StressIGVN` or `-XX:+StressIncrementalInlining`, such as `TestDeadLoopSplitIfLoop`, `TestGVNCrash`, `CastNullCheckDroppingsTest`, `Decompile`, and they all passed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19496#issuecomment-2165146576
More information about the hotspot-compiler-dev
mailing list