Here is the piece of code in loop transformation: if( should_maximally_unroll ) { // Here we did some unrolling and peeling. Eventually we will // completely unroll this loop and it will no longer be a loop. phase->do_maximally_unroll(this,old_new); return true; } if (should_unswitch) { phase->do_unswitching(this, old_new); return true; } Suppose the loop can be both fully unrolled and unswitched, the loop unswitching optimization will never be executed. However, if we change the order of these two optimizations, both can be performed (and thus has the potential benefit).
|