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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 12:27:38 PDT 2019


spatel added a comment.

In D62024#1510707 <https://reviews.llvm.org/D62024#1510707>, @efriedma wrote:

> Okay, so my current understanding is the following: the invariant we want for this patch is that given an IR shufflevector with a given destination type and shuffle mask, we produce an ISD::VECTOR_SHUFFLE with the same destination type and shuffle mask.  If that's true, we can change the source type without causing issues.  If the source and destination vectors both have both power-of-two length, SelectionDAG does in fact preserve this invariant.  But in general, it doesn't.
>
> I don't want to create extra work in the way of an incremental improvement, but I don't think we can merge this patch given the current state of SelectionDAG.  Maybe if would be okay if you restrict it to power-of-two vectors for now?


Sure - that would still catch the motivating cases that I saw. I only included the prime number vector sizes to verify that the shuffle mask adjustment was working as intended. I'll add more tests and limit this.


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

https://reviews.llvm.org/D62024





More information about the llvm-commits mailing list