[PATCH] D62024: [InstCombine] fold shuffles of insert_subvectors

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 16:12:38 PDT 2019


efriedma added a comment.

> We use "alignTo(7, 3)":

Hmm.  It looks like the idea is that we should perform the shuffle in some type that's a multiple of the source vectors, so we can construct the source operands using CONCAT_VECTORS.  Not sure why we aren't just generating an INSERT_SUBVECTOR into undef, though.

> But for the purposes of this transform, we don't have to worry about weird types, right?

Depends on what you mean by "weird"; AMDGPU has legal non-power-of-two vector types. But yes, for the purpose of preserving shuffles, we're generally trying to preserve shuffles that were legal in the first place, which means either the shuffle is "trivial", like the ones you've listed, or the destination type is legal (or maybe some multiple of a legal type, I guess).

-----

I had one more thought, which I'm not sure we really covered before: what happens if the destination type of the final shuffle is narrower than the intermediate types?  I guess the reasoning ends up mostly the same, though.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62024/new/

https://reviews.llvm.org/D62024





More information about the llvm-commits mailing list