changeset 789:273b2358ef1a

6837146: Should perform unswitch before maximally unroll in loop transformation Summary: Move loop unswitch before maximally unroll Reviewed-by: never
author cfang
date Thu, 28 May 2009 09:37:18 -0700
parents 1851e1fb420e
children 8b0b8998e1c3
files src/share/vm/opto/loopTransform.cpp
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/loopTransform.cpp	Wed May 27 12:35:51 2009 -0700
+++ b/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;
-    }
   }