diff --git a/mlir/lib/Analysis/AffineStructures.cpp b/mlir/lib/Analysis/AffineStructures.cpp --- a/mlir/lib/Analysis/AffineStructures.cpp +++ b/mlir/lib/Analysis/AffineStructures.cpp @@ -2004,6 +2004,10 @@ } for (const auto &flatExpr : flatExprs) { + // Invalid bound: pos appears among the operands. + if (llvm::find(positions, pos) != positions.end()) + continue; + SmallVector ineq(getNumCols(), 0); ineq[pos] = lower ? 1 : -1; // Dims and symbols.