OSDN Git Service

[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)
commit7966329ae72a795104e403af95fe0dbfc8503d31
tree96baebd68429bf53f1e927f1b2de1d214c9bb756
parent4225a30340eaa1ca8e4f2a4d9003281b3f69c89c
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265161 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/memset-nonzero.ll