This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Add a new formula for SMIN.
ClosedPublic

Authored by sanjoy on Apr 29 2015, 3:12 PM.

Details

Summary

After this change MatchSelectPattern recognizes the following form
of SMIN:

Y >s C ? ~Y : ~C == ~Y <s ~C ? ~Y : ~C = SMIN(~Y, ~C)

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy updated this revision to Diff 24659.Apr 29 2015, 3:12 PM
sanjoy retitled this revision from to [InstCombine] Add a new formula for SMIN..
sanjoy updated this object.
sanjoy edited the test plan for this revision. (Show Details)
sanjoy added a reviewer: majnemer.
sanjoy added a subscriber: Unknown Object (MLST).
majnemer accepted this revision.Apr 29 2015, 8:58 PM
majnemer edited edge metadata.

Totally righteous, LGTM.

lib/Transforms/InstCombine/InstCombineSelect.cpp
91 ↗(On Diff #24659)

Please brace this because it dominates a braced control-flow statement. Also, we can just use const auto *C2 here, the type is pretty clear.

This revision is now accepted and ready to land.Apr 29 2015, 8:58 PM
This revision was automatically updated to reflect the committed changes.