fixed a coalscing bug
authorRuchira Sasanka <sasanka@students.uiuc.edu>
Mon, 15 Oct 2001 16:22:44 +0000 (16:22 +0000)
committerRuchira Sasanka <sasanka@students.uiuc.edu>
Mon, 15 Oct 2001 16:22:44 +0000 (16:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@828 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/RegAlloc/LiveRangeInfo.h
lib/CodeGen/RegAlloc/PhyRegAlloc.h
lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h
lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h

index 2c5a337b2ccc1afde1cd2ad009276c0e69db42ec..c6633e5ca1b00da9a31d8f603694c619f9845435 100644 (file)
@@ -83,7 +83,7 @@ private:
     int64_t immedVal;          // constant value for an explicit constant
   };
 
-  unsigned regNum;             // register number for an explicit register
+  int regNum;                  // register number for an explicit register
                                 // will be set for a value after reg allocation
   bool isDef;                   // is this a defition for the value
   
@@ -107,7 +107,7 @@ public:
   }
   inline unsigned int  getMachineRegNum() const {
     assert(opType == MO_MachineRegister);
-    return regNum;
+    return (unsigned) regNum;
   }
   inline int64_t       getImmedValue   () const {
     assert(opType >= MO_SignExtendedImmed || opType <= MO_PCRelativeDisp);
@@ -148,7 +148,7 @@ public:
 
   // used to get the reg number if when one is allocted (must be
   // called only after reg alloc)
-  inline unsigned getAllocatedRegNum() const {
+  inline int  getAllocatedRegNum() const {
     assert(opType == MO_VirtualRegister || opType == MO_CCRegister || 
           opType == MO_MachineRegister);
     return regNum;
@@ -162,7 +162,7 @@ inline
 MachineOperand::MachineOperand()
   : opType(MO_VirtualRegister),
     immedVal(0),
-    regNum(0),
+    regNum(-1),
     isDef(false)
 {}
 
@@ -213,7 +213,7 @@ MachineOperand::InitializeReg(unsigned int _regNum)
 {
   opType = MO_MachineRegister;
   value = NULL;
-  regNum = _regNum;
+  regNum = (int) _regNum;
 }
 
 
index 2a8eb2ffb6f8b173978314960249ea251306f53d..d98ad9ab7a5859cc7b194e016cfee20a21dc7fe0 100644 (file)
@@ -42,7 +42,7 @@
 
 
 typedef hash_map <const Value *,  LiveRange *, hashFuncValue> LiveRangeMapType;
-typedef vector <const Instruction *> CallRetInstrListType;
+typedef vector <const MachineInstr *> CallRetInstrListType;
 
 class LiveRangeInfo 
 {
@@ -65,6 +65,7 @@ private:
   void addInterference(const Instruction *const Inst, 
                       const LiveVarSet *const LVSet);
   
+  void suggestRegs4CallRets();
 
 public:
   
index f96f27bdfbbe5f638723f165e731aae89bfbef06..0cf5ec9e9f6bebd0e203945fbd8ff247529d2447 100644 (file)
 #include "llvm/CodeGen/LiveRangeInfo.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
 
+#include <deque>
 
 class AddedInstrns
 {
  public:
-  vector<MachineInstr *> InstrnsBefore;
-  vector<MachineInstr *> InstrnsAfter;
+  deque<MachineInstr *> InstrnsBefore;
+  deque<MachineInstr *> InstrnsAfter;
 
   AddedInstrns() : InstrnsBefore(), InstrnsAfter() { }
 };
index 2a8eb2ffb6f8b173978314960249ea251306f53d..d98ad9ab7a5859cc7b194e016cfee20a21dc7fe0 100644 (file)
@@ -42,7 +42,7 @@
 
 
 typedef hash_map <const Value *,  LiveRange *, hashFuncValue> LiveRangeMapType;
-typedef vector <const Instruction *> CallRetInstrListType;
+typedef vector <const MachineInstr *> CallRetInstrListType;
 
 class LiveRangeInfo 
 {
@@ -65,6 +65,7 @@ private:
   void addInterference(const Instruction *const Inst, 
                       const LiveVarSet *const LVSet);
   
+  void suggestRegs4CallRets();
 
 public:
   
index f96f27bdfbbe5f638723f165e731aae89bfbef06..0cf5ec9e9f6bebd0e203945fbd8ff247529d2447 100644 (file)
 #include "llvm/CodeGen/LiveRangeInfo.h"
 #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
 
+#include <deque>
 
 class AddedInstrns
 {
  public:
-  vector<MachineInstr *> InstrnsBefore;
-  vector<MachineInstr *> InstrnsAfter;
+  deque<MachineInstr *> InstrnsBefore;
+  deque<MachineInstr *> InstrnsAfter;
 
   AddedInstrns() : InstrnsBefore(), InstrnsAfter() { }
 };