[llvm] [MLGO] Model selection for models lowered through EmitC (PR #212650)

ioana ghiban via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 01:03:35 PDT 2026


================
@@ -0,0 +1,123 @@
+# Compile MLGO models expressed as MLIR to C++ headers via the EmitC pipeline.
+#
+# Each entry of ${models} has the form
+# "cli-flag,path/to/model.mlir,type". Entries whose type matches
+# ${target_type} are lowered with ${mlir_opt} and translated with
+# ${mlir_translate} to a C++ header defining Model<N>, placed in
+# ${LLVM_INCLUDE_DIR}/${include_subdir}. In the same directory, generate
+# ${def_file}, with one MLGO_MODEL(ClassName, "cli-flag") entry per model, and
+# ${umbrella_header}, including all the generated model headers.
+# Append the target driving generation to MLDeps in the caller's scope, and
+# define LLVM_HAVE_EMITC_COMPILE_<TARGET_TYPE>.
----------------
ioghiban wrote:

```suggestion
# define LLVM_HAVE_IN_TREE_COMPILE_<TARGET_TYPE>.
```
or
`# define LLVM_HAVE_MLIR_COMPILE_<TARGET_TYPE>.`
etc
The user of this flow doesn't have to be aware of details such as the use of EmitC dialect

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


More information about the llvm-commits mailing list