Move virtual method call out of loop
authorChris Lattner <sabre@nondot.org>
Wed, 15 Dec 2004 07:04:32 +0000 (07:04 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 15 Dec 2004 07:04:32 +0000 (07:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18955 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegAllocIterativeScan.cpp
lib/CodeGen/RegAllocLinearScan.cpp

index e5f7be7336620c0774f05bc4c16613adc7d4586d..d523906392eaabcb7ee5bc635268ed93c33b65b0 100644 (file)
@@ -397,8 +397,8 @@ void RA::assignRegOrSpillAtInterval(IntervalPtrs::value_type cur)
   float minWeight = HUGE_VAL;
   unsigned minReg = 0;
   const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg);
-  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 (minWeight > spillWeights_[reg]) {
       minWeight = spillWeights_[reg];
@@ -477,8 +477,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]))
index 140846fe01e3b63f1b1889c44ae08829be04e4ce..2b389117e7e0385d8458e8deebcbbbfcfe18df34 100644 (file)
@@ -426,8 +426,8 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur)
   float minWeight = HUGE_VAL;
   unsigned minReg = 0;
   const TargetRegisterClass* rc = mf_->getSSARegMap()->getRegClass(cur->reg);
-  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 (minWeight > SpillWeights[reg]) {
       minWeight = SpillWeights[reg];