[PATCH] D23897: [SelectionDAG] Generate vector_shuffle nodes for undersized result vector sizes

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 17:24:45 PDT 2016


mkuper created this revision.
mkuper added reviewers: spatel, RKSimon, craig.topper.
mkuper added a subscriber: llvm-commits.

Today, we can generate a vector_shuffle from an IR shuffle where the size of the result is exactly the sum of the sizes of the input vectors. If the output vector is smaller - e.g. a <12 x i8> being formed by a shuffle with two <8 x i8> inputs, we emit a sequence of extracts and inserts.

Instead, we can form a larger vector_shuffle, and then extract a subvector of the right size - e.g. shuffle the two <8 x i8>-s into a <16 x i8> and extract a <12 x i8>.

This solves PR29025.

This has a dependency on D23893 - forming a vector instead of a series of inserts/extracts pessimizes a test, because of a mess created by legalization, and we need D23893 for clean-up.

https://reviews.llvm.org/D23897

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  test/CodeGen/X86/pr29025.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23897.69305.patch
Type: text/x-patch
Size: 6766 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160826/a7730f44/attachment.bin>


More information about the llvm-commits mailing list