[Mlir-commits] [mlir] [mlir][scf] Rewrite vector.transfer_read/write after peeling (PR #88684)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Apr 17 10:47:46 PDT 2024


ShivaChen wrote:

> One way to structure this would be to modify the `peelForLoop` to return a `FailureOr<Operation*>` where the returned `Operation *` is the peeled loop. Then the transformation here could be written as a one-off vector dialect transformation that takes the peeled loop and original loop to do what you have here.
> 
> I am not thrilled about the suggestion though. Ideally this should just be an analysis of the indices of the vector.transfer_read that tells you that it is always inbounds. Maybe you can use the `ValuesBoundInterface` to do this.
> 
> @matthias-springer if you have any suggestions here.

Thanks for the tips to move the transformation to vector dialect. It seems the vector dialect has foldTransferInBoundsAttribute which will add the attribute if it proves in-bound. I try to extend the function to contain the transformation and create a new PR https://github.com/llvm/llvm-project/pull/89108. 

I dig the ValuesBoundInterface for a while but can't figure out the way to utilize yet. 

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


More information about the Mlir-commits mailing list