[PATCH] D11904: [X86] Disable mul -> shl + lea combine when compiling for minsize

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 11 07:07:08 PDT 2015


spatel added inline comments.

================
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
+}
+
----------------
mkuper wrote:
> spatel wrote:
> > Does this test change with the patch? Is there a reason i386 should be different than x86-64?
> This is just a copy of a test from above, but with minsize added. I wanted to verify that we still produce a single shift/lea (as opposed to a sequence with > 1 instructions) even under minsize.
> Do you think this is redundant?
Ah, I didn't notice the earlier test. I got tired of running into the FIXMEs that I added with r243994, so I've been adding minsize tests myself. In some cases, it has exposed functionality with no regression tests, so I like having the test.

Not a problem then, although I'm still curious why this is different for 32-bit. The answer may be related to that "But why?!" comment above. :)


http://reviews.llvm.org/D11904





More information about the llvm-commits mailing list