forked from OSchip/llvm-project
[mlir][affine] addLowerOrUpperBound: Disallow pos among boundOperands
Bounds such as `dim_{pos} <= c_1 * dim_x + ...` where `x == pos` are invalid. `addLowerOrUpperBound` previously added an incorrect inequality to the set. Such cases are now explicitly rejected. Differential Revision: https://reviews.llvm.org/D107220
This commit is contained in:
parent
3a41ff4883
commit
fef4708472
|
@ -2004,6 +2004,10 @@ FlatAffineConstraints::addLowerOrUpperBound(unsigned pos, AffineMap boundMap,
|
|||
}
|
||||
|
||||
for (const auto &flatExpr : flatExprs) {
|
||||
// Invalid bound: pos appears among the operands.
|
||||
if (llvm::find(positions, pos) != positions.end())
|
||||
continue;
|
||||
|
||||
SmallVector<int64_t, 4> ineq(getNumCols(), 0);
|
||||
ineq[pos] = lower ? 1 : -1;
|
||||
// Dims and symbols.
|
||||
|
|
Loading…
Reference in New Issue