@@ -54,16 +54,16 @@ struct TosaFoldConstantClamp : public OpRewritePattern<ClampOp> {
54
54
auto resultingIntType = cast<IntegerType>(resultType.getElementType ());
55
55
56
56
// Lambda to perform the clamp
57
- auto clampUpper = [&extLowerBound, &extUpperBound,
58
- &comparisonWidth](const APInt &val, IntegerType type) {
57
+ auto clampFun = [&extLowerBound, &extUpperBound,
58
+ &comparisonWidth](const APInt &val, IntegerType type) {
59
59
auto clampedUpper =
60
60
llvm::APIntOps::smin (val.sext (comparisonWidth), extUpperBound);
61
61
auto fullyClamped = llvm::APIntOps::smax (clampedUpper, extLowerBound);
62
62
assert (type.getWidth () >= fullyClamped.getSignificantBits ());
63
63
return fullyClamped.trunc (type.getWidth ());
64
64
};
65
65
auto newTensor = applyElementWise<APInt, APInt, IntegerType>(
66
- inputValues, clampUpper , resultingIntType);
66
+ inputValues, clampFun , resultingIntType);
67
67
68
68
return newTensor;
69
69
}
@@ -85,8 +85,8 @@ struct TosaFoldConstantClamp : public OpRewritePattern<ClampOp> {
85
85
86
86
// Ensure that the value is larger than the lower bound and smaller than the
87
87
// upper bound
88
- auto clampLower = [&lowerBound, &upperBound,
89
- &comparisonSem](APFloat val, FloatType type) {
88
+ auto clampFun = [&lowerBound, &upperBound, &comparisonSem](APFloat val ,
89
+ FloatType type) {
90
90
if (val.isNaN ()) {
91
91
return APFloat::getNaN (type.getFloatSemantics ());
92
92
}
@@ -97,7 +97,7 @@ struct TosaFoldConstantClamp : public OpRewritePattern<ClampOp> {
97
97
return fullyClamped;
98
98
};
99
99
auto newTensor = applyElementWise<APFloat, APFloat, FloatType>(
100
- inputValues, clampLower , resultingFloatType);
100
+ inputValues, clampFun , resultingFloatType);
101
101
102
102
return newTensor;
103
103
}
0 commit comments