From 184353866168d0efaf80e8b44316d76f8a8bb785 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 10 Oct 2024 08:19:23 -0700 Subject: [PATCH 1/4] 8341831: PhaseCFG::insert_anti_dependences asserts with "no loads" Summary: Relax assert to deal with CacheWB nodes --- src/hotspot/share/opto/gcm.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/gcm.cpp b/src/hotspot/share/opto/gcm.cpp index dd51bb4709452..e6c3fa5e4cb1f 100644 --- a/src/hotspot/share/opto/gcm.cpp +++ b/src/hotspot/share/opto/gcm.cpp @@ -763,7 +763,15 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { worklist_def_use_mem_states.pop(); uint op = use_mem_state->Opcode(); - assert(!use_mem_state->needs_anti_dependence_check(), "no loads"); + +#ifdef ASSERT + bool is_cache_wb = false; + if (use_mem_state->is_Mach()) { + int ideal_op = use_mem_state->as_Mach()->ideal_Opcode(); + is_cache_wb = (ideal_op == Op_CacheWB || ideal_op == Op_CacheWBPostSync || ideal_op == Op_CacheWBPreSync); + } + assert(!use_mem_state->needs_anti_dependence_check() || is_cache_wb, "no loads"); +#endif // MergeMems do not directly have anti-deps. // Treat them as internal nodes in a forward tree of memory states, From b8e0d8bdd95d52436e27304dddf15595fa8af037 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 10 Oct 2024 08:32:56 -0700 Subject: [PATCH 2/4] Remove the test from the problem list --- test/hotspot/jtreg/ProblemList.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index e85b742a53b8b..3ff450dc3ad92 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -43,8 +43,6 @@ # :hotspot_compiler -applications/ctw/modules/java_base_2.java 8341831 linux-x64 - compiler/ciReplay/TestSAServer.java 8029528 generic-all compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all From ae69ee4b10db4098e7be5280d5c29ae0847c1479 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Thu, 10 Oct 2024 10:22:43 -0700 Subject: [PATCH 3/4] Add comment --- src/hotspot/share/opto/gcm.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hotspot/share/opto/gcm.cpp b/src/hotspot/share/opto/gcm.cpp index e6c3fa5e4cb1f..dde120a0b2497 100644 --- a/src/hotspot/share/opto/gcm.cpp +++ b/src/hotspot/share/opto/gcm.cpp @@ -765,6 +765,8 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { uint op = use_mem_state->Opcode(); #ifdef ASSERT + // CacheWB nodes are peculiar in a sense that they both are anti-dependent and produce memory. + // Allow them to be treated as a store. bool is_cache_wb = false; if (use_mem_state->is_Mach()) { int ideal_op = use_mem_state->as_Mach()->ideal_Opcode(); From 914b97ac83cd12c145603707a273093af3069fc6 Mon Sep 17 00:00:00 2001 From: Igor Veresov Date: Fri, 11 Oct 2024 13:35:00 -0700 Subject: [PATCH 4/4] Address Dean's comment --- src/hotspot/share/opto/gcm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/opto/gcm.cpp b/src/hotspot/share/opto/gcm.cpp index dde120a0b2497..c46d69058e99d 100644 --- a/src/hotspot/share/opto/gcm.cpp +++ b/src/hotspot/share/opto/gcm.cpp @@ -770,7 +770,7 @@ Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) { bool is_cache_wb = false; if (use_mem_state->is_Mach()) { int ideal_op = use_mem_state->as_Mach()->ideal_Opcode(); - is_cache_wb = (ideal_op == Op_CacheWB || ideal_op == Op_CacheWBPostSync || ideal_op == Op_CacheWBPreSync); + is_cache_wb = (ideal_op == Op_CacheWB); } assert(!use_mem_state->needs_anti_dependence_check() || is_cache_wb, "no loads"); #endif