[Mlir-commits] [mlir] Fixing peelFirstIteration. Was incorrectly replacing all ub inside peeled iteration region. (PR #163720)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 16 01:02:20 PDT 2025


================
@@ -83,7 +125,7 @@ func.func @no_loop_results(%ub : index, %d : memref<i32>) {
 //      CHECK:   %[[NEW_UB:.*]] = affine.apply #[[MAP0]]()[%[[LB]], %[[STEP]]]
 //      CHECK:   %[[FIRST:.*]] = scf.for %[[IV:.*]] = %[[LB]] to %[[NEW_UB]]
 // CHECK-SAME:       step %[[STEP]] iter_args(%[[ACC:.*]] = %[[C0_I32]]) -> (i32) {
-//      CHECK:     %[[MIN:.*]] = affine.min #[[MAP1]](%[[NEW_UB]], %[[IV]])[%[[STEP]]]
----------------
ddubov100 wrote:

This demonstrates a bug in following scenario:
If ub = 2:
Before peeling it will run single iteration with MIN = 2
After peeling it will run single iteration with MIN = 4

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


More information about the Mlir-commits mailing list