[FastISel][x86] Teach how to select SSE2/AVX bitcasts between 128/256-bit vector...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 2 Oct 2015 12:45:37 +0000 (12:45 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 2 Oct 2015 12:45:37 +0000 (12:45 +0000)
commitf008b991205b9757498558e42fe6072e08307049
tree64f534d8351d2ad1639669dfc01709ef40872ef2
parentd25872f0cd21739cd510359d0ad6e39a5947871f
[FastISel][x86] Teach how to select SSE2/AVX bitcasts between 128/256-bit vector types.

This patch teaches FastIsel the following two things:
1) On SSE2, no instructions are needed for bitcasts between 128-bit vector types;
2) On AVX, no instructions are needed for bitcasts between 256-bit vector types.

Example:

  %1 = bitcast <4 x i31> %V to <2 x i64>

Before (-fast-isel -fast-isel-abort=1):

  FastIsel miss: %1 = bitcast <4 x i31> %V to <2 x i64>

Now we don't fall back to SelectionDAG and we correctly fold that computation
propagating the register associated to %V.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249121 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-bitcasts-avx.ll [new file with mode: 0644]
test/CodeGen/X86/fast-isel-bitcasts.ll [new file with mode: 0644]