diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-12-05 07:30:23 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-12-05 07:30:23 +0000 |
commit | dc492e037034e7671e3fb9ab3e041186cdc97508 (patch) | |
tree | df3847bde71d72374341314e7bccd5ae654273fa /lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 750e0e0ad0e599fe701e5492eef5c2cab05f2e5c (diff) | |
download | external_llvm-dc492e037034e7671e3fb9ab3e041186cdc97508.zip external_llvm-dc492e037034e7671e3fb9ab3e041186cdc97508.tar.gz external_llvm-dc492e037034e7671e3fb9ab3e041186cdc97508.tar.bz2 |
Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 0945634..35337ef 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -157,15 +157,19 @@ bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li, I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) { for (SlotIndex index = I->start.getBaseIndex(), end = I->end.getPrevSlot().getBaseIndex().getNextIndex(); - index != end; - index = index.getNextIndex()) { + index != end; + index = index.getNextIndex()) { MachineInstr *MI = getInstructionFromIndex(index); if (!MI) continue; // skip deleted instructions + unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; + if (tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubReg, DstSubReg)) + if (SrcReg == li.reg || DstReg == li.reg) + continue; for (unsigned i = 0; i != MI->getNumOperands(); ++i) { MachineOperand& mop = MI->getOperand(i); - if (!mop.isReg() || mop.isUse()) + if (!mop.isReg()) continue; unsigned PhysReg = mop.getReg(); if (PhysReg == 0 || PhysReg == li.reg) @@ -184,50 +188,6 @@ bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li, return false; } -/// conflictsWithPhysRegUse - Returns true if the specified register is used or -/// defined during the duration of the specified interval. Copies to and from -/// li.reg are allowed. -bool LiveIntervals::conflictsWithPhysRegUse(const LiveInterval &li, - VirtRegMap &vrm, unsigned reg) { - for (LiveInterval::Ranges::const_iterator - I = li.ranges.begin(), E = li.ranges.end(); I != E; ++I) { - for (SlotIndex index = I->start.getBaseIndex(), - end = I->end.getPrevSlot().getBaseIndex().getNextIndex(); - index != end; - index = index.getNextIndex()) { - MachineInstr *MI = getInstructionFromIndex(index); - if (!MI) - continue; // skip deleted instructions - - // Terminators are considered conflicts since reg may be used at the - // destination. - if (MI->getDesc().isTerminator()) - return true; - - for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { - MachineOperand& mop = MI->getOperand(i); - if (!mop.isReg() || mop.isUndef()) - continue; - unsigned PhysReg = mop.getReg(); - if (PhysReg == 0 || PhysReg == li.reg) - continue; - if (TargetRegisterInfo::isVirtualRegister(PhysReg)) { - if (!vrm.hasPhys(PhysReg)) - continue; - PhysReg = vrm.getPhys(PhysReg); - } - if (PhysReg && tri_->regsOverlap(PhysReg, reg)) { - unsigned SrcReg, DstReg, SrcSubReg, DstSubReg; - if (!tii_->isMoveInstr(*MI, SrcReg, DstReg, SrcSubReg, DstSubReg) || - (SrcReg != li.reg && DstReg != li.reg)) - return true; - } - } - } - } - return false; -} - /// conflictsWithPhysRegRef - Similar to conflictsWithPhysRegRef except /// it can check use as well. bool LiveIntervals::conflictsWithPhysRegRef(LiveInterval &li, |