diff --git a/include/llvm/CodeGen/LiveIntervalAnalysis.h b/include/llvm/CodeGen/LiveIntervalAnalysis.h index 8f5fd3a648d..2e238085734 100644 --- a/include/llvm/CodeGen/LiveIntervalAnalysis.h +++ b/include/llvm/CodeGen/LiveIntervalAnalysis.h @@ -94,8 +94,6 @@ namespace llvm { MachineBasicBlock::iterator currentInstr_; LiveVariables* lv_; - std::vector allocatableRegisters_; - typedef std::map MbbIndex2MbbMap; MbbIndex2MbbMap mbbi2mbbMap_; diff --git a/include/llvm/CodeGen/LiveIntervals.h b/include/llvm/CodeGen/LiveIntervals.h index 8f5fd3a648d..2e238085734 100644 --- a/include/llvm/CodeGen/LiveIntervals.h +++ b/include/llvm/CodeGen/LiveIntervals.h @@ -94,8 +94,6 @@ namespace llvm { MachineBasicBlock::iterator currentInstr_; LiveVariables* lv_; - std::vector allocatableRegisters_; - typedef std::map MbbIndex2MbbMap; MbbIndex2MbbMap mbbi2mbbMap_; diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index bbc708238ac..4929a56e691 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -65,27 +65,12 @@ bool LiveIntervals::runOnMachineFunction(MachineFunction &fn) { tm_ = &fn.getTarget(); mri_ = tm_->getRegisterInfo(); lv_ = &getAnalysis(); - allocatableRegisters_.clear(); mbbi2mbbMap_.clear(); mi2iMap_.clear(); r2iMap_.clear(); r2iMap_.clear(); intervals_.clear(); - // mark allocatable registers - allocatableRegisters_.resize(MRegisterInfo::FirstVirtualRegister); - // Loop over all of the register classes... - for (MRegisterInfo::regclass_iterator - rci = mri_->regclass_begin(), rce = mri_->regclass_end(); - rci != rce; ++rci) { - // Loop over all of the allocatable registers in the function... - for (TargetRegisterClass::iterator - i = (*rci)->allocation_order_begin(*mf_), - e = (*rci)->allocation_order_end(*mf_); i != e; ++i) { - allocatableRegisters_[*i] = true; // The reg is allocatable! - } - } - // number MachineInstrs unsigned miIndex = 0; for (MachineFunction::iterator mbb = mf_->begin(), mbbEnd = mf_->end(); @@ -206,11 +191,7 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb, MachineBasicBlock::iterator mi, unsigned reg) { - DEBUG(std::cerr << "\t\tregister: ";printRegName(reg); std::cerr << '\n'); - if (!lv_->getAllocatablePhysicalRegisters()[reg]) { - DEBUG(std::cerr << "\t\t\tnon allocatable register: ignoring\n"); - return; - } + DEBUG(std::cerr << "\t\tregister: "; printRegName(reg)); unsigned start = getInstructionIndex(*mi); unsigned end = start; @@ -259,7 +240,7 @@ void LiveIntervals::handleRegisterDef(MachineBasicBlock* mbb, unsigned reg) { if (reg < MRegisterInfo::FirstVirtualRegister) { - if (allocatableRegisters_[reg]) { + if (lv_->getAllocatablePhysicalRegisters()[reg]) { handlePhysicalRegisterDef(mbb, mi, reg); for (const unsigned* as = mri_->getAliasSet(reg); *as; ++as) handlePhysicalRegisterDef(mbb, mi, *as); diff --git a/lib/CodeGen/LiveIntervalAnalysis.h b/lib/CodeGen/LiveIntervalAnalysis.h index 8f5fd3a648d..2e238085734 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.h +++ b/lib/CodeGen/LiveIntervalAnalysis.h @@ -94,8 +94,6 @@ namespace llvm { MachineBasicBlock::iterator currentInstr_; LiveVariables* lv_; - std::vector allocatableRegisters_; - typedef std::map MbbIndex2MbbMap; MbbIndex2MbbMap mbbi2mbbMap_;