17
17
#include " mlir/IR/BuiltinAttributes.h"
18
18
#include " mlir/Interfaces/InferIntRangeInterface.h"
19
19
#include " mlir/Interfaces/Utils/InferIntRangeCommon.h"
20
+ #include " llvm/ADT/APInt.h"
20
21
21
22
#include < cstdint>
22
23
@@ -40,7 +41,8 @@ AffineExprBoundsVisitor::AffineExprBoundsVisitor(
40
41
41
42
AffineExprBoundsVisitor::AffineExprBoundsVisitor (
42
43
ArrayRef<std::optional<int64_t >> constLowerBounds,
43
- ArrayRef<std::optional<int64_t >> constUpperBounds, MLIRContext *context) {
44
+ ArrayRef<std::optional<int64_t >> constUpperBounds, MLIRContext *context)
45
+ : boundsSigned(true ), bitWidth(64 ) {
44
46
assert (constLowerBounds.size () == constUpperBounds.size ());
45
47
// Convert int64_ts to APInts.
46
48
for (unsigned i = 0 ; i < constLowerBounds.size (); i++) {
@@ -107,7 +109,8 @@ ConstantIntRanges getRange(APInt lb, APInt ub, bool boundsSigned) {
107
109
// / binary operations on two ranges.
108
110
void AffineExprBoundsVisitor::inferBinOpRange (
109
111
AffineBinaryOpExpr expr,
110
- std::function<ConstantIntRanges(ArrayRef<ConstantIntRanges>)> opInference) {
112
+ const std::function<ConstantIntRanges(ArrayRef<ConstantIntRanges>)>
113
+ &opInference) {
111
114
ConstantIntRanges lhsRange =
112
115
getRange (lb[expr.getLHS ()], ub[expr.getLHS ()], boundsSigned);
113
116
ConstantIntRanges rhsRange =
0 commit comments