[Mlir-commits] [mlir] ba5c0a6 - [mlir] Store OperationState property callbacks as function pointers (NFC) (#226083)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 24 02:32:11 PDT 2026


Author: Mehdi Amini
Date: 2026-09-24T09:32:04Z
New Revision: ba5c0a651eea7949da3bd6cfd8c7cd61ba2ff1ce

URL: https://github.com/llvm/llvm-project/commit/ba5c0a651eea7949da3bd6cfd8c7cd61ba2ff1ce
DIFF: https://github.com/llvm/llvm-project/commit/ba5c0a651eea7949da3bd6cfd8c7cd61ba2ff1ce.diff

LOG: [mlir] Store OperationState property callbacks as function pointers (NFC) (#226083)

The property callbacks never capture state. Store their function
pointers directly instead of wrapping them in function_ref. This improve
slightly MLIR build time and generates slightly smaller binaries.

Assisted-by: Codex

Added: 
    

Modified: 
    mlir/include/mlir/IR/OperationSupport.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 0d94433ef42fc..0a38631fdce03 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -1031,12 +1031,10 @@ struct OperationState {
 
 private:
   /// The deleter and setter are non-null whenever `properties` is, and are
-  /// only called after checking it. Coverity misses this invariant and flags
-  /// the empty `function_ref`s as uninitialized.
-  // coverity[uninit_member]
+  /// only called after checking it.
   PropertyRef properties;
-  llvm::function_ref<void(PropertyRef)> propertiesDeleter;
-  llvm::function_ref<void(PropertyRef, const PropertyRef)> propertiesSetter;
+  void (*propertiesDeleter)(PropertyRef) = nullptr;
+  void (*propertiesSetter)(PropertyRef, const PropertyRef) = nullptr;
   friend class Operation;
 
 public:


        


More information about the Mlir-commits mailing list