summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-15 20:55:53 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-15 20:55:53 +0000
commit97825bcbfd105b8f57a3afb094479d833a64006f (patch)
tree00de40eade18dc510c9384aecd32ba30f33d9962 /llvm/lib/CodeGen
parentddf25c341ce8844898a523ce6535bd4e939179b8 (diff)
downloadbcm5719-llvm-97825bcbfd105b8f57a3afb094479d833a64006f.tar.gz
bcm5719-llvm-97825bcbfd105b8f57a3afb094479d833a64006f.zip
Fix PR8612 in the standard spiller as well.
The live range of a register defined by an early clobber starts at the use slot, not the def slot. llvm-svn: 119183
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index aa2f9658874..b77d43fe9a8 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1136,11 +1136,14 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
rewriteImplicitOps(li, MI, NewVReg, vrm);
// Reuse NewVReg for other reads.
+ bool HasEarlyClobber = false;
for (unsigned j = 0, e = Ops.size(); j != e; ++j) {
MachineOperand &mopj = MI->getOperand(Ops[j]);
mopj.setReg(NewVReg);
if (mopj.isImplicit())
rewriteImplicitOps(li, MI, NewVReg, vrm);
+ if (mopj.isEarlyClobber())
+ HasEarlyClobber = true;
}
if (CreatedNewVReg) {
@@ -1199,7 +1202,8 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
}
}
if (HasDef) {
- LiveRange LR(index.getDefIndex(), index.getStoreIndex(),
+ LiveRange LR(HasEarlyClobber ? index.getUseIndex() : index.getDefIndex(),
+ index.getStoreIndex(),
nI.getNextValue(SlotIndex(), 0, VNInfoAllocator));
DEBUG(dbgs() << " +" << LR);
nI.addRange(LR);
OpenPOWER on IntegriCloud