summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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
commit784a0dcbd0b78d25b0ecd97d0b9edc5ca4f5a5e9 (patch)
tree8c4a15d74d44975b931b225ff6383ee3e04c4955 /llvm/lib/CodeGen
parent90839368354d2faeb99f727250934a49f85ad08f (diff)
downloadbcm5719-llvm-784a0dcbd0b78d25b0ecd97d0b9edc5ca4f5a5e9.tar.gz
bcm5719-llvm-784a0dcbd0b78d25b0ecd97d0b9edc5ca4f5a5e9.zip
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. llvm-svn: 18592
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index c54152a1492..140846fe01e 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/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]))
OpenPOWER on IntegriCloud