This is an archive of the discontinued LLVM Phabricator instance.

[IR] Add SaturatingInst and BinaryOpIntrinsic
ClosedPublic

Authored by nikic on May 26 2019, 9:40 AM.

Details

Summary

Based on the suggestion in https://reviews.llvm.org/D62447?id=201397#inline-554867, this adds a SaturatingInst class that represents the saturating add/sub family of intrinsics. It exposes the same interface as WithOverflowInst, for this reason I have also added a common base class BinaryOpIntrinsic that holds the actual implementation code.

Planned use-sites:

Diff Detail

Event Timeline

nikic created this revision.May 26 2019, 9:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2019, 9:40 AM
lebedev.ri accepted this revision.May 26 2019, 12:41 PM

Looks ok to me, thanks!

This revision is now accepted and ready to land.May 26 2019, 12:41 PM
This revision was automatically updated to reflect the committed changes.