slyubomirsky commented on code in PR #14183:
URL: https://github.com/apache/tvm/pull/14183#discussion_r1128866691


##########
src/relax/analysis/well_formed.cc:
##########
@@ -260,6 +261,19 @@ class WellFormedChecker : public relax::ExprVisitor,
       }
     }
 
+    // call_tir works for tir PrimFunc, call_dps_packed works for ExternFunc
+    static const Op& call_tir_op = Op::Get("relax.call_tir");
+    static const Op& call_dps_packed_op = Op::Get("relax.call_dps_packed");
+    if (op->op == call_tir_op && !op->args[0]->IsInstance<GlobalVarNode>()) {
+      Malformed(Diagnostic::Error(op->args[0]->span)
+                << "call_tir expects a prim_func, but gets " << 
op->args[0]->GetTypeKey());
+    }

Review Comment:
   As mentioned in the community meeting, we can enforce this in the 
`FInferStructInfo` for `call_tir` and not need any special cases in the 
well-formedness check.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to