aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-08-18 02:16:30 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-08-18 02:16:30 +0000
commit7ff6fa25037d207e31f65bedc8616a90f61abc25 (patch)
treedad5ffb1e47cc4710888bc45b0c9bf90886570fc /lib
parent250a1714be749ee14998986b5e0a57a3ec20a04d (diff)
downloadexternal_llvm-7ff6fa25037d207e31f65bedc8616a90f61abc25.zip
external_llvm-7ff6fa25037d207e31f65bedc8616a90f61abc25.tar.gz
external_llvm-7ff6fa25037d207e31f65bedc8616a90f61abc25.tar.bz2
Removed LowerRETURADDR, fixed small bug into LowerRET, LowerGlobalAddress
fixed to generate instructions (add, lui) glued! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Mips/MipsISelDAGToDAG.cpp2
-rw-r--r--lib/Target/Mips/MipsISelLowering.cpp26
2 files changed, 11 insertions, 17 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp
index d6e3830..80477d5 100644
--- a/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -142,7 +142,7 @@ SelectAddr(SDOperand Op, SDOperand Addr, SDOperand &Offset, SDOperand &Base)
Addr.getOpcode() == ISD::TargetGlobalAddress))
return false;
- // Operand is an result from an ADD.
+ // Operand is a result from an ADD.
if (Addr.getOpcode() == ISD::ADD)
{
if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Addr.getOperand(1)))
diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp
index 3328336..a7b2b92 100644
--- a/lib/Target/Mips/MipsISelLowering.cpp
+++ b/lib/Target/Mips/MipsISelLowering.cpp
@@ -42,6 +42,7 @@ getTargetNodeName(unsigned Opcode) const
case MipsISD::Hi : return "MipsISD::Hi";
case MipsISD::Lo : return "MipsISD::Lo";
case MipsISD::Ret : return "MipsISD::Ret";
+ case MipsISD::Add : return "MipsISD::Add";
default : return NULL;
}
}
@@ -119,7 +120,6 @@ LowerOperation(SDOperand Op, SelectionDAG &DAG)
case ISD::RET: return LowerRET(Op, DAG);
case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
- case ISD::RETURNADDR: return LowerRETURNADDR(Op, DAG);
}
return SDOperand();
}
@@ -140,17 +140,6 @@ AddLiveIn(MachineFunction &MF, unsigned PReg, TargetRegisterClass *RC)
return VReg;
}
-// Set up a frame object for the return address.
-//SDOperand MipsTargetLowering::getReturnAddressFrameIndex(SelectionDAG &DAG) {
-// if (ReturnAddrIndex == 0) {
-// MachineFunction &MF = DAG.getMachineFunction();
-// ReturnAddrIndex = MF.getFrameInfo()->CreateFixedObject(4, 0);
-// }
-//
-// return DAG.getFrameIndex(ReturnAddrIndex, getPointerTy());
-//}
-
-
//===----------------------------------------------------------------------===//
// Misc Lower Operation implementation
//===----------------------------------------------------------------------===//
@@ -160,10 +149,15 @@ LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG)
GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i32);
- SDOperand Hi = DAG.getNode(MipsISD::Hi, MVT::i32, GA);
+
+ const MVT::ValueType *VTs = DAG.getNodeValueTypes(MVT::i32, MVT::Flag);
+ SDOperand Ops[] = { GA };
+
+ SDOperand Hi = DAG.getNode(MipsISD::Hi, VTs, 2, Ops, 1);
SDOperand Lo = DAG.getNode(MipsISD::Lo, MVT::i32, GA);
- return DAG.getNode(ISD::ADD, MVT::i32, Lo, Hi);
+ SDOperand InFlag = Hi.getValue(1);
+ return DAG.getNode(MipsISD::Add, MVT::i32, Lo, Hi, InFlag);
}
SDOperand MipsTargetLowering::
@@ -370,8 +364,8 @@ LowerCallResult(SDOperand Chain, SDOperand InFlag, SDNode *TheCall,
SmallVector<SDOperand, 8> ResultVals;
// Returns void
- if (!RVLocs.size())
- return Chain.Val;
+ //if (!RVLocs.size())
+ // return Chain.Val;
// Copy all of the result registers out of their specified physreg.
for (unsigned i = 0; i != RVLocs.size(); ++i) {