[PATCH] D41948: [SLP] Fix vectorization for tree with trunc to minimum required bit width.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 06:46:34 PST 2018


ABataev created this revision.
ABataev added reviewers: RKSimon, spatel, mkuper, hfinkel, mssimpso.

If the vectorized tree has truncate to minimum required bit width and
the vector type of the cast operation after the truncation is the same
as the vector type of the cast operands, count cost of the vector cast
operation as 0, because this cast will be later removed.
Also, if the vectorization tree root operations are integer cast operations, do not consider them as candidates for truncation. It will just create extra number of the same vector/scalar operations, which will be removed by instcombiner.


https://reviews.llvm.org/D41948

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/PR35777.ll
  test/Transforms/SLPVectorizer/X86/sign-extend.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41948.129443.patch
Type: text/x-patch
Size: 8091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180111/fabf81f0/attachment.bin>


More information about the llvm-commits mailing list