From da341886dd0ffcc78fdc20a65304af4b006d9c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Wed, 16 Jul 2025 16:55:03 +0200 Subject: [PATCH 01/10] 8359603: Add missing notification --- src/hotspot/share/opto/phaseX.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index f3435fa2b6150..c48f17f8201ec 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2549,6 +2549,14 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ } } } + if (use_op == Op_ConvL2D) { + for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { + Node* u = use->fast_out(i2); + if (u->Opcode() == Op_ConvD2L) { + worklist.push(u); + } + } + } // If changed AddP inputs: // - check Stores for loop invariant, and // - if the changed input is the offset, check constant-offset AddP users for From 0202f02159decb9459432a14a62054193d609877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Thu, 17 Jul 2025 11:34:53 +0200 Subject: [PATCH 02/10] 8359603: Add test from fuzzer --- .../c2/TestRedundantConvD2LElimination.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java diff --git a/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java b/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java new file mode 100644 index 0000000000000..c7b6468bce6ac --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8359603 + * @summary Redundant ConvD2L->ConvL2D->ConvD2L sequences should be + * simplified to a single ConvD2L operation + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,compiler.c2.TestRedundantConvD2LElimination::test + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestRedundantConvD2LElimination + * @run main compiler.c2.TestRedundantConvD2LElimination + * + */ + +package compiler.c2; + +public class TestRedundantConvD2LElimination { + static long instanceCount; + + static void test(double d) { + int i = 1; + int j = 1; + while (++i < 3) { + for (; 8 > j; ++j) { + instanceCount = (long)d; + d = instanceCount; + } + } + } + public static void main(String[] strArr) { + for (int i = 0; i < 50_000; ++i) { + test(1); + } + } +} \ No newline at end of file From 760f10f4b00215ebfef79c0b0b0fe3851e84fac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Thu, 17 Jul 2025 14:05:07 +0200 Subject: [PATCH 03/10] 8359603: Add comment explaining the notification --- src/hotspot/share/opto/phaseX.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index c48f17f8201ec..237adafb75e1d 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2549,6 +2549,7 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ } } } + // If changed Op_ConvL2D inputs, check for redundant ConvD2L->ConvL2D->ConvD2L sequences if (use_op == Op_ConvL2D) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); From 08d83608b8ed39e180dce988053dbcff9695a128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Thu, 17 Jul 2025 14:12:04 +0200 Subject: [PATCH 04/10] 8359603: Add opcode check on current node --- src/hotspot/share/opto/phaseX.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 237adafb75e1d..3e1dea0fa1039 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2549,8 +2549,8 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ } } } - // If changed Op_ConvL2D inputs, check for redundant ConvD2L->ConvL2D->ConvD2L sequences - if (use_op == Op_ConvL2D) { + // Check for redundant ConvD2L->ConvL2D->ConvD2L sequences + if (n->Opcode() == Op_ConvD2L && use_op == Op_ConvL2D) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); if (u->Opcode() == Op_ConvD2L) { From c829e6cf4fb67b81c9f5788cc959d2f876efda61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Thu, 17 Jul 2025 16:48:11 +0200 Subject: [PATCH 05/10] 8359603: Add other similar conversion patterns for which a missing opt could be trigerred --- src/hotspot/share/opto/phaseX.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index 3e1dea0fa1039..c2242b0e86226 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2549,11 +2549,18 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ } } } - // Check for redundant ConvD2L->ConvL2D->ConvD2L sequences - if (n->Opcode() == Op_ConvD2L && use_op == Op_ConvL2D) { + // Check for redundant conversion patterns: + // ConvD2L->ConvL2D->ConvD2L + // ConvF2I->ConvI2F->ConvF2I + // ConvF2L->ConvL2F->ConvF2L + // ConvI2F->ConvF2I->ConvI2F + if ((n->Opcode() == Op_ConvD2L && use_op == Op_ConvL2D) || + (n->Opcode() == Op_ConvF2I && use_op == Op_ConvI2F) || + (n->Opcode() == Op_ConvF2L && use_op == Op_ConvL2F) || + (n->Opcode() == Op_ConvI2F && use_op == Op_ConvF2I)) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); - if (u->Opcode() == Op_ConvD2L) { + if (u->Opcode() == n->Opcode()) { worklist.push(u); } } From 425bcac0dfb4cf248a1c9174e9a25b9d770d1a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Fri, 18 Jul 2025 11:17:02 +0200 Subject: [PATCH 06/10] 8359603: Rename test and add cases for other number types with analog optimization patterns --- ...EliminateRedundantConversionSequences.java | 133 ++++++++++++++++++ .../c2/TestRedundantConvD2LElimination.java | 56 -------- 2 files changed, 133 insertions(+), 56 deletions(-) create mode 100644 test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java delete mode 100644 test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java diff --git a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java new file mode 100644 index 0000000000000..4a476996a11cf --- /dev/null +++ b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8359603 + * @summary Redundant ConvX2Y->ConvY2X->ConvX2Y sequences should be + * simplified to a single ConvX2Y operation when applicable + * VerifyIterativeGVN checks that this optimization was applied + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences D2L + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences F2I + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences F2L + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences I2F + * @run main compiler.c2.TestEliminateRedundantConversionSequences D2L + * @run main compiler.c2.TestEliminateRedundantConversionSequences F2I + * @run main compiler.c2.TestEliminateRedundantConversionSequences F2L + * @run main compiler.c2.TestEliminateRedundantConversionSequences I2F + * + */ + +package compiler.c2; + +public class TestEliminateRedundantConversionSequences { + static long instanceCountD2L; + static int instanceCoundF2I; + static long instanceCountF2L; + static float instanceCountI2F; + + // ConvD2L->ConvL2D->ConvD2L + static void testD2L(double d) { + int i = 1; + int j = 1; + while (++i < 3) { + for (; 8 > j; ++j) { + instanceCountD2L = (long)d; + d = instanceCountD2L; + } + } + } + + // ConvF2I->ConvI2F->ConvF2I + static void testF2I(float d) { + int i = 1; + int j = 1; + while (++i < 3) { + for (; 8 > j; ++j) { + instanceCoundF2I = (int)d; + d = instanceCoundF2I; + } + } + } + + // ConvF2L->ConvL2F->ConvF2L + static void testF2L(float d) { + int i = 1; + int j = 1; + while (++i < 3) { + for (; 8 > j; ++j) { + instanceCountF2L = (long)d; + d = instanceCountF2L; + } + } + } + + // ConvI2F->ConvF2I->ConvI2F + static void testI2F(int d) { + int i = 1; + int j = 1; + while (++i < 3) { + for (; 8 > j; ++j) { + instanceCountI2F = d; + d = (int)instanceCountI2F; + } + } + } + + public static void main(String[] strArr) { + System.out.println(strArr[0]); + switch (strArr[0]) { + case "D2L": + for (int i = 0; i < 50_000; ++i) { + testD2L(1); + } + break; + case "F2I": + for (int i = 0; i < 50_000; ++i) { + testF2I(1); + } + break; + case "F2L": + for (int i = 0; i < 50_000; ++i) { + testF2L(1); + } + break; + case "I2F": + for (int i = 0; i < 50_000; ++i) { + testI2F(1); + } + break; + default: + assert(false); + break; + } + } +} \ No newline at end of file diff --git a/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java b/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java deleted file mode 100644 index c7b6468bce6ac..0000000000000 --- a/test/hotspot/jtreg/compiler/c2/TestRedundantConvD2LElimination.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8359603 - * @summary Redundant ConvD2L->ConvL2D->ConvD2L sequences should be - * simplified to a single ConvD2L operation - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet - * -XX:CompileCommand=compileonly,compiler.c2.TestRedundantConvD2LElimination::test - * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestRedundantConvD2LElimination - * @run main compiler.c2.TestRedundantConvD2LElimination - * - */ - -package compiler.c2; - -public class TestRedundantConvD2LElimination { - static long instanceCount; - - static void test(double d) { - int i = 1; - int j = 1; - while (++i < 3) { - for (; 8 > j; ++j) { - instanceCount = (long)d; - d = instanceCount; - } - } - } - public static void main(String[] strArr) { - for (int i = 0; i < 50_000; ++i) { - test(1); - } - } -} \ No newline at end of file From 75766333c5b758daf5537a604e336600c23fe3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Mon, 21 Jul 2025 09:57:52 +0200 Subject: [PATCH 07/10] 8359603: Remove switch in tests --- ...EliminateRedundantConversionSequences.java | 52 +++++-------------- 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java index 4a476996a11cf..af06968fb3b7e 100644 --- a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java +++ b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java @@ -29,20 +29,8 @@ * VerifyIterativeGVN checks that this optimization was applied * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* - * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences D2L - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet - * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* - * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences F2I - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet - * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* - * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences F2L - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet - * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* - * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences I2F - * @run main compiler.c2.TestEliminateRedundantConversionSequences D2L - * @run main compiler.c2.TestEliminateRedundantConversionSequences F2I - * @run main compiler.c2.TestEliminateRedundantConversionSequences F2L - * @run main compiler.c2.TestEliminateRedundantConversionSequences I2F + * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences + * @run main compiler.c2.TestEliminateRedundantConversionSequences * */ @@ -103,31 +91,17 @@ static void testI2F(int d) { } public static void main(String[] strArr) { - System.out.println(strArr[0]); - switch (strArr[0]) { - case "D2L": - for (int i = 0; i < 50_000; ++i) { - testD2L(1); - } - break; - case "F2I": - for (int i = 0; i < 50_000; ++i) { - testF2I(1); - } - break; - case "F2L": - for (int i = 0; i < 50_000; ++i) { - testF2L(1); - } - break; - case "I2F": - for (int i = 0; i < 50_000; ++i) { - testI2F(1); - } - break; - default: - assert(false); - break; + for (int i = 0; i < 50_000; ++i) { + testD2L(1); + } + for (int i = 0; i < 50_000; ++i) { + testF2I(1); + } + for (int i = 0; i < 50_000; ++i) { + testF2L(1); + } + for (int i = 0; i < 50_000; ++i) { + testI2F(1); } } } \ No newline at end of file From 0b3244fd2e21cb53f7f781990d2f6d0725a45476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Mon, 28 Jul 2025 13:48:33 +0200 Subject: [PATCH 08/10] Update test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java Co-authored-by: Christian Hagedorn --- .../compiler/c2/TestEliminateRedundantConversionSequences.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java index af06968fb3b7e..bd7da7bb73a74 100644 --- a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java +++ b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java @@ -27,7 +27,7 @@ * @summary Redundant ConvX2Y->ConvY2X->ConvX2Y sequences should be * simplified to a single ConvX2Y operation when applicable * VerifyIterativeGVN checks that this optimization was applied - * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=quiet + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions * -XX:CompileCommand=compileonly,compiler.c2.TestEliminateRedundantConversionSequences::test* * -XX:-TieredCompilation -Xbatch -XX:VerifyIterativeGVN=1110 compiler.c2.TestEliminateRedundantConversionSequences * @run main compiler.c2.TestEliminateRedundantConversionSequences From 10f7986691f9d8d4e48dc2391dddb071ee75adf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Mon, 28 Jul 2025 13:55:00 +0200 Subject: [PATCH 09/10] 8359603: Reduce number of iterations in tests --- .../c2/TestEliminateRedundantConversionSequences.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java index bd7da7bb73a74..b452b8f67ddda 100644 --- a/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java +++ b/test/hotspot/jtreg/compiler/c2/TestEliminateRedundantConversionSequences.java @@ -91,16 +91,16 @@ static void testI2F(int d) { } public static void main(String[] strArr) { - for (int i = 0; i < 50_000; ++i) { + for (int i = 0; i < 1550; ++i) { testD2L(1); } - for (int i = 0; i < 50_000; ++i) { + for (int i = 0; i < 1550; ++i) { testF2I(1); } - for (int i = 0; i < 50_000; ++i) { + for (int i = 0; i < 1550; ++i) { testF2L(1); } - for (int i = 0; i < 50_000; ++i) { + for (int i = 0; i < 1550; ++i) { testI2F(1); } } From 2e5efdcc2ce20f8f311371388bcfe9614435816b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Maillard?= Date: Mon, 28 Jul 2025 14:31:03 +0200 Subject: [PATCH 10/10] 8359603: Add note --- src/hotspot/share/opto/phaseX.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/opto/phaseX.cpp b/src/hotspot/share/opto/phaseX.cpp index e7b761fffaf56..3d67c80f1bb40 100644 --- a/src/hotspot/share/opto/phaseX.cpp +++ b/src/hotspot/share/opto/phaseX.cpp @@ -2563,6 +2563,8 @@ void PhaseIterGVN::add_users_of_use_to_worklist(Node* n, Node* use, Unique_Node_ // ConvF2I->ConvI2F->ConvF2I // ConvF2L->ConvL2F->ConvF2L // ConvI2F->ConvF2I->ConvI2F + // Note: there may be other 3-nodes conversion chains that would require to be added here, but these + // are the only ones that are known to trigger missed optimizations otherwise if ((n->Opcode() == Op_ConvD2L && use_op == Op_ConvL2D) || (n->Opcode() == Op_ConvF2I && use_op == Op_ConvI2F) || (n->Opcode() == Op_ConvF2L && use_op == Op_ConvL2F) ||