Reapply r249121 : "[FastISel][x86] Teach how to select SSE2/AVX bitcasts between...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 2 Oct 2015 16:08:05 +0000 (16:08 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Fri, 2 Oct 2015 16:08:05 +0000 (16:08 +0000)
commit93ccc33e98a978e6af2052fc9aaef0f5cca99778
treec647afd3fb33330cd49a4c10eb8aea80555331fd
parent053f844194fbb13bab2fdcff8915ce60132c924b
Reapply r249121 : "[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.

Originally reviewed here: http://reviews.llvm.org/D13347

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249147 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]