diff options
author | Duncan Sands <baldrick@free.fr> | 2008-04-18 20:25:14 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-04-18 20:25:14 +0000 |
commit | 41edfb8ae119d6cf6579046619dd2820ec876065 (patch) | |
tree | 49f86a11b5e1c8f0abbe770bd0b981bed8aafd3e /lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | |
parent | a8f720d695e00192cc5816e10a7c52ade8446813 (diff) |
Provide an explicit list of operands to MakeLibcall,
rather than having it suck them out of a node. Add
a bunch of new libcalls, and remove dead softfloat
code (dead, because FloatToInt is used not Expand
in this case). Note that indexed stores probably
aren't handled properly, likewise for loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49915 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeTypes.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index 67977b1eb3..c0cfe216bf 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -525,15 +525,18 @@ void DAGTypeLegalizer::SplitInteger(SDOperand Op, SplitInteger(Op, HalfVT, HalfVT, Lo, Hi); } -/// MakeLibCall - Expand a node into a libcall and return the result. -SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, SDNode *N, +/// MakeLibCall - Generate a libcall taking the given operands as arguments and +/// returning a result of type RetVT. +SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, MVT::ValueType RetVT, + const SDOperand *Ops, unsigned NumOps, bool isSigned) { TargetLowering::ArgListTy Args; + Args.reserve(NumOps); + TargetLowering::ArgListEntry Entry; - for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { - MVT::ValueType ArgVT = N->getOperand(i).getValueType(); - Entry.Node = N->getOperand(i); - Entry.Ty = MVT::getTypeForValueType(ArgVT); + for (unsigned i = 0; i != NumOps; ++i) { + Entry.Node = Ops[i]; + Entry.Ty = MVT::getTypeForValueType(Entry.Node.getValueType()); Entry.isSExt = isSigned; Entry.isZExt = !isSigned; Args.push_back(Entry); @@ -541,7 +544,7 @@ SDOperand DAGTypeLegalizer::MakeLibCall(RTLIB::Libcall LC, SDNode *N, SDOperand Callee = DAG.getExternalSymbol(TLI.getLibcallName(LC), TLI.getPointerTy()); - const Type *RetTy = MVT::getTypeForValueType(N->getValueType(0)); + const Type *RetTy = MVT::getTypeForValueType(RetVT); std::pair<SDOperand,SDOperand> CallInfo = TLI.LowerCallTo(DAG.getEntryNode(), RetTy, isSigned, !isSigned, false, CallingConv::C, false, Callee, Args, DAG); |