[PATCH] D138814: [InstCombine] Combine a/lshr of add -> uadd.with.overflow

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 28 08:01:28 PST 2022


spatel added a comment.

In D138814#3953729 <https://reviews.llvm.org/D138814#3953729>, @foad wrote:

>> What do you think about producing the sequence with 'not' + 'icmp' instead of the uadd + extract?
>
> The point about using uadd.with.overflow is that it also gives you the truncated 32 bit result of the add.

If we're not using that value (as shown in the first two tests), then do we still we want to canonicalize to an overflow intrinsic? That implies that we also need to transform the "not+icmp" pattern into "uadd+extract" to be consistent.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138814/new/

https://reviews.llvm.org/D138814



More information about the llvm-commits mailing list