corrected insertCode4Spilled ... bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1212 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ruchira Sasanka 2001-11-08 19:11:30 +00:00
parent 19560c3fd3
commit 226f1f0b22
2 changed files with 34 additions and 16 deletions

View File

@ -526,11 +526,20 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
int TmpOff =
mcInfo.pushTempValue(TM, TM.findOptimalStorageSize(LR->getType()));
MachineInstr *MIBef, *AdIMid, *MIAft;
MachineInstr *MIBef=NULL, *AdIMid=NULL, *MIAft=NULL;
int TmpReg;
TmpReg = getUsableRegAtMI(RC, RegType, MInst,LVSetBef, MIBef, MIAft);
TmpReg = MRI.getUnifiedRegNum( RC->getID(), TmpReg );
// get the added instructions for this instruciton
AddedInstrns *AI = AddedInstrMap[ MInst ];
if ( !AI ) {
AI = new AddedInstrns();
AddedInstrMap[ MInst ] = AI;
}
if( !isDef ) {
@ -542,13 +551,13 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
AdIMid = MRI.cpMem2RegMI(MRI.getFramePointer(), SpillOff, TmpReg, RegType);
if( MIBef )
((AddedInstrMap[MInst])->InstrnsBefore).push_back(MIBef);
(AI->InstrnsBefore).push_back(MIBef);
((AddedInstrMap[MInst])->InstrnsBefore).push_back(AdIMid);
(AI->InstrnsBefore).push_back(AdIMid);
if( MIAft)
((AddedInstrMap[MInst])->InstrnsAfter).push_front(MIAft);
(AI->InstrnsAfter).push_front(MIAft);
}
else { // if this is a Def
@ -560,12 +569,12 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
AdIMid = MRI.cpReg2MemMI(TmpReg, MRI.getFramePointer(), SpillOff, RegType);
if( MIBef )
((AddedInstrMap[MInst])->InstrnsBefore).push_back(MIBef);
(AI->InstrnsBefore).push_back(MIBef);
((AddedInstrMap[MInst])->InstrnsBefore).push_back(AdIMid);
(AI->InstrnsBefore).push_back(AdIMid);
if( MIAft)
((AddedInstrMap[MInst])->InstrnsAfter).push_front(MIAft);
(AI->InstrnsAfter).push_front(MIAft);
} // if !DEF

View File

@ -526,11 +526,20 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
int TmpOff =
mcInfo.pushTempValue(TM, TM.findOptimalStorageSize(LR->getType()));
MachineInstr *MIBef, *AdIMid, *MIAft;
MachineInstr *MIBef=NULL, *AdIMid=NULL, *MIAft=NULL;
int TmpReg;
TmpReg = getUsableRegAtMI(RC, RegType, MInst,LVSetBef, MIBef, MIAft);
TmpReg = MRI.getUnifiedRegNum( RC->getID(), TmpReg );
// get the added instructions for this instruciton
AddedInstrns *AI = AddedInstrMap[ MInst ];
if ( !AI ) {
AI = new AddedInstrns();
AddedInstrMap[ MInst ] = AI;
}
if( !isDef ) {
@ -542,13 +551,13 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
AdIMid = MRI.cpMem2RegMI(MRI.getFramePointer(), SpillOff, TmpReg, RegType);
if( MIBef )
((AddedInstrMap[MInst])->InstrnsBefore).push_back(MIBef);
(AI->InstrnsBefore).push_back(MIBef);
((AddedInstrMap[MInst])->InstrnsBefore).push_back(AdIMid);
(AI->InstrnsBefore).push_back(AdIMid);
if( MIAft)
((AddedInstrMap[MInst])->InstrnsAfter).push_front(MIAft);
(AI->InstrnsAfter).push_front(MIAft);
}
else { // if this is a Def
@ -560,12 +569,12 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR,
AdIMid = MRI.cpReg2MemMI(TmpReg, MRI.getFramePointer(), SpillOff, RegType);
if( MIBef )
((AddedInstrMap[MInst])->InstrnsBefore).push_back(MIBef);
(AI->InstrnsBefore).push_back(MIBef);
((AddedInstrMap[MInst])->InstrnsBefore).push_back(AdIMid);
(AI->InstrnsBefore).push_back(AdIMid);
if( MIAft)
((AddedInstrMap[MInst])->InstrnsAfter).push_front(MIAft);
(AI->InstrnsAfter).push_front(MIAft);
} // if !DEF