Skip to content

Commit 086bf0f

Browse files
author
Ruchira Sasanka
committed
updated suggesting/coloring of call & return args & implicit operands
llvm-svn: 830
1 parent 48972e0 commit 086bf0f

File tree

4 files changed

+218
-232
lines changed

4 files changed

+218
-232
lines changed

llvm/lib/Target/Sparc/Sparc.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const MachineInstrDescriptor SparcMachineInstrDesc[] = {
3232
// that implements the Sparc backend. (the llvm/CodeGen/Sparc.h interface)
3333
//----------------------------------------------------------------------------
3434
//
35+
3536
TargetMachine *allocateSparcTargetMachine() { return new UltraSparc(); }
3637

3738

llvm/lib/Target/Sparc/SparcInternals.h

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ class UltraSparcRegInfo : public MachineRegInfo
158158
MachineInstr * getCopy2RegMI(const Value *SrcVal, const unsigned Reg,
159159
unsigned RegClassID) const ;
160160

161+
162+
void suggestReg4RetAddr(const MachineInstr * RetMI,
163+
LiveRangeInfo& LRI) const;
164+
165+
void suggestReg4CallAddr(const MachineInstr * CallMI) const;
166+
167+
161168
Value *getValue4ReturnAddr( const MachineInstr * MInst ) const ;
162169

163170
int getRegType(const LiveRange *const LR) const {
@@ -291,25 +298,25 @@ class UltraSparcRegInfo : public MachineRegInfo
291298
void suggestRegs4MethodArgs(const Method *const Meth,
292299
LiveRangeInfo& LRI) const;
293300

294-
void suggestRegs4CallArgs(const CallInst *const CallI,
301+
void suggestRegs4CallArgs(const MachineInstr *const CallMI,
295302
LiveRangeInfo& LRI, vector<RegClass *> RCL) const;
296303

297-
void suggestReg4RetValue(const ReturnInst *const RetI,
298-
LiveRangeInfo& LRI) const;
304+
void suggestReg4RetValue(const MachineInstr *const RetMI,
305+
LiveRangeInfo& LRI ) const;
299306

300307

301308
void colorMethodArgs(const Method *const Meth, LiveRangeInfo& LRI,
302309
AddedInstrns *const FirstAI) const;
303310

304-
void colorCallArgs(const CallInst *const CallI, LiveRangeInfo& LRI,
311+
void colorCallArgs(const MachineInstr *const CallMI, LiveRangeInfo& LRI,
305312
AddedInstrns *const CallAI) const;
306313

307-
void colorRetValue(const ReturnInst *const RetI, LiveRangeInfo& LRI,
314+
void colorRetValue(const MachineInstr *const RetI, LiveRangeInfo& LRI,
308315
AddedInstrns *const RetAI) const;
309316

310317

311-
bool handleSpecialMInstr(const MachineInstr * MInst,
312-
LiveRangeInfo& LRI, vector<RegClass *> RCL) const;
318+
// bool handleSpecialMInstr(const MachineInstr * MInst,
319+
// LiveRangeInfo& LRI, vector<RegClass *> RCL) const;
313320

314321

315322
static void printReg(const LiveRange *const LR) ;

llvm/lib/Target/Sparc/SparcRegClassInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ static string const IntRegNames[] =
2222
{
2323
"o0", "o1", "o2", "o3", "o4", "o5", "o7",
2424
"l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7",
25-
"i0", "i1", "i2", "i3", "i4", "i5", "i7",
25+
"i0", "i1", "i2", "i3", "i4", "i5",
2626
"g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7",
27-
"i6", "o6" };
27+
"i6", "i7", "o6" };
2828

2929

3030

@@ -46,7 +46,7 @@ class SparcIntRegOrder{
4646
// --- following colors are NON-volatile across function calls
4747

4848
l0, l1, l2, l3, l4, l5, l6, l7, // %l0-%l7
49-
i0, i1, i2, i3, i4, i5, i7, // %i0-%i5: i's need not be preserved
49+
i0, i1, i2, i3, i4, i5, // %i0-%i5: i's need not be preserved
5050

5151
// %i6 is the fp - so not allocated
5252
// %i7 is the ret address by convention - can be used for others
@@ -56,7 +56,7 @@ class SparcIntRegOrder{
5656
// --- following colors are not available for allocation within this phase
5757
// --- but can appear for pre-colored ranges
5858

59-
g0, g1, g2, g3, g4, g5, g6, g7, i6, o6
59+
g0, g1, g2, g3, g4, g5, g6, g7, i6, i7, o6
6060

6161

6262

0 commit comments

Comments
 (0)