[PATCH] D46957: [x86] Lower some trunc + shuffle patterns to vpmovd[b|w]

Gabor Buella via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 16 13:06:44 PDT 2018


GBuella updated this revision to Diff 147163.
GBuella added a comment.

Added some more tests.
We have four test functions for vpmovdb, and four test functions for vpmovdw.
None of these were detected before this patch.

This indirect approach is still not detected, but I think it shouldn't be too hard:

  // truncate to v8i16 in the first operation, but this really is a vpmovdb
  %truncated = trunc <8 x i32> %vec to <8 x i16>
  %bc = bitcast <8 x i16> %truncated to <16 x i8>
  %result = shufflevector <16 x i8> %bc, <16 x i8> zeroinitializer, <16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>


https://reviews.llvm.org/D46957

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/shuffle-vs-trunc-256.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46957.147163.patch
Type: text/x-patch
Size: 25719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180516/4b3b0bf6/attachment.bin>


More information about the llvm-commits mailing list