hypercubestart commented on a change in pull request #5812:
URL: https://github.com/apache/incubator-tvm/pull/5812#discussion_r465419081
##########
File path: src/tir/transforms/lower_custom_datatypes.cc
##########
@@ -97,6 +97,29 @@ class CustomDatatypesLowerer : public StmtExprMutator {
return expr;
}
+ inline PrimExpr VisitExpr_(const CallNode* call) final {
+ // I'm actually unsure as to what makes sense when lowering a call of a
custom datatype.
+ bool toBeLowered =
datatype::Registry::Global()->GetTypeRegistered(call->dtype.code());
+ PrimExpr expr = StmtExprMutator::VisitExpr_(call);
+ call = expr.as<CallNode>();
+ if (toBeLowered) {
+ CHECK(call->call_type == CallNode::Intrinsic || call->call_type ==
CallNode::PureIntrinsic)
+ << "Lowering non-intrinsic Calls not implemented";
+ auto lower = datatype::GetIntrinLowerFunc(target_, call->name,
call->dtype.code());
+ CHECK(lower) << "Intrinsic lowering function for target " << target_ <<
", intrinsic name "
+ << call->name << ", type " <<
static_cast<unsigned>(call->dtype.code())
+ << " not found";
+ return (*lower)(expr);
+ // TODO(gus) Not sure what to do in any other case.
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]