Integrated: 8318049: C2: assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN
Jasmine Karthikeyan
jkarthikeyan at openjdk.org
Fri Oct 20 10:47:45 UTC 2023
On Tue, 17 Oct 2023 09:52:28 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:
> This patch fixes [JDK-8318049](https://bugs.openjdk.org/browse/JDK-8318049) by informing XorI and XorL nodes in addition to sub and phi nodes when Cast nodes are updated during IGVN.
>
> The bug manifests when loop optimizations change the IR:
> ![image](https://github.com/openjdk/jdk/assets/25208576/5274f2cc-a6fb-4ce6-89f4-4a638577901c)
>
> To the following form:
> ![image](https://github.com/openjdk/jdk/assets/25208576/07bcbec3-f0bb-4d6a-b312-6a459e6b8c0c)
>
> XorI nodes check for that form in their `Value` call, to do the `x ^ x => 0` transformation, checking through casts. As the cast node didn't inform the Xor when it changes, the transformation doesn't have a chance to run.
> https://github.com/openjdk/jdk/blob/5bd10521eb5e51e76b20e955addd45f76abba6f7/src/hotspot/share/opto/addnode.cpp#L947-L950
>
> I've attached a reduced version of the test found in the bug. Reviews would be appreciated!
This pull request has now been integrated.
Changeset: a03767cf
Author: Jasmine Karthikeyan <jkarthikeyan at openjdk.org>
Committer: Emanuel Peter <epeter at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/a03767cf8868a200f5be74c4cf8cdf5f76f1e678
Stats: 62 lines in 2 files changed: 58 ins; 0 del; 4 mod
8318049: C2: assert(!failure) failed: Missed optimization opportunity in PhaseIterGVN
Reviewed-by: epeter, thartmann
-------------
PR: https://git.openjdk.org/jdk/pull/16214
More information about the hotspot-compiler-dev
mailing list