From 32715882baa4254dd50c57755b2b4b4032c48830 Mon Sep 17 00:00:00 2001 From: Christian Hagedorn Date: Mon, 31 Mar 2025 09:21:00 +0200 Subject: [PATCH] 8353058: [PPC64] Some IR framework tests are failing after JDK-8314999 --- .../tests/TestPhaseIRMatching.java | 83 ++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java index f2dd871ae83a9..a2d98d00502b5 100644 --- a/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java +++ b/test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestPhaseIRMatching.java @@ -124,76 +124,87 @@ public void removeDuplicates() { i = 34; } + // Test failures on ideal phases only. @Test - @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}, - counts = {IRNode.STORE, "3", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) - @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_IDEAL, failOn = 1, counts = {1, 3}) - @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) + @IR(failOn = {IRNode.STORE, IRNode.OOPMAP_WITH, "asdf", IRNode.COUNTED_LOOP}, + counts = {IRNode.STORE, "2", IRNode.FIELD_ACCESS, "2", IRNode.STORE_I, "1"}) + @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_IDEAL, failOn = 1) - @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}) - @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_IDEAL, failOn = 1) - @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) + @IR(failOn = {IRNode.STORE_F, IRNode.OOPMAP_WITH, "asdf", IRNode.COUNTED_LOOP}, + counts = {IRNode.STORE, "2", IRNode.FIELD_ACCESS, "2", IRNode.STORE_I, "2"}) + @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_IDEAL, counts = 3) - @IR(counts = {IRNode.STORE, "3", IRNode.FIELD_ACCESS, "1", IRNode.COUNTED_LOOP, "2"}) - @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) - @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 2) + @IR(failOn = {IRNode.STORE, IRNode.OOPMAP_WITH, "asdf", IRNode.COUNTED_LOOP}) + @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_IDEAL, failOn = 1) + + @IR(counts = {IRNode.STORE, "3", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) + @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) + + @IR(failOn = {IRNode.STORE, IRNode.OOPMAP_WITH, "asdf", IRNode.COUNTED_LOOP}, + counts = {IRNode.STORE, "3", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) + @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_IDEAL, failOn = 1, counts = {1, 3}) @IR(counts = {IRNode.STORE_I, "2"}) - @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_IDEAL, counts = 1) + @ExpectedFailure(ruleId = 6, phase = CompilePhase.PRINT_IDEAL, counts = 1) public void defaultOnIdeal() { i = 34; l = 34; } + // Test failures on mach phases only. @Test @IR(failOn = {IRNode.STORE_F, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}, - counts = {IRNode.STORE_F, "3", IRNode.FIELD_ACCESS, "1", IRNode.COUNTED_LOOP, "2"}) + counts = {IRNode.STORE_I, "1", IRNode.FIELD_ACCESS, "2", IRNode.OOPMAP_WITH, "asdf", "< 2"}) @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) - @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) + + @IR(failOn = {IRNode.STORE_F, IRNode.OOPMAP_WITH, "asdf", IRNode.COUNTED_LOOP}, + counts = {IRNode.STORE_I, "1", IRNode.FIELD_ACCESS, "1", IRNode.OOPMAP_WITH, "asdf", "< 2"}) + @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 2) @IR(failOn = {IRNode.STORE_F, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}) - @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) + @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) - @IR(counts = {IRNode.STORE_F, "3", IRNode.FIELD_ACCESS, "1", IRNode.COUNTED_LOOP, "2"}) - @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) + @IR(counts = {IRNode.STORE_I, "1", IRNode.FIELD_ACCESS, "1", IRNode.OOPMAP_WITH, "asdf", "3"}) + @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = {2, 3}) @IR(failOn = {IRNode.STORE_F, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}, - counts = {IRNode.STORE_F, "3", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) - - @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2, counts = 2) - @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) + counts = {IRNode.STORE_I, "1", IRNode.FIELD_ACCESS, "1", IRNode.OOPMAP_WITH, "asdf", "3"}) + @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2, counts = {2, 3}) - @IR(counts = {IRNode.FIELD_ACCESS, "2"}) - @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 1) - public Object defaultOnOptoAssembly(Helper h) { - return h.getString(); + @IR(counts = {IRNode.FIELD_ACCESS, "1"}) + @ExpectedFailure(ruleId = 6, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 1) + public void defaultOnOptoAssembly() { + i = 34; + l = 34; } + // Test failures on ideal and mach phases. @Test @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}, - counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "3", IRNode.COUNTED_LOOP, "2"}) + counts = {IRNode.STORE, "2", IRNode.FIELD_ACCESS, "2", IRNode.STORE_I, "1"}) + @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_IDEAL, failOn = 1) @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) - @ExpectedFailure(ruleId = 1, phase = CompilePhase.PRINT_IDEAL, failOn = 1, counts = {1, 3}) @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}) @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_IDEAL, failOn = 1) @ExpectedFailure(ruleId = 2, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2) - @IR(counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) - @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_IDEAL, counts = {1, 3}) + @IR(counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "1", IRNode.STORE_I, "1"}) + @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_IDEAL, counts = 1) @ExpectedFailure(ruleId = 3, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 2) @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP}, - counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "2", IRNode.COUNTED_LOOP, "2"}) - @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2, counts = 2) + counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "1", IRNode.COUNTED_LOOP, "2"}) @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_IDEAL, failOn = 1, counts = {1, 3}) + @ExpectedFailure(ruleId = 4, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2, counts = 2) - @IR(counts = {IRNode.FIELD_ACCESS, "2"}) - @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, counts = 1) - public Object defaultOnBoth(Helper h) { + @IR(failOn = {IRNode.STORE, IRNode.FIELD_ACCESS, IRNode.COUNTED_LOOP, IRNode.STORE_I}, + counts = {IRNode.STORE, "20", IRNode.FIELD_ACCESS, "1", IRNode.COUNTED_LOOP, "2", IRNode.OOPMAP_WITH, "asdf", "2"}) + @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_IDEAL, failOn = {1, 4}, counts = {1, 3}) + @ExpectedFailure(ruleId = 5, phase = CompilePhase.PRINT_OPTO_ASSEMBLY, failOn = 2, counts = {2, 4}) + public void defaultOnBoth() { i = 34; l = 34; - return h.getString(); } @Test @@ -215,7 +226,7 @@ public int removeLoopsWithMultipleCompilations(int k) { return x; } - @Run(test = {"removeLoopsWithMultipleCompilations", "defaultOnOptoAssembly", "defaultOnBoth"}) + @Run(test = "removeLoopsWithMultipleCompilations") @Warmup(1) public void run() { for (int i = 0; i < 10000; i++) { @@ -224,8 +235,6 @@ public void run() { for (int i = 0; i < 10000; i++) { removeLoopsWithMultipleCompilations(3); } - defaultOnOptoAssembly(new Helper("a", 1)); - defaultOnBoth(new Helper("a", 1)); } @Test