[PATCH] D63992: [InstCombine] Y - ~X --> X + Y + 1 fold (PR42457)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 1 12:37:47 PDT 2019
spatel added a comment.
In D63992#1565232 <https://reviews.llvm.org/D63992#1565232>, @lebedev.ri wrote:
> In D63992#1565213 <https://reviews.llvm.org/D63992#1565213>, @efriedma wrote:
>
> > Yes, we should probably teach DAGCombine to choose the right form for each target/type.
> >
> > It seems reasonable to prefer `x+(y+1)` over `x-(-1-y)`, for reassociation etc. It's possible there could be some bad interaction at the interface between logical and arithmetic operations, which makes us miss some important optimization, but that doesn't seem likely to me.
>
>
> Great, thank you for the feedback!
> I will look into backend stuff; if there are no other concerns here please feel free to accept,
> i'm **not** going to land until after the backend stuff is done.
Produce this:
(x + 1) + y
rather than:
(x + y) + 1
?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63992/new/
https://reviews.llvm.org/D63992
More information about the llvm-commits
mailing list