RFR(L): 8186027: C2: loop strip mining

Roland Westrelin rwestrel at redhat.com
Tue Nov 28 11:00:34 UTC 2017


Hi Vladimir,

> Roland, please, prepare changeset.

Here is the changeset:

http://cr.openjdk.java.net/~roland/8186027/loop-strip-mining.patch

It includes the patch below to enable it with G1.

Roland.

diff --git a/src/hotspot/share/gc/g1/g1Arguments.cpp b/src/hotspot/share/gc/g1/g1Arguments.cpp
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp
@@ -92,6 +92,16 @@
   }
 
   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
+
+#ifdef COMPILER2
+  // Enable loop strip mining to offer better pause time guarantees
+  if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
+    FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
+  }
+  if (UseCountedLoopSafepoints && FLAG_IS_DEFAULT(LoopStripMiningIter)) {
+    FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
+  }
+#endif
 }
 
 CollectedHeap* G1Arguments::create_heap() {
diff --git a/src/hotspot/share/opto/c2_globals.hpp b/src/hotspot/share/opto/c2_globals.hpp
--- a/src/hotspot/share/opto/c2_globals.hpp
+++ b/src/hotspot/share/opto/c2_globals.hpp
@@ -741,7 +741,7 @@
   develop(bool, RenumberLiveNodes, true,                                    \
           "Renumber live nodes")                                            \
                                                                             \
-  product(uintx, LoopStripMiningIter, 1000,                                 \
+  product(uintx, LoopStripMiningIter, 0,                                    \
           "Number of iterations in strip mined loop")                       \
           range(0, max_juint)                                               \
                                                                             \


More information about the hotspot-compiler-dev mailing list