changeset 5096:1a8e36934dfe

8022993: Convert MAX_UNROLL constant to LoopMaxUnroll C2 flag Summary: Replace MAX_UNROLL constant with new C2 LoopMaxUnroll flag. Reviewed-by: roland
author kvn
date Wed, 14 Aug 2013 10:21:26 -0700
parents 55221e76f69e
children 48f2de0394ac
files src/share/vm/opto/c2_globals.hpp src/share/vm/opto/loopTransform.cpp
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/c2_globals.hpp	Fri Aug 23 18:04:35 2013 -0700
+++ b/src/share/vm/opto/c2_globals.hpp	Wed Aug 14 10:21:26 2013 -0700
@@ -173,6 +173,9 @@
   product_pd(intx,  LoopUnrollLimit,                                        \
           "Unroll loop bodies with node count less than this")              \
                                                                             \
+  product(intx,  LoopMaxUnroll, 16,                                         \
+          "Maximum number of unrolls for main loop")                        \
+                                                                            \
   product(intx,  LoopUnrollMin, 4,                                          \
           "Minimum number of unroll loop bodies before checking progress"   \
           "of rounds of unroll,optimize,..")                                \
--- a/src/share/vm/opto/loopTransform.cpp	Fri Aug 23 18:04:35 2013 -0700
+++ b/src/share/vm/opto/loopTransform.cpp	Wed Aug 14 10:21:26 2013 -0700
@@ -623,8 +623,6 @@
 }
 
 
-#define MAX_UNROLL 16 // maximum number of unrolls for main loop
-
 //------------------------------policy_unroll----------------------------------
 // Return TRUE or FALSE if the loop should be unrolled or not.  Unroll if
 // the loop is a CountedLoop and the body is small enough.
@@ -641,7 +639,7 @@
   if (cl->trip_count() <= (uint)(cl->is_normal_loop() ? 2 : 1)) return false;
 
   int future_unroll_ct = cl->unrolled_count() * 2;
-  if (future_unroll_ct > MAX_UNROLL) return false;
+  if (future_unroll_ct > LoopMaxUnroll) return false;
 
   // Check for initial stride being a small enough constant
   if (abs(cl->stride_con()) > (1<<2)*future_unroll_ct) return false;