diff options
| author | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-21 16:43:41 +0000 |
|---|---|---|
| committer | Ruchira Sasanka <sasanka@students.uiuc.edu> | 2001-10-21 16:43:41 +0000 |
| commit | 24729a34ceb46fd413d696b983ccf71dc2286f5f (patch) | |
| tree | 7fa9714af1e5b2b0e3758c4fb1894a8dc1bea4ce /llvm/lib/CodeGen | |
| parent | 18e81933c7c2a00a4d7fc95c50e0dc4f339f1212 (diff) | |
| download | bcm5719-llvm-24729a34ceb46fd413d696b983ccf71dc2286f5f.tar.gz bcm5719-llvm-24729a34ceb46fd413d696b983ccf71dc2286f5f.zip | |
Added support for both call/jmpl instructions
llvm-svn: 930
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index b36e8e44437..43ea5a5cd0f 100644 --- a/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/llvm/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -149,7 +149,7 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, const LiveVarSet *const LVSetAft ) { // Now find the LR of the return value of the call - // The last *implicit operand* is the return value of a call + // We do this because, we look at the LV set *after* the instruction // to determine, which LRs must be saved across calls. The return value @@ -158,19 +158,13 @@ void PhyRegAlloc::setCallInterferences(const MachineInstr *MInst, LiveRange *RetValLR = NULL; - unsigned NumOfImpRefs = MInst->getNumImplicitRefs(); - if( NumOfImpRefs > 0 ) { - - if( MInst->implicitRefIsDefined(NumOfImpRefs-1) ) { - - const Value *RetVal = MInst->getImplicitRef(NumOfImpRefs-1); - RetValLR = LRI.getLiveRangeForValue( RetVal ); - assert( RetValLR && "No LR for RetValue of call"); - } + const Value *RetVal = MRI.getCallInstRetVal( MInst ); + if( RetVal ) { + RetValLR = LRI.getLiveRangeForValue( RetVal ); + assert( RetValLR && "No LR for RetValue of call"); } - if( DEBUG_RA) cout << "\n For call inst: " << *MInst; @@ -356,20 +350,17 @@ void PhyRegAlloc::insertCallerSavingCode(const MachineInstr *MInst, // to determine, which LRs must be saved across calls. The return value // of the call is live in this set - but we must not save/restore it. - unsigned NumOfImpRefs = MInst->getNumImplicitRefs(); - if( NumOfImpRefs > 0 ) { - - if( MInst->implicitRefIsDefined(NumOfImpRefs-1) ) { - const Value *RetVal = MInst->getImplicitRef(NumOfImpRefs-1); - LiveRange *RetValLR = LRI.getLiveRangeForValue( RetVal ); - assert( RetValLR && "No LR for RetValue of call"); + const Value *RetVal = MRI.getCallInstRetVal( MInst ); - PushedRegSet.insert( - MRI.getUnifiedRegNum((RetValLR->getRegClass())->getID(), - RetValLR->getColor() ) ); - } + if( RetVal ) { + + LiveRange *RetValLR = LRI.getLiveRangeForValue( RetVal ); + assert( RetValLR && "No LR for RetValue of call"); + PushedRegSet.insert( + MRI.getUnifiedRegNum((RetValLR->getRegClass())->getID(), + RetValLR->getColor() ) ); } |

