[Mlir-commits] [mlir] [mlir] remove folder on MemRef::ExtractStridedMetadataOp (PR #88043)

Matthias Springer llvmlistbot at llvm.org
Mon Apr 8 22:51:13 PDT 2024


matthias-springer wrote:

I can see the problem, but I don't that would make the folding incorrect. Imo, the correct way to fix this is to insert the `memref.extract_strided_metadata` at the point of time when you actually need the offset. I see `memref.extract_strided_metadata` as a kind of analysis result that is materialized in IR, and changing the IR invalidates the analysis.

I think you can run into similar issues with all kind of folding/canonicalizations; e.g.:

```mlir
%m = memref.alloc(%sz) : memref<?xf32>
%0 = memref.dim %m, %c0
func.call @foo(%m, %0)
```

Now you could have a hypothetical pass that changes the allocation size to the next multiple of 16, but `%0` was already folded to `%sz` and is no longer correct.


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


More information about the Mlir-commits mailing list