[Mlir-commits] [mlir] [mlir][affine] add remove-single-iteration-loop pass. (PR #129270)

lonely eagle llvmlistbot at llvm.org
Tue Apr 15 11:08:14 PDT 2025


linuxlonelyeagle wrote:

In my opinion, the key reason is still that the existing pass on affine.for relies too much on trips, i.e., the number of iterations, for implementations based on the number of iterations. And the implementation of this PR no longer relies on trip.

These are two different implementations.

But now it looks like if you want to implement this PR in -affine-loop-normalize it's not impossible, but there should be a higher performance loss because if the trip is a range, you have to make sure that both the lower bound and the upper bound are 1. Or that the lower bound is equal to 0 ( Or the lower bound is equal to 0 (just delete the loop), which would be more costly. And this feature is only one of the features of the pass.

The point of the pass in this PR is that the name is much simpler and more straightforward, and it should only require a simple analysis.

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


More information about the Mlir-commits mailing list