diff options
author | Owen Anderson <resistor@mac.com> | 2008-06-23 22:12:23 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-06-23 22:12:23 +0000 |
commit | 79d2fa52fa7fe59f6e61d1e1282993db34184160 (patch) | |
tree | 9a65fc2120c435027c970ef1bc3d8a19b66fab6a /llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | ac563833ae1e354551d3c80ce007984fae27bfd2 (diff) |
Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block.
llvm-svn: 52649
Diffstat (limited to 'llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index ed295ac00713..bc833633ed24 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/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; |