From: Craig Topper Date: Wed, 25 Jul 2018 05:33:36 +0000 (+0000) Subject: [X86] Use X86ISD::MUL_IMM instead of ISD::MUL for multiply we intend to be selected... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=434ff8b75b914a2d35b0dc5a205340adc564e238;p=llvm [X86] Use X86ISD::MUL_IMM instead of ISD::MUL for multiply we intend to be selected to LEA. This prevents other combines from possibly disturbing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337890 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index c7deffd5619..e019fbdfa1a 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -33701,7 +33701,8 @@ static SDValue combineMulSpecial(uint64_t MulAmt, SDNode *N, SelectionDAG &DAG, auto combineMulMulAddOrSub = [&](int Mul1, int Mul2, bool isAdd) { SDValue Result = DAG.getNode(X86ISD::MUL_IMM, DL, VT, N->getOperand(0), DAG.getConstant(Mul1, DL, VT)); - Result = DAG.getNode(ISD::MUL, DL, VT, Result, DAG.getConstant(Mul2, DL, VT)); + Result = DAG.getNode(X86ISD::MUL_IMM, DL, VT, Result, + DAG.getConstant(Mul2, DL, VT)); Result = DAG.getNode(isAdd ? ISD::ADD : ISD::SUB, DL, VT, Result, N->getOperand(0)); return Result;