[Mlir-commits] [mlir] [MLIR][LLVM] Add CG Profile module flags support (PR #137115)

Christian Ulmann llvmlistbot at llvm.org
Thu Apr 24 03:51:43 PDT 2025


================
@@ -271,6 +271,31 @@ static void convertLinkerOptionsOp(ArrayAttr options,
   linkerMDNode->addOperand(listMDNode);
 }
 
+static llvm::Metadata *
+convertModuleFlagValue(StringRef key, ArrayAttr arrayAttr,
+                       llvm::IRBuilderBase &builder,
+                       LLVM::ModuleTranslation &moduleTranslation) {
+  llvm::LLVMContext &context = builder.getContext();
+  llvm::MDBuilder mdb(context);
+  SmallVector<llvm::Metadata *> nodes;
+
+  if (key == "CG Profile") {
----------------
Dinistro wrote:

Nit: Can you change this to an early return. Also, do we have this string key available in some header?

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


More information about the Mlir-commits mailing list