diff options
-rw-r--r-- | include/llvm/CodeGen/LiveVariables.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 3a0d044c59..737dabc1ae 100644 --- a/include/llvm/CodeGen/LiveVariables.h +++ b/include/llvm/CodeGen/LiveVariables.h @@ -202,6 +202,10 @@ public: /// register. VarInfo &getVarInfo(unsigned RegIdx); + const std::vector<bool>& getAllocatablePhysicalRegisters() const { + return AllocatablePhysicalRegisters; + } + void MarkVirtRegAliveInBlock(VarInfo &VRInfo, const BasicBlock *BB); void HandleVirtRegUse(VarInfo &VRInfo, MachineBasicBlock *MBB, MachineInstr *MI); diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 2a31e66851..52cf73be8b 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -183,6 +183,10 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb, unsigned reg) { DEBUG(std::cerr << "\t\t\tregister: ";printRegName(reg); std::cerr << '\n'); + if (!lv_->getAllocatablePhysicalRegisters()[reg]) { + DEBUG(std::cerr << "\t\t\t\tnon allocatable register: ignoring\n"); + return; + } unsigned start = getInstructionIndex(*mi); unsigned end = start; |