Allow targets to custom lower their own intrinsics if desired.
authorChris Lattner <sabre@nondot.org>
Sun, 26 Mar 2006 09:12:51 +0000 (09:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 26 Mar 2006 09:12:51 +0000 (09:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27146 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 6acadc1349d83a5a85c1c0c2fc5316ffd53cd111..81139dcde178375a0ded2457d8a37b7aac21fc4c 100644 (file)
@@ -558,6 +558,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
     for (unsigned i = 0, e = Node->getNumOperands(); i != e; ++i)
       Ops.push_back(LegalizeOp(Node->getOperand(i)));
     Result = DAG.UpdateNodeOperands(Result, Ops);
+    
+    // Allow the target to custom lower its intrinsics if it wants to.
+    if (TLI.getOperationAction(ISD::INTRINSIC, MVT::Other) == 
+        TargetLowering::Custom) {
+      Tmp3 = TLI.LowerOperation(Result, DAG);
+      if (Tmp3.Val) Result = Tmp3;
+    }      
     break;
   }