forked from OSchip/llvm-project
[MLIR][Presburger] normalizeDiv: add assert that denom > 0
This commit is contained in:
parent
4e83d4fd92
commit
0ac213667d
|
@ -324,6 +324,7 @@ int64_t presburger::normalizeRange(MutableArrayRef<int64_t> range) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void presburger::normalizeDiv(MutableArrayRef<int64_t> num, int64_t &denom) {
|
void presburger::normalizeDiv(MutableArrayRef<int64_t> num, int64_t &denom) {
|
||||||
|
assert(denom > 0 && "denom must be positive!");
|
||||||
int64_t gcd = llvm::greatestCommonDivisor(gcdRange(num), denom);
|
int64_t gcd = llvm::greatestCommonDivisor(gcdRange(num), denom);
|
||||||
for (int64_t &coeff : num)
|
for (int64_t &coeff : num)
|
||||||
coeff /= gcd;
|
coeff /= gcd;
|
||||||
|
|
Loading…
Reference in New Issue