diff options
author | Lang Hames <lhames@gmail.com> | 2009-07-09 03:57:02 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2009-07-09 03:57:02 +0000 |
commit | ffd1326ff8dfc652a8026c3faebf55bbba7c32c7 (patch) | |
tree | a55447fb0b489320a44a07f28e10683915cecf61 /lib/CodeGen/PreAllocSplitting.cpp | |
parent | 482fa0f2bcfca5274b14c808526c8ae4fe97007d (diff) |
Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.
A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test
condition has been updated to reflect this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75097 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PreAllocSplitting.cpp')
-rw-r--r-- | lib/CodeGen/PreAllocSplitting.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/CodeGen/PreAllocSplitting.cpp b/lib/CodeGen/PreAllocSplitting.cpp index ae60c86c3d..076f4896cf 100644 --- a/lib/CodeGen/PreAllocSplitting.cpp +++ b/lib/CodeGen/PreAllocSplitting.cpp @@ -543,7 +543,7 @@ PreAllocSplitting::PerformPHIConstruction(MachineBasicBlock::iterator UseI, // FIXME: Need to set kills properly for inter-block stuff. if (LI->isKill(RetVNI, UseIndex)) LI->removeKill(RetVNI, UseIndex); if (IsIntraBlock) - LI->addKill(RetVNI, EndIndex); + LI->addKill(RetVNI, EndIndex, false); } else if (ContainsDefs && ContainsUses) { SmallPtrSet<MachineInstr*, 2>& BlockDefs = Defs[MBB]; SmallPtrSet<MachineInstr*, 2>& BlockUses = Uses[MBB]; @@ -605,7 +605,7 @@ PreAllocSplitting::PerformPHIConstruction(MachineBasicBlock::iterator UseI, if (foundUse && LI->isKill(RetVNI, StartIndex)) LI->removeKill(RetVNI, StartIndex); if (IsIntraBlock) { - LI->addKill(RetVNI, EndIndex); + LI->addKill(RetVNI, EndIndex, false); } } @@ -682,7 +682,7 @@ PreAllocSplitting::PerformPHIConstructionFallBack(MachineBasicBlock::iterator Us I->second->setHasPHIKill(true); unsigned KillIndex = LIs->getMBBEndIdx(I->first); if (!LiveInterval::isKill(I->second, KillIndex)) - LI->addKill(I->second, KillIndex); + LI->addKill(I->second, KillIndex, false); } } @@ -694,7 +694,7 @@ PreAllocSplitting::PerformPHIConstructionFallBack(MachineBasicBlock::iterator Us EndIndex = LIs->getMBBEndIdx(MBB); LI->addRange(LiveRange(StartIndex, EndIndex+1, RetVNI)); if (IsIntraBlock) - LI->addKill(RetVNI, EndIndex); + LI->addKill(RetVNI, EndIndex, false); // Memoize results so we don't have to recompute them. if (!IsIntraBlock) @@ -771,7 +771,7 @@ void PreAllocSplitting::ReconstructLiveInterval(LiveInterval* LI) { VNInfo* DeadVN = NewVNs[&*DI]; LI->addRange(LiveRange(DefIdx, DefIdx+1, DeadVN)); - LI->addKill(DeadVN, DefIdx); + LI->addKill(DeadVN, DefIdx, false); } } @@ -801,14 +801,15 @@ void PreAllocSplitting::RenumberValno(VNInfo* VN) { VNsToCopy.push_back(OldVN); // Locate two-address redefinitions - for (SmallVector<unsigned, 4>::iterator KI = OldVN->kills.begin(), + for (VNInfo::KillSet::iterator KI = OldVN->kills.begin(), KE = OldVN->kills.end(); KI != KE; ++KI) { - MachineInstr* MI = LIs->getInstructionFromIndex(*KI); + assert(!KI->isPHIKill && "VN previously reported having no PHI kills."); + MachineInstr* MI = LIs->getInstructionFromIndex(KI->killIdx); unsigned DefIdx = MI->findRegisterDefOperandIdx(CurrLI->reg); if (DefIdx == ~0U) continue; if (MI->isRegTiedToUseOperand(DefIdx)) { VNInfo* NextVN = - CurrLI->findDefinedVNInfo(LiveIntervals::getDefIndex(*KI)); + CurrLI->findDefinedVNInfo(LiveIntervals::getDefIndex(KI->killIdx)); if (NextVN == OldVN) continue; Stack.push_back(NextVN); } |