Mercurial > hg > truffle
comparison src/share/vm/opto/loopTransform.cpp @ 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 | 98cb887364d3 |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
788:1851e1fb420e | 789:273b2358ef1a |
---|---|
1628 compute_profile_trip_cnt(phase); | 1628 compute_profile_trip_cnt(phase); |
1629 | 1629 |
1630 // Before attempting fancy unrolling, RCE or alignment, see if we want | 1630 // Before attempting fancy unrolling, RCE or alignment, see if we want |
1631 // to completely unroll this loop or do loop unswitching. | 1631 // to completely unroll this loop or do loop unswitching. |
1632 if( cl->is_normal_loop() ) { | 1632 if( cl->is_normal_loop() ) { |
1633 if (should_unswitch) { | |
1634 phase->do_unswitching(this, old_new); | |
1635 return true; | |
1636 } | |
1633 bool should_maximally_unroll = policy_maximally_unroll(phase); | 1637 bool should_maximally_unroll = policy_maximally_unroll(phase); |
1634 if( should_maximally_unroll ) { | 1638 if( should_maximally_unroll ) { |
1635 // Here we did some unrolling and peeling. Eventually we will | 1639 // Here we did some unrolling and peeling. Eventually we will |
1636 // completely unroll this loop and it will no longer be a loop. | 1640 // completely unroll this loop and it will no longer be a loop. |
1637 phase->do_maximally_unroll(this,old_new); | 1641 phase->do_maximally_unroll(this,old_new); |
1638 return true; | |
1639 } | |
1640 if (should_unswitch) { | |
1641 phase->do_unswitching(this, old_new); | |
1642 return true; | 1642 return true; |
1643 } | 1643 } |
1644 } | 1644 } |
1645 | 1645 |
1646 | 1646 |