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

Mehdi Amini llvmlistbot at llvm.org
Thu Mar 5 04:23:17 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) {
----------------
joker-eph wrote:

Actually getTrivialConstantTripCount() is called by the verifier and must be defensive, but this isn't the case here. Fixed, PTAL!

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


More information about the Mlir-commits mailing list