[PATCH] D48987: [InstCombine] drop poison flags for shuffle transforms with undefs

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 12:57:14 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D48987#1153586, @spatel wrote:

> In https://reviews.llvm.org/D48987#1153565, @lebedev.ri wrote:
>
> > So my concerns weren't unfounded :/
> >  Do we want to also do such kind of fixup in `VisitShl()` in instcombine, for every `shl` we visit?
>
>
> Do you have an example of the problem you're thinking of? AFAIK, we won't hit this problem with scalars or general transforms because they don't modify constants like we're doing here. We do have a related foldShuffledBinop() function that I will review/fix if this patch looks right.


Note also that most of instcombine drops flags by default when it does a transform, and we generally favor dropping flags if that results in a better instruction canonicalization.

My main concern with these recent shuffle patches was not dropping fast-math-flags because that can inhibit later optimizations. I was too aggressive by trying to preserve poison flags along with those.


https://reviews.llvm.org/D48987





More information about the llvm-commits mailing list