summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-21 00:09:15 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-06-21 00:09:15 +0000
commit71b49cb5c73ba912f2fab30f35ed1e43c35a2139 (patch)
tree794a60b82d1f6ee02a99a6dce75a966cf3161e61
parente3c9ccd3127565298bf0e5211bb2e4f95bd5b796 (diff)
downloadllvm-71b49cb5c73ba912f2fab30f35ed1e43c35a2139.tar.gz
llvm-71b49cb5c73ba912f2fab30f35ed1e43c35a2139.tar.bz2
llvm-71b49cb5c73ba912f2fab30f35ed1e43c35a2139.tar.xz
Update regunits in RegisterCoalescer::reMaterializeTrivialDef.
Old code would only update physreg live intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158881 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/CodeGen/RegisterCoalescer.cpp b/lib/CodeGen/RegisterCoalescer.cpp
index 395884d400..de58b82d3a 100644
--- a/lib/CodeGen/RegisterCoalescer.cpp
+++ b/lib/CodeGen/RegisterCoalescer.cpp
@@ -797,12 +797,10 @@ bool RegisterCoalescer::reMaterializeTrivialDef(LiveInterval &SrcInt,
SlotIndex NewMIIdx = LIS->getInstructionIndex(NewMI);
for (unsigned i = 0, e = NewMIImplDefs.size(); i != e; ++i) {
- unsigned reg = NewMIImplDefs[i];
- LiveInterval &li = LIS->getInterval(reg);
- VNInfo *DeadDefVN = li.getNextValue(NewMIIdx.getRegSlot(),
- LIS->getVNInfoAllocator());
- LiveRange lr(NewMIIdx.getRegSlot(), NewMIIdx.getDeadSlot(), DeadDefVN);
- li.addRange(lr);
+ unsigned Reg = NewMIImplDefs[i];
+ for (MCRegUnitIterator Units(Reg, TRI); Units.isValid(); ++Units)
+ if (LiveInterval *LI = LIS->getCachedRegUnit(*Units))
+ LI->createDeadDef(NewMIIdx.getRegSlot(), LIS->getVNInfoAllocator());
}
CopyMI->eraseFromParent();