[Mlir-commits] [llvm] [mlir] [mlir][emitc] Ensure memref-to-emitc applies type converter to memref element types (PR #203742)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Jun 18 06:13:22 PDT 2026


================
@@ -101,15 +101,21 @@ Type convertMemRefType(MemRefType opTy, const TypeConverter *typeConverter) {
   return resultTy;
 }
 
-static Value calculateMemrefTotalSizeBytes(Location loc, MemRefType memrefType,
-                                           OpBuilder &builder) {
+static FailureOr<Value>
+calculateMemrefTotalSizeBytes(Location loc, MemRefType memrefType,
+                              OpBuilder &builder,
+                              const TypeConverter *typeConverter) {
----------------
banach-space wrote:

To me, based on the name, this function should not be concerned with the type conversion. Instead, I would pass the converted element type (e.g. `convertedElemTy`). This way, it would self-document itself. 

 It might be a matter of preference though. It's a nice-to-have.

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


More information about the Mlir-commits mailing list