summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-12 11:27:26 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-12 11:27:26 +0000
commitfe0d9bb6ebe5334c4efc31a48979c5f39597f323 (patch)
tree02387649fa08ebbbf95ed558615c2f4f6655d5d1 /llvm/lib
parent94f2bb55351621fee2d7caa8a5233e564e3a58ff (diff)
downloadbcm5719-llvm-fe0d9bb6ebe5334c4efc31a48979c5f39597f323.tar.gz
bcm5719-llvm-fe0d9bb6ebe5334c4efc31a48979c5f39597f323.zip
[X86] Disable mul -> shl + lea combine when compiling for minsize
Differential Revision: http://reviews.llvm.org/D11904 llvm-svn: 244740
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 4da5851fc06..986646a404c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -23436,6 +23436,10 @@ static SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG,
/// LEA + SHL, LEA + LEA.
static SDValue PerformMulCombine(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI) {
+ // An imul is usually smaller than the alternative sequence.
+ if (DAG.getMachineFunction().getFunction()->optForMinSize())
+ return SDValue();
+
if (DCI.isBeforeLegalize() || DCI.isCalledByLegalizer())
return SDValue();
OpenPOWER on IntegriCloud