[llvm] [InstSimplify] Fold `X < Y ? (X + zext(X < Y)) <= Y : false` to `X < Y` (PR #118579)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 02:44:02 PST 2024


nikic wrote:

> As an alternative, we can replace the inner `X < Y` with `true` in InstCombine (via `replaceInInstruction`). Then InstCombine will fold this expression into `X < Y`:

I don't think this would cover the motivating case, where the add is multi-use.


https://github.com/llvm/llvm-project/pull/118579


More information about the llvm-commits mailing list