From: Chris Lattner Date: Sat, 16 Sep 2006 00:09:24 +0000 (+0000) Subject: Allow custom expand of mul X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7d7bffe157c0896cc850ed384dd748aae1a00c7b;p=oota-llvm.git Allow custom expand of mul git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30402 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 2108f22cc54..8eddebd01aa 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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;