[PATCH] D34931: [X86] Basic lowering support for selection of COMPRESS with a constant mask

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 1 23:43:36 PDT 2017


zvi created this revision.

COMPRESS is good for cases where we construct a vector by picking
monotonically strictly increasing element indices from a source vector.
Due to the overhead of constructing the constant mask (mov
gpr,immediates + kmov k,gpr), we should prefer shuffle instruction with immediates over
COMRPESS (and possibly even shuffles which take the indices in a register
operand).

The pattern for shuffles is:

(shuffle (extract_subvector V, 0), (extract_subvector V, 4) <1, 3, 5, 7>)
-->
COMPRESS V, b01010101

and similarly:
build_vector (extractelt V, 1), (extractelt V, 3), (extractelt V, 5), extractelt (V, 7)
-->
COMPRESS V, b01010101


https://reviews.llvm.org/D34931

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/pmul.ll
  test/CodeGen/X86/shuffle-vs-trunc-512.ll
  test/CodeGen/X86/vector-shuffle-512-v16.ll
  test/CodeGen/X86/vector-shuffle-512-v8.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34931.105018.patch
Type: text/x-patch
Size: 22283 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170702/a3670a87/attachment.bin>


More information about the llvm-commits mailing list