[PATCH] D49179: [InstCombine] Fold x & (-1 >> y) == x to x u<= (-1 >> y)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 11 11:11:46 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D49179#1159024, @lebedev.ri wrote:

> In https://reviews.llvm.org/D49179#1158957, @lebedev.ri wrote:
>
> > In https://reviews.llvm.org/D49179#1158930, @spatel wrote:
> >
> > > LGTM.
> >
> >
> > Thank you for such speedy review!
> >
> > I'm wondering, what about the signed case?
> >  https://godbolt.org/g/WvWX13
> >  https://godbolt.org/g/DM7XA4
> >  https://rise4fun.com/Alive/Qslx (check that 25 high bits are either all-ones, or all-zeros)
> >
> > Can we do this in instcombine?
> >  Or not, given that we were disabling some bit-fiddling transforms lately?
>
>
> Actually, not sure that is any better, will leave that for now.
>  Though the reverse transform might be a good thing for dagcombine.


It's a good question, but probably better asked on the dev list than here. I think we prefer to canonicalize to the form with less instructions even if that means we lose information from the eliminated ops.


Repository:
  rL LLVM

https://reviews.llvm.org/D49179





More information about the llvm-commits mailing list