[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:28:48 PDT 2026


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

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

Thanks for the review @FedericoBruzzone.

```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)), which is <= 1
  // exactly when UB - LB <= Step (for a positive step). 
  // Compare in integer arithmetic: converting to float is lossy  
  // and wrongly skipped peeling of loops.
```
how does this look?

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


More information about the Mlir-commits mailing list