[x86] avoid intermediate splat for non-zero memsets (PR27100)
authorSanjay Patel <spatel@rotateright.com>
Fri, 1 Apr 2016 17:36:45 +0000 (17:36 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 1 Apr 2016 17:36:45 +0000 (17:36 +0000)
commit9f413364d5a0e6c1f440b0ed7a14031130256922
tree8d4379fed78fc4b59ddb52b7380e424e175c8e83
parent8787a81023434467a2b0b871d5ab9930fa5324bd
[x86] avoid intermediate splat for non-zero memsets (PR27100)

Follow-up to http://reviews.llvm.org/D18566 and http://reviews.llvm.org/D18676 -
where we noticed that an intermediate splat was being generated for memsets of
non-zero chars.

That was because we told getMemsetStores() to use a 32-bit vector element type,
and it happily obliged by producing that constant using an integer multiply.

The 16-byte test that was added in D18566 is now equivalent for AVX1 and AVX2
(no splats, just a vector load), but we have PR27141 to track that splat difference.

Note that the SSE1 path is not changed in this patch. That can be a follow-up.
This patch should resolve PR27100.

llvm-svn: 265161
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/memset-nonzero.ll