Ignore non-allocatable physical registers in live interval analysis.
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Sat, 13 Dec 2003 11:11:02 +0000 (11:11 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Sat, 13 Dec 2003 11:11:02 +0000 (11:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10449 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/LiveVariables.h
lib/CodeGen/LiveIntervalAnalysis.cpp

index 3a0d044c59c29d5a47fabc2d2123c2e5ea1f21a8..737dabc1ae73ef6693d57051fcc61e148f285515 100644 (file)
@@ -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);
index 2a31e66851e22c985335fb01fbddb14f68bd59bc..52cf73be8b4f3772742f08bd3d1484f9d7008c81 100644 (file)
@@ -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;