From: Chris Lattner Date: Sat, 28 Jan 2006 04:28:26 +0000 (+0000) Subject: Instead of making callers of ExpandLibCall legalize the result, make X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c6b4b8c3a48aa420f6499ca6c1a356f74e100f8;p=oota-llvm.git Instead of making callers of ExpandLibCall legalize the result, make ExpandLibCall do it itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25731 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 2ee5dd5400e..ab01632c8db 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2208,7 +2208,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { // Floating point mod -> fmod libcall. const char *FnName = Node->getValueType(0) == MVT::f32 ? "fmodf":"fmod"; SDOperand Dummy; - Result = LegalizeOp(ExpandLibCall(FnName, Node, Dummy)); + Result = ExpandLibCall(FnName, Node, Dummy); } break; } @@ -2624,7 +2624,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { default: assert(0 && "Unreachable!"); } SDOperand Dummy; - Result = LegalizeOp(ExpandLibCall(FnName, Node, Dummy)); + Result = ExpandLibCall(FnName, Node, Dummy); break; } default: @@ -3700,16 +3700,17 @@ SDOperand SelectionDAGLegalize::ExpandLibCall(const char *Name, SDNode *Node, switch (getTypeAction(CallInfo.first.getValueType())) { default: assert(0 && "Unknown thing"); case Legal: - Result = CallInfo.first; + // If the result is legal, make sure that we relegalize the inserted result. + Result = LegalizeOp(CallInfo.first); break; case Promote: assert(0 && "Cannot promote this yet!"); case Expand: ExpandOp(CallInfo.first, Result, Hi); - CallInfo.second = LegalizeOp(CallInfo.second); break; } - + + CallInfo.second = LegalizeOp(CallInfo.second); SpliceCallInto(CallInfo.second, OutChain); return Result; } @@ -4415,7 +4416,7 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){ } Lo = DAG.getNode(ISD::MUL, NVT, LL, RL); } else { - Lo = ExpandLibCall("__muldi3" , Node, Hi); break; + Lo = ExpandLibCall("__muldi3" , Node, Hi); } break; }