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


##########
src/relax/backend/vm/vm_builtin_lower.cc:
##########
@@ -81,35 +83,59 @@ class VMBuiltinLowerMutator : public ExprMutator {
       }
       return ShapeExpr({ret});
     } else {
-      return Call(builtin_compute_alloc_shape_, {shape, DataTypeImm(dtype)}, 
Attrs(),
-                  {GetStructInfo(shape)});
+      // TODO(@slyubomirsky): Find a way to register these builtins as pure to 
avoid needing to emit
+      // call_pure each time
+      return WrapCallPure(Call(builtin_compute_alloc_shape_, {shape, 
DataTypeImm(dtype)}, Attrs(),
+                               {GetStructInfo(shape)}));

Review Comment:
   An example (one of many) of having to insert `call_pure` because of the use 
of `PackedFunc`s at low levels of compilation.



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