Skip to content

Commit 3353577

Browse files
author
Ruchira Sasanka
committed
fixed a coalscing bug
llvm-svn: 828
1 parent f112d52 commit 3353577

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

llvm/include/llvm/CodeGen/MachineInstr.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class MachineOperand {
8383
int64_t immedVal; // constant value for an explicit constant
8484
};
8585

86-
unsigned regNum; // register number for an explicit register
86+
int regNum; // register number for an explicit register
8787
// will be set for a value after reg allocation
8888
bool isDef; // is this a defition for the value
8989

@@ -107,7 +107,7 @@ class MachineOperand {
107107
}
108108
inline unsigned int getMachineRegNum() const {
109109
assert(opType == MO_MachineRegister);
110-
return regNum;
110+
return (unsigned) regNum;
111111
}
112112
inline int64_t getImmedValue () const {
113113
assert(opType >= MO_SignExtendedImmed || opType <= MO_PCRelativeDisp);
@@ -148,7 +148,7 @@ class MachineOperand {
148148

149149
// used to get the reg number if when one is allocted (must be
150150
// called only after reg alloc)
151-
inline unsigned getAllocatedRegNum() const {
151+
inline int getAllocatedRegNum() const {
152152
assert(opType == MO_VirtualRegister || opType == MO_CCRegister ||
153153
opType == MO_MachineRegister);
154154
return regNum;
@@ -162,7 +162,7 @@ inline
162162
MachineOperand::MachineOperand()
163163
: opType(MO_VirtualRegister),
164164
immedVal(0),
165-
regNum(0),
165+
regNum(-1),
166166
isDef(false)
167167
{}
168168

@@ -213,7 +213,7 @@ MachineOperand::InitializeReg(unsigned int _regNum)
213213
{
214214
opType = MO_MachineRegister;
215215
value = NULL;
216-
regNum = _regNum;
216+
regNum = (int) _regNum;
217217
}
218218

219219

llvm/lib/CodeGen/RegAlloc/LiveRangeInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343

4444
typedef hash_map <const Value *, LiveRange *, hashFuncValue> LiveRangeMapType;
45-
typedef vector <const Instruction *> CallRetInstrListType;
45+
typedef vector <const MachineInstr *> CallRetInstrListType;
4646

4747
class LiveRangeInfo
4848
{
@@ -65,6 +65,7 @@ class LiveRangeInfo
6565
void addInterference(const Instruction *const Inst,
6666
const LiveVarSet *const LVSet);
6767

68+
void suggestRegs4CallRets();
6869

6970
public:
7071

llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@
3939
#include "llvm/CodeGen/LiveRangeInfo.h"
4040
#include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h"
4141

42+
#include <deque>
4243

4344
class AddedInstrns
4445
{
4546
public:
46-
vector<MachineInstr *> InstrnsBefore;
47-
vector<MachineInstr *> InstrnsAfter;
47+
deque<MachineInstr *> InstrnsBefore;
48+
deque<MachineInstr *> InstrnsAfter;
4849

4950
AddedInstrns() : InstrnsBefore(), InstrnsAfter() { }
5051
};

0 commit comments

Comments
 (0)