summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-14 18:45:38 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-14 18:45:38 +0000
commit7e6004a3c1ca14699eee5b546bba0efdb6cc9966 (patch)
tree2d78efd03695a779fd67cdf661dc2aeaeb4cb60d /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent6b0a1e36628f9f980074254904897811352fb748 (diff)
downloadbcm5719-llvm-7e6004a3c1ca14699eee5b546bba0efdb6cc9966.tar.gz
bcm5719-llvm-7e6004a3c1ca14699eee5b546bba0efdb6cc9966.zip
Fix early-clobber handling in shrinkToUses.
I broke this in r144515, it affected most ARM testers. <rdar://problem/10441389> llvm-svn: 144547
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 2ec2cbc5995..edcfebe866e 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -659,7 +659,9 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
if (UseMI->isDebugValue() || !UseMI->readsVirtualRegister(li->reg))
continue;
SlotIndex Idx = getInstructionIndex(UseMI).getRegSlot();
- VNInfo *VNI = li->getVNInfoAt(Idx.getBaseIndex());
+ // Note: This intentionally picks up the wrong VNI in case of an EC redef.
+ // See below.
+ VNInfo *VNI = li->getVNInfoBefore(Idx);
if (!VNI) {
// This shouldn't happen: readsVirtualRegister returns true, but there is
// no live value. It is likely caused by a target getting <undef> flags
@@ -669,10 +671,11 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
<< *li << '\n');
continue;
}
- if (VNI->def == Idx.getRegSlot(true)) {
- // Special case: An early-clobber tied operand reads and writes the
- // register one slot early.
- Idx = Idx.getRegSlot(true);
+ // Special case: An early-clobber tied operand reads and writes the
+ // register one slot early. The getVNInfoBefore call above would have
+ // picked up the value defined by UseMI. Adjust the kill slot and value.
+ if (SlotIndex::isSameInstr(VNI->def, Idx)) {
+ Idx = VNI->def;
VNI = li->getVNInfoBefore(Idx);
assert(VNI && "Early-clobber tied value not available");
}
@@ -687,13 +690,6 @@ bool LiveIntervals::shrinkToUses(LiveInterval *li,
if (VNI->isUnused())
continue;
NewLI.addRange(LiveRange(VNI->def, VNI->def.getDeadSlot(), VNI));
-
- // A use tied to an early-clobber def ends at the load slot and isn't caught
- // above. Catch it here instead. This probably only ever happens for inline
- // assembly.
- if (VNI->def.isEarlyClobber())
- if (VNInfo *UVNI = li->getVNInfoBefore(VNI->def))
- WorkList.push_back(std::make_pair(VNI->def, UVNI));
}
// Keep track of the PHIs that are in use.
OpenPOWER on IntegriCloud