LegalizeTypes soft-float support for stores of a
[oota-llvm.git] / lib / CodeGen / SimpleRegisterCoalescing.cpp
index 24e7fdefc7bd5797a88cd61214cc7cf042fc691e..bc833633ed24f05cb43fa5458e1605b02ee6e3b3 100644 (file)
@@ -443,7 +443,7 @@ bool SimpleRegisterCoalescing::isBackEdgeCopy(MachineInstr *CopyMI,
     LI.FindLiveRangeContaining(li_->getDefIndex(DefIdx));
   if (DstLR == LI.end())
     return false;
-  unsigned KillIdx = li_->getInstructionIndex(&MBB->back()) + InstrSlots::NUM;
+  unsigned KillIdx = li_->getMBBEndIdx(MBB) + 1;
   if (DstLR->valno->kills.size() == 1 &&
       DstLR->valno->kills[0] == KillIdx && DstLR->valno->hasPHIKill)
     return true;
@@ -2145,7 +2145,6 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
         mii = mbbi->erase(mii);
         ++numPeep;
       } else if (!isMove || !TurnCopyIntoImpDef(mii, mbb, DstReg, SrcReg)) {
-        bool isMem = mii->getDesc().mayLoad() || mii->getDesc().mayStore();
         SmallSet<unsigned, 4> UniqueUses;
         for (unsigned i = 0, e = mii->getNumOperands(); i != e; ++i) {
           const MachineOperand &mop = mii->getOperand(i);
@@ -2158,7 +2157,7 @@ bool SimpleRegisterCoalescing::runOnMachineFunction(MachineFunction &fn) {
               continue;
             LiveInterval &RegInt = li_->getInterval(reg);
             RegInt.weight +=
-              li_->getSpillWeight(mop.isDef(), mop.isUse(), isMem, loopDepth);
+              li_->getSpillWeight(mop.isDef(), mop.isUse(), loopDepth);
             UniqueUses.insert(reg);
           }
         }