[PATCH] D138814: [InstCombine] Combine lshr of add -> (a + b < a)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 02:10:45 PST 2023


nikic added a comment.

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

> In D138814#3973599 <https://reviews.llvm.org/D138814#3973599>, @nikic wrote:
>
>> FWIW our historical stance has always been that uadd.with.overflow is non-canonical, and the canonical pattern is `a + b < a` (for non-constant `b`). uadd.with.overflow generally has worse optimization support, which is why we only form it during CGP for backend purposes.
>
> What's the historical stance on sadd.with.overflow?

sadd.with.overflow (and generally, all signed overflow intrinsics) are considered canonical, and we do produce them in InstCombine.


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