diff options
| author | Lang Hames <lhames@gmail.com> | 2010-09-25 12:04:16 +0000 |
|---|---|---|
| committer | Lang Hames <lhames@gmail.com> | 2010-09-25 12:04:16 +0000 |
| commit | 564956867e85b45ca72cd1d62d0ac0055175a22e (patch) | |
| tree | c8718a444f43d129a32618cab50863c6670de13a /llvm/lib/CodeGen/Spiller.cpp | |
| parent | 8b99b8a782cfa1680673acf3e247c242a714992e (diff) | |
| download | bcm5719-llvm-564956867e85b45ca72cd1d62d0ac0055175a22e.tar.gz bcm5719-llvm-564956867e85b45ca72cd1d62d0ac0055175a22e.zip | |
Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
llvm-svn: 114791
Diffstat (limited to 'llvm/lib/CodeGen/Spiller.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/Spiller.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/Spiller.cpp b/llvm/lib/CodeGen/Spiller.cpp index 40bb386c344..661b79c1b36 100644 --- a/llvm/lib/CodeGen/Spiller.cpp +++ b/llvm/lib/CodeGen/Spiller.cpp @@ -144,7 +144,7 @@ protected: vrm->addSpillSlotUse(ss, loadInstr); SlotIndex endIndex = loadIndex.getNextIndex(); VNInfo *loadVNI = - newLI->getNextValue(loadIndex, 0, true, lis->getVNInfoAllocator()); + newLI->getNextValue(loadIndex, 0, lis->getVNInfoAllocator()); newLI->addRange(LiveRange(loadIndex, endIndex, loadVNI)); } @@ -158,7 +158,7 @@ protected: vrm->addSpillSlotUse(ss, storeInstr); SlotIndex beginIndex = storeIndex.getPrevIndex(); VNInfo *storeVNI = - newLI->getNextValue(beginIndex, 0, true, lis->getVNInfoAllocator()); + newLI->getNextValue(beginIndex, 0, lis->getVNInfoAllocator()); newLI->addRange(LiveRange(beginIndex, storeIndex, storeVNI)); } @@ -297,7 +297,8 @@ private: /// Extract the given value number from the interval. LiveInterval* extractVNI(LiveInterval *li, VNInfo *vni) const { - assert(vni->isDefAccurate() || vni->isPHIDef()); + assert((lis->getInstructionFromIndex(vni->def) != 0 || vni->isPHIDef()) && + "Def index not sane?"); // Create a new vreg and live interval, copy VNI ranges over. const TargetRegisterClass *trc = mri->getRegClass(li->reg); @@ -335,8 +336,11 @@ private: tii->get(TargetOpcode::COPY), newVReg) .addReg(li->reg, RegState::Kill); SlotIndex copyIdx = lis->InsertMachineInstrInMaps(copyMI); - VNInfo *phiDefVNI = li->getNextValue(lis->getMBBStartIdx(defMBB), - 0, false, lis->getVNInfoAllocator()); + SlotIndex phiDefIdx = lis->getMBBStartIdx(defMBB); + assert(lis->getInstructionFromIndex(phiDefIdx) == 0 && + "PHI def index points at actual instruction."); + VNInfo *phiDefVNI = li->getNextValue(phiDefIdx, + 0, lis->getVNInfoAllocator()); phiDefVNI->setIsPHIDef(true); li->addRange(LiveRange(phiDefVNI->def, copyIdx.getDefIndex(), phiDefVNI)); LiveRange *oldPHIDefRange = @@ -358,7 +362,6 @@ private: newVNI->def = copyIdx.getDefIndex(); newVNI->setCopy(copyMI); newVNI->setIsPHIDef(false); // not a PHI def anymore. - newVNI->setIsDefAccurate(true); } else { // non-PHI def. Rename the def. If it's two-addr that means renaming the // use and inserting a new copy too. @@ -391,7 +394,7 @@ private: li->getLiveRangeContaining(newVNI->def.getUseIndex()); origUseRange->end = copyIdx.getDefIndex(); VNInfo *copyVNI = newLI->getNextValue(copyIdx.getDefIndex(), copyMI, - true, lis->getVNInfoAllocator()); + lis->getVNInfoAllocator()); LiveRange copyRange(copyIdx.getDefIndex(),defIdx.getDefIndex(),copyVNI); newLI->addRange(copyRange); } @@ -448,7 +451,7 @@ private: // Insert a new range & vni for the two-address-to-copy value. This // will be attached to the new live interval. VNInfo *copyVNI = - newLI->getNextValue(useIdx.getDefIndex(), 0, true, + newLI->getNextValue(useIdx.getDefIndex(), 0, lis->getVNInfoAllocator()); LiveRange copyRange(useIdx.getDefIndex(),copyIdx.getDefIndex(),copyVNI); newLI->addRange(copyRange); @@ -481,8 +484,7 @@ private: } VNInfo *newKillVNI = li->getNextValue(copyIdx.getDefIndex(), - copyMI, true, - lis->getVNInfoAllocator()); + copyMI, lis->getVNInfoAllocator()); newKillVNI->setHasPHIKill(true); li->addRange(LiveRange(copyIdx.getDefIndex(), lis->getMBBEndIdx(killMBB), |

