[x86] use SSE/AVX ops for non-zero memsets (PR27100)
authorSanjay Patel <spatel@rotateright.com>
Thu, 31 Mar 2016 17:30:06 +0000 (17:30 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 31 Mar 2016 17:30:06 +0000 (17:30 +0000)
commit92d5ea5e07bf122b10500715cd74eed963cf56cc
tree6b54f937b61d242102ab04439c74f34fcfc0be52
parentab962acd5940bb38810f4b7993166058ea8865f4
[x86] use SSE/AVX ops for non-zero memsets (PR27100)

Move the memset check down to the CPU-with-slow-SSE-unaligned-memops case: this allows fast
targets to take advantage of SSE/AVX instructions and prevents slow targets from stepping
into a codegen sinkhole while trying to splat a byte into an XMM reg.

Follow-on bugs exposed by the current codegen are:
https://llvm.org/bugs/show_bug.cgi?id=27141
https://llvm.org/bugs/show_bug.cgi?id=27143

Differential Revision: http://reviews.llvm.org/D18566

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