This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Add call to matchSignedSaturate from min/max
ClosedPublic

Authored by dmgreen on Aug 14 2021, 2:51 PM.

Details

Summary

This adds a call to matchSignedSaturate from smin/smax instrinsics, allowing the same patterns to match if the canonical form is an intrinsics, not a icmp/select.

Diff Detail

Event Timeline

dmgreen created this revision.Aug 14 2021, 2:51 PM
dmgreen requested review of this revision.Aug 14 2021, 2:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2021, 2:51 PM
nikic added inline comments.Aug 14 2021, 2:53 PM
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
2215–2218

These "one-use" checks aren't going to work correctly for the intrinsic form, where we don't have the duplicate cmp+select use.

lebedev.ri accepted this revision.Aug 14 2021, 2:54 PM

LG, thank you.

This revision is now accepted and ready to land.Aug 14 2021, 2:54 PM

LG, thank you.

Cheers

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
2215–2218

Oh yeah good point. Will fix.

dmgreen updated this revision to Diff 366477.Aug 15 2021, 12:21 AM

Update the one use checks.

nikic accepted this revision.Aug 15 2021, 6:44 AM

LGTM as well.

This revision was landed with ongoing or failed builds.Aug 15 2021, 9:25 AM
This revision was automatically updated to reflect the committed changes.