diff options
author | Owen Anderson <resistor@mac.com> | 2008-12-28 23:35:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-12-28 23:35:13 +0000 |
commit | b5232286a7dc6ee2c4f9cc2701be013ea0f3b91f (patch) | |
tree | 46782cf382c7e35eaa809f9ab6a7bbd3cd763830 /llvm/lib/CodeGen/PreAllocSplitting.cpp | |
parent | 4213188c7543af37414dee3702e123b36694ab2a (diff) | |
download | bcm5719-llvm-b5232286a7dc6ee2c4f9cc2701be013ea0f3b91f.tar.gz bcm5719-llvm-b5232286a7dc6ee2c4f9cc2701be013ea0f3b91f.zip |
Fix up kill/dead marking in the new live interval reconstruction code.
llvm-svn: 61460
Diffstat (limited to 'llvm/lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PreAllocSplitting.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/PreAllocSplitting.cpp b/llvm/lib/CodeGen/PreAllocSplitting.cpp index 0880f622974..3f303ae0989 100644 --- a/llvm/lib/CodeGen/PreAllocSplitting.cpp +++ b/llvm/lib/CodeGen/PreAllocSplitting.cpp @@ -722,10 +722,9 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction( NewVNs, Visited, false); // FIXME: Need to set kills properly for inter-block stuff. - if (toplevel) { - if (LI->isKill(ret, UseIndex)) LI->removeKill(ret, UseIndex); + if (LI->isKill(ret, UseIndex)) LI->removeKill(ret, UseIndex); + if (toplevel) LI->addKill(ret, EndIndex); - } LI->addRange(LiveRange(UseIndex, EndIndex, ret)); } else if (ContainsDefs && ContainsUses){ @@ -778,10 +777,9 @@ VNInfo* PreAllocSplitting::PerformPHIConstruction( ret = PerformPHIConstruction(walker, LI, Defs, Uses, NewVNs, Visited, false); - // FIXME: Need to set kills properly for inter-block stuff. + if (foundUse && LI->isKill(ret, StartIndex)) + LI->removeKill(ret, StartIndex); if (toplevel) { - if (foundUse && LI->isKill(ret, StartIndex)) - LI->removeKill(ret, StartIndex); LI->addKill(ret, EndIndex); } @@ -834,6 +832,20 @@ void PreAllocSplitting::ReconstructLiveInterval(LiveInterval* LI) { DenseMap<MachineBasicBlock*, VNInfo*> Visited; PerformPHIConstruction(&*UI, LI, Defs, Uses, NewVNs, Visited, true); } + + // Add ranges for dead defs + for (MachineRegisterInfo::def_iterator DI = MRI->def_begin(LI->reg), + DE = MRI->def_end(); DI != DE; ++DI) { + unsigned DefIdx = LIs->getInstructionIndex(&*DI); + DefIdx = LiveIntervals::getDefIndex(DefIdx); + unsigned UseIdx = LiveIntervals::getUseIndex(DefIdx); + + if (LI->liveAt(DefIdx)) continue; + + VNInfo* DeadVN = NewVNs[&*DI]; + LI->addRange(LiveRange(DefIdx, UseIdx, DeadVN)); + LI->addKill(DeadVN, DefIdx); + } } /// ShrinkWrapLiveInterval - Recursively traverse the predecessor |