[llvm] [InstCombine] Preserve range information for `Op0 -nsw umin(X, Op0) --> usub.sat(Op0, X)` (PR #170989)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 7 03:19:38 PST 2025
ParkHanbum wrote:
The reason this conversion is necessary is that during the process of converting operations like `x nsw-umin(x, y)` to `usub.sat`, `nsw`-related information is lost, resulting in missed optimization opportunities.
In my view, by the time it reaches `icmp`, it's likely already been converted to `usub.sat` and the information has been lost, so the possibility of `icmp` handling this appropriately seems low. What do you think?
https://github.com/llvm/llvm-project/pull/170989
More information about the llvm-commits
mailing list