[Mlir-commits] [mlir] [mlir] remove folder on MemRef::ExtractStridedMetadataOp (PR #88043)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Apr 9 18:20:33 PDT 2024
MaheshRavishankar wrote:
> ExtractStridedMetadataOp Is really an abstraction breaking op, so it’s hard to me to argue about “correctness”: it reminds me of these ops in the bufferization dialect that only exist within specific invariant of the bufferization process.
>
> It would be great if we could start with the documentation of this op, and carefully describe its invariant and intended usage first: at the moment, when rereading https://mlir.llvm.org/docs/Dialects/MemRef/#memrefextract_strided_metadata-memrefextractstridedmetadataop it seems like this op exists to expose separately thing like pointer and offset and to enable folding!
> Let make sure the doc is very clear and then look into what kind of folding reasonably matches the intent for this op.
This makes sense! Thanks. We don't need this OR right now cause we are going to try to work around it, but happy to flush this out a bit more.
Documenting my understanding here. MLIR doesn't have a way to handle raw pointers. But when calling out to libraries, or using LLVM for codegen raw pointers are needed (note: raw pointers are not needed for SpIRV so the SpIRV type system more closely matches memrefs). This op is breaking apart memref and providing access to raw pointers, offsets, sizes and strides. For a consistent view these memrefs attributes that are split apart by this op should never be decoupled. As long as this op ties everything together you can have consistency between the pure memref world and " the broken apart world". But if you break the link (like this folder does) then there is no way of getting a consistent state and then any transformation you do on buffers is effectively illegal. If we don't break the link you can still do transformations on buffers and maintain program semantics.
https://github.com/llvm/llvm-project/pull/88043
More information about the Mlir-commits
mailing list