diff --git a/mlir/lib/Analysis/Presburger/Utils.cpp b/mlir/lib/Analysis/Presburger/Utils.cpp index 77230fc825dc..d25d03447e9a 100644 --- a/mlir/lib/Analysis/Presburger/Utils.cpp +++ b/mlir/lib/Analysis/Presburger/Utils.cpp @@ -324,6 +324,7 @@ int64_t presburger::normalizeRange(MutableArrayRef range) { } void presburger::normalizeDiv(MutableArrayRef num, int64_t &denom) { + assert(denom > 0 && "denom must be positive!"); int64_t gcd = llvm::greatestCommonDivisor(gcdRange(num), denom); for (int64_t &coeff : num) coeff /= gcd;