[Mlir-commits] [mlir] [mlir][vector] Prevent incorrect vector.transfer_{read|write} hoisting (PR #66930)

Andrzej Warzyński llvmlistbot at llvm.org
Fri Sep 22 01:00:49 PDT 2023


banach-space wrote:

> Your point about the value of %r1 changing is valid, however note that `vector<2xf32>` gets passed as an iter_arg of the function. 

Thank you, I missed that originally and your pointer was incredibly helpful in pinning down the actual issue 🙏🏻 .

I've updated my repro to also include aliasing - that's where things start to break (also updated the summary with a full example). And [hoist_vector_transfer_pairs](https://github.com/llvm/llvm-project/blob/903a7e487b4b3ee0f52f5675a5fc4ca188c1a3c0/mlir/test/Dialect/Linalg/hoisting.mlir#L15) is indeed correct - no aliasing there.

> There should be no visible effects of that transformation in the sequential case. However, we do know that there is a problem in the parallel case and it would generally be better to use the hoist tensor subsets transform instead (but there are other caveats).

So I'm actually running things sequentially. Also, as this is coming from IREE, I have very limited control over whether the underlying IR operates on tensors or memrefs. 

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


More information about the Mlir-commits mailing list