[Mlir-commits] [mlir] [mlir] fix unregistered op's populateInherentAttrs (PR #77718)
Yuanqiang Liu
llvmlistbot at llvm.org
Wed Jan 10 19:17:21 PST 2024
https://github.com/qingyunqu created https://github.com/llvm/llvm-project/pull/77718
None
>From 33b3c035f375f6ffba93b9883e660f841baaed95 Mon Sep 17 00:00:00 2001
From: LiuYuanqiang <liuyuanqiang.yqliu at bytedance.com>
Date: Thu, 11 Jan 2024 11:10:08 +0800
Subject: [PATCH] [mlir] fix unregistered op's populateInherentAttrs
---
mlir/lib/IR/MLIRContext.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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) {
More information about the Mlir-commits
mailing list