aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2004-12-07 05:25:53 +0000
committerNate Begeman <natebegeman@mac.com>2004-12-07 05:25:53 +0000
commit80ad87d2271673b4f9148d64c91ee6338978c9fc (patch)
tree96cafdaac5c3812e5d8b1187524b17de088f53c4
parentce9653ce449f1409815547e1bf60abcd1332d2c9 (diff)
downloadexternal_llvm-80ad87d2271673b4f9148d64c91ee6338978c9fc.zip
external_llvm-80ad87d2271673b4f9148d64c91ee6338978c9fc.tar.gz
external_llvm-80ad87d2271673b4f9148d64c91ee6338978c9fc.tar.bz2
Move virtual function call out of loop to speed up getFreePhysReg by about
20%, shaving 0.1s off hbd compile time on my g5. Yay. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18592 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index c54152a..140846f 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -608,8 +608,8 @@ unsigned RA::getFreePhysReg(LiveInterval* cur)
const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg);
unsigned freeReg = 0;
- for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_);
- i != rc->allocation_order_end(*mf_); ++i) {
+ for (TargetRegisterClass::iterator i = rc->allocation_order_begin(*mf_),
+ e = rc->allocation_order_end(*mf_); i != e; ++i) {
unsigned reg = *i;
if (prt_->isRegAvail(reg) &&
(!freeReg || inactiveCounts[freeReg] < inactiveCounts[reg]))