hotspot/src/share/vm/opto/loopTransform.cpp
changeset 2876 b8ebc85d0b47
parent 2131 98f9cef66a34
child 3261 c7d5aae8d3f7
--- 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;
-    }
   }