X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FSimpleRegisterCoalescing.cpp;h=bc833633ed24f05cb43fa5458e1605b02ee6e3b3;hb=5ac319ac7125b009adddcc49294d2e040c4a91e5;hp=24e7fdefc7bd5797a88cd61214cc7cf042fc691e;hpb=e00f5de361bcc69d05e07303460e6849668b7169;p=oota-llvm.git diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 24e7fdefc7b..bc833633ed2 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -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 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); } }