[Mlir-commits] [mlir] [mlir][scf] Fix front peeling skipped due to float rounding in trip count (PR #231100)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 12 03:52:22 PDT 2026


================

----------------
StarOne01 wrote:

oh ,  i just realised it is trip "count"

```cpp
  // Peeling is not needed if there is at most one iteration. 
  // Per the scf.for semantics, the trip count is
  // max(0, ceil((UB - LB) / Step)), so for a positive step there is more than
  // one iteration exactly when UB - LB > Step. 
  // Compare the integers directly: going through float is lossy and wrongly skipped
  // peeling of loops with two iterations.
```

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


More information about the Mlir-commits mailing list