[Mlir-commits] [mlir] port fixes from local llvm (PR #78484)

Sagar Kulkarni llvmlistbot at llvm.org
Wed Jan 17 14:36:59 PST 2024


sagarkulkarni19 wrote:

Hi @manbearian, 

Thanks for creating this PR! I think this could be very helpful in using the `encoding` attribute during bufferization. 

I have a few points that can be possible future extensions:

1. Since the encoding attribute is quite generic i.e., it can be used for storing any information, I wonder if only converting it to the `MemorySpace` attribute is restrictive? For ex: In my use-case, I am storing layout information that may be represented with a `LayoutMap` in MemRef.  
2. The Bufferization pass results in the creation of `bufferization.to_memref`  Ops. These Ops have verifiers that fail when trying to bufferize a tensor with encoding attribute. Namely, `getTensorTypeFromMemRefType` defined in `mlir/include/mlir/Dialect/MemRef/IR/MemRef.h`, used to verify if the new MemRef Type created by `bufferization.to_memref`  is equivalent to the tensor type, does not check the encoding attribute and fails if an encoding attribute is present on the tensor type. 

Wanted to know your thoughts.

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


More information about the Mlir-commits mailing list