[PATCH] [DAGCombine] Don't generate atrocious shuffles for constant vectors
Michael Kuperstein
michael.m.kuperstein at intel.com
Wed Jan 21 06:25:33 PST 2015
Hi spatel, chandlerc,
According to PR22276, generating constant vectors (and, especially, zero vectors) can sometimes result in very odd code.
This is especially true for zero vectors, where a single xor should be sufficient, but instead shuffles are generated.
This adds a DAGCombine that removes a redundant shuffle for this case.
Note that lowering the resulting BUILD_VECTOR to a constant broadcast vs. a constant pool load vs. something more efficient (e.g. a xor for the case of 0) is a target decision, and isn't made here.
http://reviews.llvm.org/D7093
Files:
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/splat-const.ll
test/CodeGen/X86/sse41.ll
test/CodeGen/X86/widen_shuffle-1.ll
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7093.18511.patch
Type: text/x-patch
Size: 4511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150121/15b0fafa/attachment.bin>
More information about the llvm-commits
mailing list