From: Owen Anderson Date: Mon, 23 Jun 2008 22:12:23 +0000 (+0000) Subject: Use getMBBEndIdx rather than assuming that the end is right after the last instructio... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b3db9c90d24682340f043a8151063128fe3b220b;p=oota-llvm.git Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52649 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index ed295ac0071..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;