|
6 | 6 | // |
7 | 7 | //===----------------------------------------------------------------------===// |
8 | 8 |
|
| 9 | +#include <utility> |
| 10 | + |
9 | 11 | #include "mlir/Interfaces/ValueBoundsOpInterface.h" |
10 | 12 |
|
11 | 13 | #include "mlir/IR/BuiltinTypes.h" |
@@ -151,7 +153,7 @@ ValueBoundsConstraintSet::Variable::Variable(AffineMap map, |
151 | 153 | [](Value v) { return Variable(v); })) {} |
152 | 154 |
|
153 | 155 | ValueBoundsConstraintSet::ValueBoundsConstraintSet( |
154 | | - MLIRContext *ctx, StopConditionFn stopCondition, |
| 156 | + MLIRContext *ctx, const StopConditionFn &stopCondition, |
155 | 157 | bool addConservativeSemiAffineBounds) |
156 | 158 | : builder(ctx), stopCondition(stopCondition), |
157 | 159 | addConservativeSemiAffineBounds(addConservativeSemiAffineBounds) { |
@@ -302,7 +304,8 @@ int64_t ValueBoundsConstraintSet::insert(bool isSymbol) { |
302 | 304 | return pos; |
303 | 305 | } |
304 | 306 |
|
305 | | -int64_t ValueBoundsConstraintSet::insert(AffineMap map, ValueDimList operands, |
| 307 | +int64_t ValueBoundsConstraintSet::insert(AffineMap map, |
| 308 | + const ValueDimList &operands, |
306 | 309 | bool isSymbol) { |
307 | 310 | assert(map.getNumResults() == 1 && "expected affine map with one result"); |
308 | 311 | int64_t pos = insert(isSymbol); |
@@ -629,7 +632,7 @@ LogicalResult ValueBoundsConstraintSet::computeIndependentBound( |
629 | 632 |
|
630 | 633 | FailureOr<int64_t> ValueBoundsConstraintSet::computeConstantBound( |
631 | 634 | presburger::BoundType type, const Variable &var, |
632 | | - StopConditionFn stopCondition, bool closedUB) { |
| 635 | + const StopConditionFn &stopCondition, bool closedUB) { |
633 | 636 | // Default stop condition if none was specified: Keep adding constraints until |
634 | 637 | // a bound could be computed. |
635 | 638 | int64_t pos = 0; |
@@ -666,7 +669,7 @@ void ValueBoundsConstraintSet::populateConstraints(Value value, |
666 | 669 |
|
667 | 670 | int64_t ValueBoundsConstraintSet::populateConstraints(AffineMap map, |
668 | 671 | ValueDimList operands) { |
669 | | - int64_t pos = insert(map, operands, /*isSymbol=*/false); |
| 672 | + int64_t pos = insert(map, std::move(operands), /*isSymbol=*/false); |
670 | 673 | // Process the backward slice of `operands` (i.e., reverse use-def chain) |
671 | 674 | // until `stopCondition` is met. |
672 | 675 | processWorklist(); |
@@ -826,10 +829,9 @@ FailureOr<bool> ValueBoundsConstraintSet::areEqual(const Variable &var1, |
826 | 829 | return strongCompare(var1, ComparisonOperator::EQ, var2); |
827 | 830 | } |
828 | 831 |
|
829 | | -FailureOr<bool> |
830 | | -ValueBoundsConstraintSet::areOverlappingSlices(MLIRContext *ctx, |
831 | | - HyperrectangularSlice slice1, |
832 | | - HyperrectangularSlice slice2) { |
| 832 | +FailureOr<bool> ValueBoundsConstraintSet::areOverlappingSlices( |
| 833 | + MLIRContext *ctx, const HyperrectangularSlice &slice1, |
| 834 | + const HyperrectangularSlice &slice2) { |
833 | 835 | assert(slice1.getMixedOffsets().size() == slice2.getMixedOffsets().size() && |
834 | 836 | "expected slices of same rank"); |
835 | 837 | assert(slice1.getMixedSizes().size() == slice2.getMixedSizes().size() && |
@@ -891,10 +893,9 @@ ValueBoundsConstraintSet::areOverlappingSlices(MLIRContext *ctx, |
891 | 893 | return true; |
892 | 894 | } |
893 | 895 |
|
894 | | -FailureOr<bool> |
895 | | -ValueBoundsConstraintSet::areEquivalentSlices(MLIRContext *ctx, |
896 | | - HyperrectangularSlice slice1, |
897 | | - HyperrectangularSlice slice2) { |
| 896 | +FailureOr<bool> ValueBoundsConstraintSet::areEquivalentSlices( |
| 897 | + MLIRContext *ctx, const HyperrectangularSlice &slice1, |
| 898 | + const HyperrectangularSlice &slice2) { |
898 | 899 | assert(slice1.getMixedOffsets().size() == slice2.getMixedOffsets().size() && |
899 | 900 | "expected slices of same rank"); |
900 | 901 | assert(slice1.getMixedSizes().size() == slice2.getMixedSizes().size() && |
|
0 commit comments