Skip to content

Commit 0ac2136

Browse files
committed
[MLIR][Presburger] normalizeDiv: add assert that denom > 0
1 parent 4e83d4f commit 0ac2136

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mlir/lib/Analysis/Presburger/Utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ int64_t presburger::normalizeRange(MutableArrayRef<int64_t> range) {
324324
}
325325

326326
void presburger::normalizeDiv(MutableArrayRef<int64_t> num, int64_t &denom) {
327+
assert(denom > 0 && "denom must be positive!");
327328
int64_t gcd = llvm::greatestCommonDivisor(gcdRange(num), denom);
328329
for (int64_t &coeff : num)
329330
coeff /= gcd;

0 commit comments

Comments
 (0)