[Mlir-commits] [mlir] [mlir][affine] Reject affine.for with step <= 0 in parser and verifier (PR #184158)

Jacques Pienaar llvmlistbot at llvm.org
Thu Mar 5 03:31:38 PST 2026


================
@@ -168,6 +168,10 @@ void mlir::affine::getTripCountMapAndOperands(
     SmallVectorImpl<Value> *tripCountOperands) {
   MLIRContext *context = forOp.getContext();
   int64_t step = forOp.getStepAsInt();
+  if (step <= 0) {
----------------
jpienaar wrote:

Same as the other one, this adds additional checks for invalid IR. We have asserts to be self-documenting for some of these, but we didn't specifically handle invalid IR.

https://github.com/llvm/llvm-project/pull/184158


More information about the Mlir-commits mailing list