[PATCH] D11904: [X86] Disable mul -> shl + lea combine when compiling for minsize
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 10 09:20:02 PDT 2015
spatel added inline comments.
================
Comment at: lib/Target/X86/X86ISelLowering.cpp:23521
@@ -23520,1 +23520,3 @@
TargetLowering::DAGCombinerInfo &DCI) {
+ // An imul is usually smaller than the alternative sequence
+ if (DAG.getMachineFunction().getFunction()->optForMinSize())
----------------
Missing period.
================
Comment at: test/CodeGen/X86/imul.ll:112-119
@@ +111,10 @@
+
+define i32 @mul4_32_minsize(i32 %A) minsize {
+; X64-LABEL: mul4_32_minsize:
+; X64: leal
+; X86-LABEL: mul4_32_minsize:
+; X86: shll
+ %mul = mul i32 %A, 4
+ ret i32 %mul
+}
+
----------------
Does this test change with the patch? Is there a reason i386 should be different than x86-64?
http://reviews.llvm.org/D11904
More information about the llvm-commits
mailing list