[Mlir-commits] [mlir] [mlir] fix unregistered op's populateInherentAttrs (PR #77718)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jan 10 19:17:47 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-core
Author: Yuanqiang Liu (qingyunqu)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/77718.diff
1 Files Affected:
- (modified) mlir/lib/IR/MLIRContext.cpp (+6-1)
``````````diff
diff --git a/mlir/lib/IR/MLIRContext.cpp b/mlir/lib/IR/MLIRContext.cpp
index 2fd9cac6df3d09..9a001c9539574d 100644
--- a/mlir/lib/IR/MLIRContext.cpp
+++ b/mlir/lib/IR/MLIRContext.cpp
@@ -862,7 +862,12 @@ void OperationName::UnregisteredOpModel::setInherentAttr(Operation *op,
attrs.getDictionary(op->getContext());
}
void OperationName::UnregisteredOpModel::populateInherentAttrs(
- Operation *op, NamedAttrList &attrs) {}
+ Operation *op, NamedAttrList &attrs) {
+ auto dict = dyn_cast_or_null<DictionaryAttr>(getPropertiesAsAttr(op));
+ if (dict) {
+ attrs.append(dict.begin(), dict.end());
+ }
+}
LogicalResult OperationName::UnregisteredOpModel::verifyInherentAttrs(
OperationName opName, NamedAttrList &attributes,
function_ref<InFlightDiagnostic()> emitError) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/77718
More information about the Mlir-commits
mailing list