aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SimpleRegisterCoalescing.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-23 22:12:23 +0000
committerOwen Anderson <resistor@mac.com>2008-06-23 22:12:23 +0000
commitb3db9c90d24682340f043a8151063128fe3b220b (patch)
treef9a2366bfb9c2fdce3ecca2dc27ce40ec5050940 /lib/CodeGen/SimpleRegisterCoalescing.cpp
parent73b43b9b549a75fb0015c825df68abd95705a67c (diff)
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
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r--lib/CodeGen/SimpleRegisterCoalescing.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp
index ed295ac007..bc833633ed 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;