umax(uadd.sat(X, Y), X) --> uadd.sat(X, Y)
umin(uadd.sat(X, Y), X) --> X
umax(usub.sat(X, Y), X) --> X
umin(usub.sat(X, Y), X) --> usub.sat(X, Y)
Paths
| Differential D145457
[InstSimplify] Add simplifications for `umin/umax(uadd/usub.sat(X, Y), X)` Needs RevisionPublic Authored by goldstein.w.n on Mar 6 2023, 6:07 PM.
Details Summary umax(uadd.sat(X, Y), X) --> uadd.sat(X, Y) umin(uadd.sat(X, Y), X) --> X umax(usub.sat(X, Y), X) --> X umin(usub.sat(X, Y), X) --> usub.sat(X, Y)
Diff Detail
Event Timelinegoldstein.w.n added a child revision: D145458: [InstSimplify] Add simplifications for `min/max(Abs(X), X)`.Mar 6 2023, 6:08 PM Comment Actions I believe this is taking the wrong approach to these folds. What you want to implement is simplification for something like this: https://alive2.llvm.org/ce/z/f_Eg7U And then min/max simplification should fall out of that for free. This revision now requires changes to proceed.Mar 9 2023, 7:13 AM
Revision Contents
Diff 502883 llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/minmax-intrin.ll
|