6837146: Should perform unswitch before maximally unroll in loop transformation
authorcfang
Thu, 28 May 2009 09:37:18 -0700
changeset 2876 b8ebc85d0b47
parent 2875 549b4d80b29e
child 2878 a9dca86798e4
6837146: Should perform unswitch before maximally unroll in loop transformation Summary: Move loop unswitch before maximally unroll Reviewed-by: never
hotspot/src/share/vm/opto/loopTransform.cpp
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Wed May 27 12:35:51 2009 -0700
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp	Thu May 28 09:37:18 2009 -0700
@@ -1630,6 +1630,10 @@
   // Before attempting fancy unrolling, RCE or alignment, see if we want
   // to completely unroll this loop or do loop unswitching.
   if( cl->is_normal_loop() ) {
+    if (should_unswitch) {
+      phase->do_unswitching(this, old_new);
+      return true;
+    }
     bool should_maximally_unroll =  policy_maximally_unroll(phase);
     if( should_maximally_unroll ) {
       // Here we did some unrolling and peeling.  Eventually we will
@@ -1637,10 +1641,6 @@
       phase->do_maximally_unroll(this,old_new);
       return true;
     }
-    if (should_unswitch) {
-      phase->do_unswitching(this, old_new);
-      return true;
-    }
   }