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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 06:05:14 PST 2022


nikic added a comment.

In D138814#3981336 <https://reviews.llvm.org/D138814#3981336>, @arsenm wrote:

> In D138814#3981324 <https://reviews.llvm.org/D138814#3981324>, @Pierre-vh wrote:
>
>> By `a + b < a` do you mean that the combine would:
>>
>> - Still reduce the add to the smaller type
>> - Replace the overflow bit (lshr) with `icmp lt (add a, b), a`?
>>
>> Does the backend already transform that to uaddo or will that need a separate patch in the target's CGP?
>
> Looks like no: https://godbolt.org/z/nTrzqxeo9

You are using slt rather than ult.


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