From a916d7d300f0938b728bdc054098c9a94943d871 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Mon, 29 Sep 2025 21:44:25 +0000 Subject: [PATCH 1/2] 8367899: compiler/c2/gvn/TestBitCompressValueTransform.java intermittent timed out --- .../c2/gvn/TestBitCompressValueTransform.java | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java b/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java index 98f26f120b191..10f54da341e8c 100644 --- a/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java +++ b/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java @@ -77,7 +77,7 @@ public long test1(long value) { @Run(test = "test1") public void run1(RunInfo info) { long res = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { res |= test1(field_L); } Asserts.assertEQ(res, gold_L); @@ -93,7 +93,7 @@ public int test2(int value) { @Run(test = "test2") public void run2(RunInfo info) { int res = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { res |= test2(field_I); } Asserts.assertEQ(res, gold_I); @@ -113,7 +113,7 @@ public int test3(int value) { @Run(test = "test3") public void run3(RunInfo info) { int res = 0; - for (int i = 1; i < 10000; i++) { + for (int i = 1; i < 100; i++) { res |= test3(i); } Asserts.assertLTE(0, res); @@ -133,7 +133,7 @@ public long test4(long value) { @Run(test = "test4") public void run4(RunInfo info) { long res = 0; - for (long i = 1; i < 10000; i++) { + for (long i = 1; i < 100; i++) { res |= test4(i); } Asserts.assertLTE(0L, res); @@ -151,7 +151,7 @@ public long test5(long value) { @Run(test = "test5") public void run5(RunInfo info) { long res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test5((long)i); } Asserts.assertEQ(-1L, res); @@ -169,7 +169,7 @@ public long test6(long value) { @Run(test = "test6") public void run6(RunInfo info) { long res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test6((long)i); } Asserts.assertLTE(0L, res); @@ -188,7 +188,7 @@ public long test7(long value) { @Run(test = "test7") public void run7(RunInfo info) { long res = Long.MIN_VALUE; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res = Long.max(test7((long)i), res); } Asserts.assertGTE(10000L, res); @@ -206,7 +206,7 @@ public int test8(int value) { @Run(test = "test8") public void run8(RunInfo info) { int res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test8(i); } Asserts.assertEQ(-1, res); @@ -224,7 +224,7 @@ public int test9(int value) { @Run(test = "test9") public void run9(RunInfo info) { int res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test9(i); } Asserts.assertLTE(0, res); @@ -243,10 +243,10 @@ public int test10(int value) { @Run(test = "test10") public void run10(RunInfo info) { int res = Integer.MIN_VALUE; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res = Integer.max(test10(i), res); } - Asserts.assertGTE(10000, res); + Asserts.assertGTE(100, res); } @Test @@ -260,7 +260,7 @@ public int test11(int value) { @Run(test = "test11") public void run11(RunInfo info) { int res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test11(i); } Asserts.assertEQ(0, res); @@ -277,7 +277,7 @@ public long test12(long value) { @Run(test = "test12") public void run12(RunInfo info) { long res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test12(i); } Asserts.assertEQ(0L, res); @@ -294,7 +294,7 @@ public int test13(int value) { @Run(test = "test13") public void run13(RunInfo info) { int res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test13(i); } Asserts.assertEQ(0, res); @@ -311,7 +311,7 @@ public long test14(long value) { @Run(test = "test14") public void run14(RunInfo info) { long res = 0; - for (int i = -10000; i < 10000; i++) { + for (int i = -100; i < 100; i++) { res |= test14(i); } Asserts.assertEQ(0L, res); @@ -328,7 +328,7 @@ public int test15(int src, int mask) { @Run (test = "test15") public void run15(RunInfo info) { int res = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { res |= test15(0, 0); } Asserts.assertEQ(0, res); @@ -408,7 +408,7 @@ public void run16(RunInfo info) { int actual = 0; int expected = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { int arg1 = GEN_I.next(); int arg2 = GEN_I.next(); @@ -492,7 +492,7 @@ public void run17(RunInfo info) { int actual = 0; int expected = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { int arg1 = GEN_I.next(); int arg2 = GEN_I.next(); @@ -576,7 +576,7 @@ public void run18(RunInfo info) { long actual = 0; long expected = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { long arg1 = GEN_L.next(); long arg2 = GEN_L.next(); @@ -660,7 +660,7 @@ public void run19(RunInfo info) { long actual = 0; long expected = 0; - for (int i = 0; i < 10000; i++) { + for (int i = 0; i < 100; i++) { long arg1 = GEN_L.next(); long arg2 = GEN_L.next(); From 3fabfeca28e476d58a5d9e3256ecfd59a3e8d243 Mon Sep 17 00:00:00 2001 From: SendaoYan Date: Tue, 30 Sep 2025 14:26:34 +0000 Subject: [PATCH 2/2] Remove the loop which do not use the loop variable i or do not use random number --- .../c2/gvn/TestBitCompressValueTransform.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java b/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java index 10f54da341e8c..3f32f78871c60 100644 --- a/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java +++ b/test/hotspot/jtreg/compiler/c2/gvn/TestBitCompressValueTransform.java @@ -76,10 +76,7 @@ public long test1(long value) { @Run(test = "test1") public void run1(RunInfo info) { - long res = 0; - for (int i = 0; i < 100; i++) { - res |= test1(field_L); - } + long res = test1(field_L); Asserts.assertEQ(res, gold_L); } @@ -92,10 +89,7 @@ public int test2(int value) { @Run(test = "test2") public void run2(RunInfo info) { - int res = 0; - for (int i = 0; i < 100; i++) { - res |= test2(field_I); - } + int res = test2(field_I); Asserts.assertEQ(res, gold_I); } @@ -327,10 +321,7 @@ public int test15(int src, int mask) { @Run (test = "test15") public void run15(RunInfo info) { - int res = 0; - for (int i = 0; i < 100; i++) { - res |= test15(0, 0); - } + int res = test15(0, 0); Asserts.assertEQ(0, res); }