[Mlir-commits] [mlir] [mlir] Create an accessor for the operation name in `OperationState` (PR #82489)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Feb 21 05:07:55 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
@llvm/pr-subscribers-mlir
Author: Fabian Mora (fabianmcg)
<details>
<summary>Changes</summary>
This accessor provides helpful introspection when building an operation. For example, it allows access to the dialect used to create the operation, which might provide extra context for building an operation.
---
Full diff: https://github.com/llvm/llvm-project/pull/82489.diff
1 Files Affected:
- (modified) mlir/include/mlir/IR/OperationSupport.h (+3)
``````````diff
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index f2aa6cee840308..3bde71bd3938fa 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -1058,6 +1058,9 @@ struct OperationState {
/// Get the context held by this operation state.
MLIRContext *getContext() const { return location->getContext(); }
+
+ /// Get the operation name held by this operation state.
+ OperationName getOperationName() const { return name; }
};
//===----------------------------------------------------------------------===//
``````````
</details>
https://github.com/llvm/llvm-project/pull/82489
More information about the Mlir-commits
mailing list