From 4c214d2bf0da92a7973bb7902c0d6d055b1fa991 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sat, 13 Dec 2003 11:11:02 +0000 Subject: [PATCH] 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 --- include/llvm/CodeGen/LiveVariables.h | 4 ++++ lib/CodeGen/LiveIntervalAnalysis.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h index 3a0d044c59c..737dabc1ae7 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& 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 2a31e66851e..52cf73be8b4 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; -- 2.34.1