diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-13 11:11:02 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2003-12-13 11:11:02 +0000 |
commit | 4c214d2bf0da92a7973bb7902c0d6d055b1fa991 (patch) | |
tree | 5a41560afe3ac51d9c9354d949a8b9479cbbb884 | |
parent | 7d65a12fe660b10c5a10a3f0a655aa4e4a7fe365 (diff) |
Ignore non-allocatable physical registers in live interval analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10449 91177308-0d34-0410-b5e6-96231b3b80d8
-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; |