[all-commits] [llvm/llvm-project] 4a62d4: [InstCombine] Fold zext-add/sub-min/max-trunc to u...
suoyuan via All-commits
all-commits at lists.llvm.org
Fri Mar 27 07:14:54 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 4a62d48549d2498b2e88b9bde12a4b7d5b67e4f8
https://github.com/llvm/llvm-project/commit/4a62d48549d2498b2e88b9bde12a4b7d5b67e4f8
Author: suoyuan <suoyuan666 at s5n.xyz>
Date: 2026-03-27 (Fri, 27 Mar 2026)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
M llvm/test/Transforms/InstCombine/saturating-add-sub.ll
Log Message:
-----------
[InstCombine] Fold zext-add/sub-min/max-trunc to uadd.sat or usub.sat (#185259)
Fixes #185244
```
trunc(umin(zext(a) + zext(b), MAX)) -> uadd.sat(a, b)
trunc(smin(zext(a) + zext(b), MAX)) -> uadd.sat(a, b)
trunc(smax(zext(a) - zext(b), 0)) --> usub.sat(a, b)
```
Proof: https://alive2.llvm.org/ce/z/K6wszu
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list