Allow custom expand of mul
authorChris Lattner <sabre@nondot.org>
Sat, 16 Sep 2006 00:09:24 +0000 (00:09 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 16 Sep 2006 00:09:24 +0000 (00:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30402 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 2108f22cc5428ea8903898b32ce20a3b296ecddd..8eddebd01aa55373c6bf6b6cd3cbe2888b442809 100644 (file)
@@ -4693,6 +4693,15 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
     break;
   }
   case ISD::MUL: {
+    // If the target wants to custom expand this, let them.
+    if (TLI.getOperationAction(ISD::MUL, VT) == TargetLowering::Custom) {
+      Op = TLI.LowerOperation(Op, DAG);
+      if (Op.Val) {
+        ExpandOp(Op, Lo, Hi);
+        break;
+      }
+    }
+    
     bool HasMULHS = TLI.isOperationLegal(ISD::MULHS, NVT);
     bool HasMULHU = TLI.isOperationLegal(ISD::MULHU, NVT);
     bool UseLibCall = true;