[X86] Improved lowering of v4x32 build_vector dag nodes.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 19 Nov 2014 19:34:29 +0000 (19:34 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 19 Nov 2014 19:34:29 +0000 (19:34 +0000)
commit1b657bfcc807a1c41fcf7309cdaca007b964b733
tree6400ba18d0fd9cc9be4e33de0a1d91a753c86437
parent56c0eb2d90de68978c280ab7b08377af6de03fd0
[X86] Improved lowering of v4x32 build_vector dag nodes.

This patch improves the lowering of v4f32 and v4i32 build_vector dag nodes
that are known to have at least two non-zero elements.

With this patch, a build_vector that performs a blend with zero is
converted into a shuffle. This is done to let the shuffle legalizer expand
the dag node in a optimal way. For example, if we know that a build_vector
performs a blend with zero, we can try to lower it as a movq/blend instead of
always selecting an insertps.

This patch also improves the logic that lowers a build_vector into a insertps
with zero masking. See for example the extra test cases added to test sse41.ll.

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

llvm-svn: 222375
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/sse2.ll
llvm/test/CodeGen/X86/sse41.ll