tqchen commented on code in PR #16067:
URL: https://github.com/apache/tvm/pull/16067#discussion_r1383432921


##########
src/relax/analysis/well_formed.cc:
##########
@@ -301,13 +302,38 @@ class WellFormedChecker : public relax::ExprVisitor,
       }
     }
 
-    for (const StructInfo& sinfo_arg : op->sinfo_args) {
+    for (const StructInfo& sinfo_arg : call->sinfo_args) {
       this->VisitStructInfo(sinfo_arg);
     }
 
-    CheckStructInfo(op);
-    if (is_dataflow_ && check_struct_info_ && IsImpureCall(GetRef<Call>(op))) {
-      Malformed(Diagnostic::Error(op) << "There cannot be an impure call 
inside a dataflow block.");
+    CheckStructInfo(call);
+    if (is_dataflow_ && check_struct_info_ && 
IsImpureCall(GetRef<Call>(call))) {
+      Malformed(Diagnostic::Error(call)
+                << "There cannot be an impure call inside a dataflow block.");
+    }
+
+    // If the operation has defined a custom normalization function
+    // using the FNormalize attribute, the call node must be normalized in 
order to be well-formed.

Review Comment:
   While this is general. It also comes with overhead of creating a 
BlockBuilder.
   
   Instead, it is useful to explicitly spell out the constraints of the related 
ops. e.g. call_tir do not allow recursive Tuple and we chekc that condition.
   
   This would also add an extra layer of safeguard of FNormalize



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