# HG changeset patch # User cfang # Date 1243528638 25200 # Node ID 273b2358ef1ac7e618a3f2d26855d075640eb527 # Parent 1851e1fb420e542085ced391975036c49dc0ad91 6837146: Should perform unswitch before maximally unroll in loop transformation Summary: Move loop unswitch before maximally unroll Reviewed-by: never diff -r 1851e1fb420e -r 273b2358ef1a src/share/vm/opto/loopTransform.cpp --- 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; - } }