[PATCH] D34076: DAGCombine: Combine BUILD_VECTOR to TRUNCATE

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 10 00:41:11 PDT 2017


zvi created this revision.
Herald added a subscriber: javed.absar.

Add a combine for creating a truncate to replace a build_vector composed of extracts with
indices that form a stride-2^N series.

Example:
v8i32 V = ...

v4i32 build_vector((extract_elt V, 0), (extract_elt V, 2), (extract_elt V, 4), (extract_elt V, 6))
-->
v4i32 truncate (bitcast V to v4i64)

Related discussion in llvm-dev about canonicalizing shuffles to
truncates:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108936.html.


https://reviews.llvm.org/D34076

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/ARM/vext.ll
  test/CodeGen/ARM/vpadd.ll
  test/CodeGen/X86/shuffle-vs-trunc-256.ll
  test/CodeGen/X86/shuffle-vs-trunc-512.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34076.102107.patch
Type: text/x-patch
Size: 15049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170610/21679fe9/attachment.bin>


More information about the llvm-commits mailing list