diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-01 01:59:31 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-01 01:59:31 +0000 |
commit | 2578ba26e72e36dde64be0f52a2788480aad3378 (patch) | |
tree | cff0b3ae5b241d3ad9f268cdf515d8cff4f3aada /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | 5bcc8bd0c60cfe583ee47852950aad9e532c932e (diff) | |
download | external_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.zip external_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.tar.gz external_llvm-2578ba26e72e36dde64be0f52a2788480aad3378.tar.bz2 |
Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 2caa2f9..904b4cb 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -545,26 +545,6 @@ void RALinScan::linearScan() if (!isPhys && vrm_->getPreSplitReg(cur.reg)) continue; - // A register defined by an implicit_def can be liveout the def BB and livein - // to a use BB. Add it to the livein set of the use BB's. - if (!isPhys && cur.empty()) { - if (MachineInstr *DefMI = mri_->getVRegDef(cur.reg)) { - assert(DefMI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF); - MachineBasicBlock *DefMBB = DefMI->getParent(); - SmallPtrSet<MachineBasicBlock*, 4> Seen; - Seen.insert(DefMBB); - for (MachineRegisterInfo::reg_iterator ri = mri_->reg_begin(cur.reg), - re = mri_->reg_end(); ri != re; ++ri) { - MachineInstr *UseMI = &*ri; - MachineBasicBlock *UseMBB = UseMI->getParent(); - if (Seen.insert(UseMBB)) { - assert(TargetRegisterInfo::isPhysicalRegister(Reg) && - "Adding a virtual register to livein set?"); - UseMBB->addLiveIn(Reg); - } - } - } - } for (LiveInterval::Ranges::const_iterator I = cur.begin(), E = cur.end(); I != E; ++I) { const LiveRange &LR = *I; @@ -905,17 +885,6 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) DOUT << tri_->getName(physReg) << '\n'; // Note the register is not really in use. vrm_->assignVirt2Phys(cur->reg, physReg); - // Since the register allocator is allowed to assign this virtual register - // physical register that overlaps other live intervals. Mark these - // operands as "Undef" which means later passes, e.g. register scavenger - // can ignore them. - for (MachineRegisterInfo::reg_iterator RI = mri_->reg_begin(cur->reg), - RE = mri_->reg_end(); RI != RE; ++RI) { - MachineOperand &MO = RI.getOperand(); - MO.setIsUndef(); - if (MO.isKill()) - MO.setIsKill(false); - } return; } |