[Mlir-commits] [mlir] [mlir][memref] Rewrite scalar `memref.copy` through reinterpret_cast into load/store (PR #186118)

Paul Kirth llvmlistbot at llvm.org
Thu Mar 12 10:40:28 PDT 2026


https://github.com/ilovepi approved this pull request.

I think this is in quite good shape. About the only things I have to offer are some minor nits, and a couple minor observations.

The loop in `isScalarSlice()` has a few items that could be more directly spelled out with `llvm::any/all_of`.  That has the downside of itrating over each of the containers independently though, and you're handling this all in a single pass. I think its debatable if either approach is better than the other. given I expect this to run rather infrequently and most of these are likely to have low-ish rank, its probably not important to change, unless we think its going to be easier to maintain. 

So to be clear IMO there's no need to change what you've done, I just wanted to point out another option to consider. Totally up to you on if you think its a good idea or not.

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


More information about the Mlir-commits mailing list