[llvm] [InstCombine] Fold `umax/umin(nuw_shl(base, x), nuw_shl(base, y)) -> nuw_shl(base, umax/umin(x, y))` (PR #131076)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 13 01:29:23 PDT 2025
- Previous message: [llvm] [InstCombine] Fold `umax/umin(nuw_shl(base, x), nuw_shl(base, y)) -> nuw_shl(base, umax/umin(x, y))` (PR #131076)
- Next message: [llvm] [InstCombine] Fold `umax/umin(nuw_shl(base, x), nuw_shl(base, y)) -> nuw_shl(base, umax/umin(x, y))` (PR #131076)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
https://github.com/nikic commented:
Can we handle this in foldIntrinsicUsingDistributiveLaws instead? It currently assumes commutative ops, but if we drop that assumption we can handle the shift case there as well.
Note that while the transform is not valid for nsw + smin/smax, you *can* preserve the nsw flag for the unsigned case.
https://github.com/llvm/llvm-project/pull/131076
- Previous message: [llvm] [InstCombine] Fold `umax/umin(nuw_shl(base, x), nuw_shl(base, y)) -> nuw_shl(base, umax/umin(x, y))` (PR #131076)
- Next message: [llvm] [InstCombine] Fold `umax/umin(nuw_shl(base, x), nuw_shl(base, y)) -> nuw_shl(base, umax/umin(x, y))` (PR #131076)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the llvm-commits
mailing list