From: Ruchira Sasanka Date: Mon, 15 Oct 2001 16:22:44 +0000 (+0000) Subject: fixed a coalscing bug X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=21721b63c3b5a314dfa0be14823b10273860787c;p=oota-llvm.git fixed a coalscing bug git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@828 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 2c5a337b2cc..c6633e5ca1b 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -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; } diff --git a/lib/CodeGen/RegAlloc/LiveRangeInfo.h b/lib/CodeGen/RegAlloc/LiveRangeInfo.h index 2a8eb2ffb6f..d98ad9ab7a5 100644 --- a/lib/CodeGen/RegAlloc/LiveRangeInfo.h +++ b/lib/CodeGen/RegAlloc/LiveRangeInfo.h @@ -42,7 +42,7 @@ typedef hash_map LiveRangeMapType; -typedef vector CallRetInstrListType; +typedef vector CallRetInstrListType; class LiveRangeInfo { @@ -65,6 +65,7 @@ private: void addInterference(const Instruction *const Inst, const LiveVarSet *const LVSet); + void suggestRegs4CallRets(); public: diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.h b/lib/CodeGen/RegAlloc/PhyRegAlloc.h index f96f27bdfbb..0cf5ec9e9f6 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.h +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.h @@ -39,12 +39,13 @@ #include "llvm/CodeGen/LiveRangeInfo.h" #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include class AddedInstrns { public: - vector InstrnsBefore; - vector InstrnsAfter; + deque InstrnsBefore; + deque InstrnsAfter; AddedInstrns() : InstrnsBefore(), InstrnsAfter() { } }; diff --git a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h index 2a8eb2ffb6f..d98ad9ab7a5 100644 --- a/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h +++ b/lib/Target/SparcV9/RegAlloc/LiveRangeInfo.h @@ -42,7 +42,7 @@ typedef hash_map LiveRangeMapType; -typedef vector CallRetInstrListType; +typedef vector CallRetInstrListType; class LiveRangeInfo { @@ -65,6 +65,7 @@ private: void addInterference(const Instruction *const Inst, const LiveVarSet *const LVSet); + void suggestRegs4CallRets(); public: diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h index f96f27bdfbb..0cf5ec9e9f6 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.h @@ -39,12 +39,13 @@ #include "llvm/CodeGen/LiveRangeInfo.h" #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" +#include class AddedInstrns { public: - vector InstrnsBefore; - vector InstrnsAfter; + deque InstrnsBefore; + deque InstrnsAfter; AddedInstrns() : InstrnsBefore(), InstrnsAfter() { } };