[llvm] 805fb1f - [X86] combineMul - move MUL_IMM comment inside function. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 22 10:29:10 PDT 2021
Author: Simon Pilgrim
Date: 2021-08-22T18:27:03+01:00
New Revision: 805fb1f6c164ebcab02356bb2500e832781b7b79
URL: https://github.com/llvm/llvm-project/commit/805fb1f6c164ebcab02356bb2500e832781b7b79
DIFF: https://github.com/llvm/llvm-project/commit/805fb1f6c164ebcab02356bb2500e832781b7b79.diff
LOG: [X86] combineMul - move MUL_IMM comment inside function. NFC.
combineMul is now used for other things as well as the mul-with-constant expansion - move the comment to where its actually relevant.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 53753be52946..c70715033cc0 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -44061,8 +44061,6 @@ static SDValue combineMulToPMULDQ(SDNode *N, SelectionDAG &DAG,
return SDValue();
}
-/// Optimize a single multiply with constant into two operations in order to
-/// implement it with two cheaper instructions, e.g. LEA + SHL, LEA + LEA.
static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
const X86Subtarget &Subtarget) {
@@ -44077,8 +44075,11 @@ static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
if (DCI.isBeforeLegalize() && VT.isVector())
return reduceVMULWidth(N, DAG, Subtarget);
+ // Optimize a single multiply with constant into two operations in order to
+ // implement it with two cheaper instructions, e.g. LEA + SHL, LEA + LEA.
if (!MulConstantOptimization)
return SDValue();
+
// An imul is usually smaller than the alternative sequence.
if (DAG.getMachineFunction().getFunction().hasMinSize())
return SDValue();
More information about the llvm-commits
mailing list