[PATCH] D47428: [InstCombine] PR37603: low bit mask canonicalization

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 31 07:37:57 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D47428#1117688, @lebedev.ri wrote:

> In https://reviews.llvm.org/D47428#1117675, @spatel wrote:
>
> > This is a good IR canonicalization regardless of what happens in the backend because a 'not' is better for bit-tracking analysis and other transforms than an 'add'.
>
>
> Yep, i thought so too..
>
> > I don't understand the nuw question:
> >  https://rise4fun.com/Alive/ydD
> > 
> > We're missing this in instsimplify?
>
> I think we do? https://godbolt.org/g/rT3k7v
>  But i was only thinking about replacing `and nuw` with `xor` there.


I'm still not clear on the nuw question:
https://godbolt.org/g/mTHjhc

Are you trying to transform with a constant other than -1? If -1, then we should have simplified the IR to a constant.


Repository:
  rL LLVM

https://reviews.llvm.org/D47428





More information about the llvm-commits mailing list