[Mlir-commits] [mlir] [mlir][llvm] Preserve function entry count metadata (PR #204707)

Tobias Gysi llvmlistbot at llvm.org
Sun Jun 21 11:35:10 PDT 2026


================
@@ -3266,6 +3267,33 @@ LogicalResult LLVMFuncOp::verify() {
   if (failed(verifyComdat(*this, getComdat())))
     return failure();
 
+  if (!getFunctionEntryCountAttr()) {
+    if (getFunctionEntryCountSynthetic())
+      return emitOpError() << "requires function_entry_count when "
+                              "function_entry_count_synthetic is set";
+    if (getFunctionEntryCountImportsAttr())
+      return emitOpError() << "requires function_entry_count when "
+                              "function_entry_count_imports is set";
+  }
+  if (DenseI64ArrayAttr imports = getFunctionEntryCountImportsAttr()) {
+    if (getFunctionEntryCountSynthetic())
+      return emitOpError() << "does not support function_entry_count_imports "
+                              "with function_entry_count_synthetic";
----------------
gysit wrote:

Are you sure about that limitation? I didn't find this in LLVM's Verifier.cpp?

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


More information about the Mlir-commits mailing list