[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Jan 27 20:28:38 PST 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.281 -> 1.282
---
Log message:

Instead of making callers of ExpandLibCall legalize the result, make
ExpandLibCall do it itself.


---
Diffs of the changes:  (+7 -6)

 LegalizeDAG.cpp |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.281 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.282
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.281	Fri Jan 27 22:23:12 2006
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp	Fri Jan 27 22:28:26 2006
@@ -2208,7 +2208,7 @@
         // 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 @@
         default: assert(0 && "Unreachable!");
         }
         SDOperand Dummy;
-        Result = LegalizeOp(ExpandLibCall(FnName, Node, Dummy));
+        Result = ExpandLibCall(FnName, Node, Dummy);
         break;
       }
       default:
@@ -3700,16 +3700,17 @@
   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 @@
       }
       Lo = DAG.getNode(ISD::MUL, NVT, LL, RL);
     } else {
-      Lo = ExpandLibCall("__muldi3" , Node, Hi); break;
+      Lo = ExpandLibCall("__muldi3" , Node, Hi);
     }
     break;
   }






More information about the llvm-commits mailing list