[Mlir-commits] [mlir] [mlir][Vector] add vector.insert canonicalization pattern to convert a chain of insertions to vector.from_elements (PR #142944)
Adrian Kuegel
llvmlistbot at llvm.org
Thu Aug 21 22:59:20 PDT 2025
akuegel wrote:
> > And then the other pattern applies and folds this into returning %arg0. I believe that pattern is wrong and should only be applied if the base argument is the same (so that we read and write to/from the same memory). Given this PR only triggers this potential bug, I guess I will have to look into fixing this myself.
>
> The pattern is applying correctly. tensors have value semantics, there is no "memory" here. The transfer_write here does a complete overlap on the destination, so we can fold completly here without needing to use the destination tensor values.
@Groverkss Does it mean the pre-canonicalization IR we use is wrong? We want to copy memory from one location to another location. What would be the proper way to do that?
https://github.com/llvm/llvm-project/pull/142944
More information about the Mlir-commits
mailing list