This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Standard] Add clamp operation
AbandonedPublic

Authored by alexbatashev on Jul 17 2020, 3:10 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

The clamp operation clamps value inside a region. If target compares less than lowerBound, lowerBound is returned. If target compares more than upperBound, uppperBound is returned. Otherwise, target is returned.

Diff Detail

Event Timeline

alexbatashev created this revision.Jul 17 2020, 3:10 AM
ftynse added a subscriber: ftynse.Jul 17 2020, 3:12 AM

Please post an RFC on discourse before adding any new operations to Standard.

Please post an RFC on discourse before adding any new operations to Standard.

Sure, here's the link: https://llvm.discourse.group/t/rfc-standard-add-std-clamp-operation/1435

alexbatashev abandoned this revision.Jul 17 2020, 6:27 AM

This operation can be replaced with combination of affine.min/max.