This is an archive of the discontinued LLVM Phabricator instance.

[IR] llvm::createMinMaxOp - create integer min/max intrinsics instead of icmp/sel
ClosedPublic

Authored by RKSimon on Apr 13 2023, 5:55 AM.

Details

Summary

Based off D148215, when expanding a min/max reduction we should be creating min/max intrinsics directly instead of relying on instcombine to fold them back together.

This patch handles integer min/max cases. Hopefully we can add floating point support soon (at least for fastmath/nnan cases) - but we're missing some of the plumbing to pass the correct FMF to the intrinsic at the moment.

Diff Detail

Event Timeline

RKSimon created this revision.Apr 13 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 5:55 AM
RKSimon requested review of this revision.Apr 13 2023, 5:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 5:55 AM
nikic accepted this revision.Apr 13 2023, 7:59 AM

LGTM

This revision is now accepted and ready to land.Apr 13 2023, 7:59 AM
nikic added a comment.Apr 13 2023, 8:00 AM

(Looks like there is a test failure in expand-experimental-reductions.ll)

This revision was landed with ongoing or failed builds.Apr 13 2023, 8:41 AM
This revision was automatically updated to reflect the committed changes.