summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2001-10-22 13:41:12 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2001-10-22 13:41:12 +0000
commit8498277e77a6dfb6fa6710ad9564ab9aa4493ad7 (patch)
tree890225ed1bc4c2a717dbad641a192b1f2c65a59c /llvm/lib/Target/Sparc
parent52e41008e375f1a6ea3b0aef808043bdc0de430a (diff)
downloadbcm5719-llvm-8498277e77a6dfb6fa6710ad9564ab9aa4493ad7.tar.gz
bcm5719-llvm-8498277e77a6dfb6fa6710ad9564ab9aa4493ad7.zip
Split JMPL into JMPLCALL and JMPLRET so that IsCall and IsReturn can
be used to distinguish those uses of the `jmpl' instruction. llvm-svn: 940
Diffstat (limited to 'llvm/lib/Target/Sparc')
-rw-r--r--llvm/lib/Target/Sparc/SparcRegInfo.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegInfo.cpp b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
index d65d57edce5..b28ce51b989 100644
--- a/llvm/lib/Target/Sparc/SparcRegInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegInfo.cpp
@@ -35,7 +35,7 @@ UltraSparcRegInfo::getCallInstRetVal(const MachineInstr *CallMI) const{
return CallMI->getImplicitRef(NumOfImpRefs-2);
}
- else if( OpCode == JMPL) {
+ else if( OpCode == JMPLCALL) {
// The last implicit operand is the return value of a JMPL in
if( NumOfImpRefs > 0 )
@@ -67,7 +67,7 @@ UltraSparcRegInfo::getCallInstRetAddr(const MachineInstr *CallMI)const {
return CallMI->getImplicitRef(NumOfImpRefs-1);
}
- else if( OpCode == JMPL ) {
+ else if( OpCode == JMPLCALL ) {
MachineOperand & MO = ( MachineOperand &) CallMI->getOperand(2);
return MO.getVRegValue();
@@ -84,7 +84,7 @@ UltraSparcRegInfo::getCallInstRetAddr(const MachineInstr *CallMI)const {
//---------------------------------------------------------------------------
-// Finds the # of actaul arguments of the call instruction
+// Finds the # of actual arguments of the call instruction
//---------------------------------------------------------------------------
const unsigned
@@ -111,7 +111,7 @@ UltraSparcRegInfo::getCallInstNumArgs(const MachineInstr *CallMI) const {
}
}
- else if( OpCode == JMPL ) {
+ else if( OpCode == JMPLCALL ) {
// The last implicit operand is the return value of a JMPL instr
if( NumOfImpRefs > 0 ) {
@@ -136,19 +136,17 @@ UltraSparcRegInfo::getCallInstNumArgs(const MachineInstr *CallMI) const {
//---------------------------------------------------------------------------
// Suggests a register for the ret address in the RET machine instruction
//---------------------------------------------------------------------------
+
void UltraSparcRegInfo::suggestReg4RetAddr(const MachineInstr * RetMI,
LiveRangeInfo& LRI) const {
- assert( (RetMI->getNumOperands() == 2) && "RETURN must have 2 operands");
+ assert( (RetMI->getNumOperands() >= 2)
+ && "JMPL/RETURN must have 3 and 2 operands respectively");
+
MachineOperand & MO = ( MachineOperand &) RetMI->getOperand(0);
MO.setRegForValue( getUnifiedRegNum( IntRegClassID, SparcIntRegOrder::i7) );
-
- // ***TODO: If the JMPL can be also used as a return instruction,
- // change the assertion. The return address register of JMPL will still
- // be Operand(0)
-
-
+
// TODO (Optimize):
// Instead of setting the color, we can suggest one. In that case,
// we have to test later whether it received the suggested color.
OpenPOWER on IntegriCloud