[llvm-commits] CVS: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp PhyRegAlloc.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Jan 15 15:15:00 PST 2003


Changes in directory llvm/lib/CodeGen/RegAlloc:

LiveRangeInfo.cpp updated: 1.38 -> 1.39
PhyRegAlloc.cpp updated: 1.93 -> 1.94

---
Log message:

Adjust to new interfaces


---
Diffs of the changes:

Index: llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp
diff -u llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.38 llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.39
--- llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp:1.38	Wed Jan 15 13:56:50 2003
+++ llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.cpp	Wed Jan 15 15:14:01 2003
@@ -6,7 +6,7 @@
 
 #include "llvm/CodeGen/LiveRangeInfo.h"
 #include "RegAllocCommon.h"
-#include "llvm/CodeGen/RegClass.h"
+#include "RegClass.h"
 #include "llvm/CodeGen/IGNode.h"
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineFunction.h"
@@ -16,6 +16,8 @@
 #include "Support/SetOperations.h"
 using std::cerr;
 
+unsigned LiveRange::getRegClassID() const { return getRegClass()->getID(); }
+
 LiveRangeInfo::LiveRangeInfo(const Function *F, const TargetMachine &tm,
 			     std::vector<RegClass *> &RCL)
   : Meth(F), TM(tm), RegClassList(RCL), MRI(tm.getRegInfo()) { }
@@ -93,7 +95,8 @@
   LiveRangeMap[Def] = DefRange;           // and update the map.
 
   // set the register class of the new live range
-  DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfValue(Def, isCC)]);
+  DefRange->setRegClass(RegClassList[MRI.getRegClassIDOfType(Def->getType(),
+                                                             isCC)]);
 
   if (DEBUG_RA >= RA_DEBUG_LiveRanges) {
     cerr << "  Creating a LR for def ";
@@ -280,7 +283,6 @@
 	      continue;
 
 	    if (MRI.getRegType(LROfDef) == MRI.getRegType(LROfUse)) {
-
 	      // If the two RegTypes are the same
 	      if (!RCOfDef->getInterference(LROfDef, LROfUse) ) {
 


Index: llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp
diff -u llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.93 llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.94
--- llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp:1.93	Wed Jan 15 13:56:50 2003
+++ llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp	Wed Jan 15 15:14:01 2003
@@ -6,8 +6,8 @@
 
 #include "llvm/CodeGen/RegisterAllocation.h"
 #include "RegAllocCommon.h"
+#include "RegClass.h"
 #include "llvm/CodeGen/IGNode.h"
-#include "llvm/CodeGen/RegClass.h"
 #include "llvm/CodeGen/PhyRegAlloc.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineInstrAnnot.h"
@@ -654,7 +654,7 @@
   MachineOperand& Op = MInst->getOperand(OpNum);
   bool isDef =  MInst->operandIsDefined(OpNum);
   bool isDefAndUse =  MInst->operandIsDefinedAndUsed(OpNum);
-  unsigned RegType = MRI.getRegType( LR );
+  unsigned RegType = MRI.getRegType(LR);
   int SpillOff = LR->getSpillOffFromFP();
   RegClass *RC = LR->getRegClass();
   const ValueSet &LVSetBef = LVI->getLiveVarSetBeforeMInst(MInst, BB);
@@ -888,7 +888,7 @@
       if (MInst->getOperandType(OpNum) == MachineOperand::MO_VirtualRegister || 
           MInst->getOperandType(OpNum) == MachineOperand::MO_CCRegister)
         if (const Value* Val = Op.getVRegValue())
-          if (MRI.getRegClassIDOfValue(Val) == RC->getID())
+          if (MRI.getRegClassIDOfType(Val->getType()) == RC->getID())
             if (Op.getAllocatedRegNum() == -1)
               if (LiveRange *LROfVal = LRI.getLiveRangeForValue(Val))
                 if (LROfVal->hasColor() )





More information about the llvm-commits mailing list