[PATCH] D13347: [FastISel][X86] Teach how to select SSE2/AVX bitcasts between 128/256-bit vector types.

Andrea Di Biagio via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 07:53:55 PDT 2015


andreadb created this revision.
andreadb added reviewers: qcolombet, ributzka, nadav.
andreadb added a subscriber: llvm-commits.

While looking at the -O0 codegen, I noticed that X86FastIsel doesn't know how to fast select bitcasts between 128-bit vetor types.

This patch is a (very) minor FastISel improvement.
It 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 i32> %V to <2 x i64>

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

  FastIsel miss:  %1 = bitcast <4 x i32> %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.

Please let me know if okay to submit.

Thanks,
Andrea

http://reviews.llvm.org/D13347

Files:
  lib/Target/X86/X86FastISel.cpp
  test/CodeGen/X86/fast-isel-bitcasts-avx.ll
  test/CodeGen/X86/fast-isel-bitcasts.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13347.36242.patch
Type: text/x-patch
Size: 14077 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151001/5eba15ad/attachment.bin>


More information about the llvm-commits mailing list