[PATCH] D50840: [InstCombine] Extend collectShuffleElements to support extract/zext/insert patterns

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 07:20:53 PDT 2018


lebedev.ri added subscribers: mssimpso, RKSimon, ABataev.
lebedev.ri added a comment.

In https://reviews.llvm.org/D50840#1202449, @joey wrote:

> In https://reviews.llvm.org/D50840#1202436, @lebedev.ri wrote:
>
> > 1. Why is this limited to extensions? Why can't this also be done for `trunc`? Or more generally, why don't we want to do this if the same operation is applied for all the elements?
> > 2. Do the vectorizer passes handle this? (Especially in light of the last question of `1.`)
>
>
>
>
> 1. No real reason, just the test case I wrote the code for. I can do the same for `trunc` as well. I'm not sure if it makes sense for the other `CastInst` operators though.




> 2. I tried the test case with `opt -slp-vectorizer` and it doesn't catch it. Anything else I can try?

I see, CC'ing @ABataev / @RKSimon / @mssimpso
I really wonder if this is one of these cases where we shouldn't do it in instcombine, even if it can be done, but elsewhere..
Because it isn't perfectly obvious [to me] why we would want to stop on these 3 casts, and not keep piling more stuff here.


Repository:
  rL LLVM

https://reviews.llvm.org/D50840





More information about the llvm-commits mailing list