[clang-tools-extra] [clang] [flang] [mlir] [libc] [llvm] [compiler-rt] [MLIR] Setting MemorySpace During Bufferization + Fixes (PR #78484)

Matthias Springer via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 07:54:19 PST 2024


================
@@ -351,6 +354,16 @@ struct BufferizationOptions {
   /// used.
   UnknownTypeConverterFn unknownTypeConverterFn = nullptr;
 
+  // Use during type conversion to determine the memory space for memref based
+  // on the originanl tensor type
+  GetMemorySpaceFn getMemorySpaceFn = nullptr;
----------------
matthias-springer wrote:

I think we don't need both `defaultMemorySpace` and `getMemorySpaceFn`. Can you rename this field to `defaultMemorySpaceFn` and give it a default lambda of `return Attribute();`? Also clarify in the documentation of the field that this lambda is only used when the memory space cannot be inferred.


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


More information about the cfe-commits mailing list