[Mlir-commits] [mlir] [mlir][vector] Set InBound for vector read write after peeling (PR #89108)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Apr 18 21:49:26 PDT 2024
ShivaChen wrote:
> Hey, thanks for the contribution! I'm a bit confused... If the number of iterations is multiple of the vector length how is that we peel that loop? We shouldn't generate any peel loop for that case, right?
>
> It's also not clear to me how the loop bounds relate to the boundaries of the memory access. The number of iterations of the loop could be multiple of the vector length but that is not sufficient to say that the memory access would be in-bounds. Could you help me understand this point?
Hi, thanks for the comment. The loop is generated by affine vectorizer and then peeling. If we annotate loops as loop(iteration, step), it will looks like: loop(N, 1) -> loop(N, 64) -> mainLoop(N - N mod 64, 64) and epilogueLoop(N mod 64, 64). I was trying to remove the mask from mainLoop.
I think you are right. The memory boundary test is missing. I add the boundary test when the loop upper bound is constant. Could I ask is there way to test in-bound when the upper is unknown? Thanks for pointing the difference with C array.
https://github.com/llvm/llvm-project/pull/89108
More information about the Mlir-commits
mailing list