Page MenuHomePhabricator

[InstSimplify] Add simplifications for `umin/umax(uadd/usub.sat(X, Y), X)`
Needs RevisionPublic

Authored by goldstein.w.n on Mon, Mar 6, 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 Timeline

goldstein.w.n created this revision.Mon, Mar 6, 6:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Mar 6, 6:07 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
goldstein.w.n requested review of this revision.Mon, Mar 6, 6:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Mar 6, 6:07 PM
nikic requested changes to this revision.Thu, Mar 9, 7:13 AM

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.Thu, Mar 9, 7:13 AM