未验证 提交 84ec8092 编写于 作者: Z zhangbo9674 提交者: GitHub

[IR] Refine Int64 attribute translator logic (#56842)

* fix bug

* fix bug
上级 0d081357
......@@ -176,6 +176,16 @@ class Int64ArrayAttributeVisitor : public AttributeVisitor {
}
};
class Int64AttributeVisitor : public AttributeVisitor {
public:
using AttributeVisitor::AttributeVisitor;
ir::Attribute operator()(int is) override {
VLOG(10) << "translating int to Int64Attribute";
return ir::Int64Attribute::get(ctx, is);
}
};
class IntArrayAttributeVisitor : public AttributeVisitor {
public:
using AttributeVisitor::AttributeVisitor;
......@@ -229,6 +239,7 @@ AttributeTranslator::AttributeTranslator() {
new PlaceAttributeVisitor();
special_visitors["ir::ArrayAttribute<ir::Int64Attribute>"] =
new Int64ArrayAttributeVisitor();
special_visitors["ir::Int64Attribute"] = new Int64AttributeVisitor();
}
ir::Attribute AttributeTranslator::operator()(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册