[Mlir-commits] [mlir] [mlir][EmitC]Add a Reflection Map to a Class (PR #150572)

Andrzej Warzyński llvmlistbot at llvm.org
Mon Mar 2 10:03:02 PST 2026


================
@@ -60,4 +60,42 @@ def WrapFuncInClassPass : Pass<"wrap-emitc-func-in-class"> {
   ];
 }
 
+def MLGOAddReflectionMapPass : Pass<"MLGO-add-reflection-map", "ModuleOp"> {
+  let summary =
+      "Add a reflection map function to EmitC classes for runtime field lookup. This is MLGO Specific.";
+  let description = [{
+        This pass adds a `getBufferForName` function to EmitC classes that enables 
+        runtime lookup of field buffers by their string names. 
+        This requires that the class has fields with attributes and a function named `execute`.
+        The `fieldop` attribute is expected to be a dictionary where:
+        - The keys are `namedAttribute`.
+        - The values are arrays containing a single string attribute.
----------------
banach-space wrote:

Is this description is outdated? I don't see `getBufferForName` anywhere in this patch 🤔 

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


More information about the Mlir-commits mailing list