1717#include " mlir/IR/BuiltinAttributes.h"
1818#include " mlir/Interfaces/InferIntRangeInterface.h"
1919#include " mlir/Interfaces/Utils/InferIntRangeCommon.h"
20+ #include " llvm/ADT/APInt.h"
2021
2122#include < cstdint>
2223
@@ -40,7 +41,8 @@ AffineExprBoundsVisitor::AffineExprBoundsVisitor(
4041
4142AffineExprBoundsVisitor::AffineExprBoundsVisitor (
4243 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 ) {
4446 assert (constLowerBounds.size () == constUpperBounds.size ());
4547 // Convert int64_ts to APInts.
4648 for (unsigned i = 0 ; i < constLowerBounds.size (); i++) {
@@ -107,7 +109,8 @@ ConstantIntRanges getRange(APInt lb, APInt ub, bool boundsSigned) {
107109// / binary operations on two ranges.
108110void AffineExprBoundsVisitor::inferBinOpRange (
109111 AffineBinaryOpExpr expr,
110- std::function<ConstantIntRanges(ArrayRef<ConstantIntRanges>)> opInference) {
112+ const std::function<ConstantIntRanges(ArrayRef<ConstantIntRanges>)>
113+ &opInference) {
111114 ConstantIntRanges lhsRange =
112115 getRange (lb[expr.getLHS ()], ub[expr.getLHS ()], boundsSigned);
113116 ConstantIntRanges rhsRange =
0 commit comments