slyubomirsky commented on PR #14183:
URL: https://github.com/apache/tvm/pull/14183#issuecomment-1458925793

   It would not always be possible to check statically that the operand to 
`call_tir` is a `PrimFunc`. Here is a case where it wouldn't work:
   
   ```python
   @R.function
   def higher_order(f: R.Object) -> R.Object:
       return R.call_tir(f, ...)
   
   @R.function
   def g() -> R.Object:
       if some_condition:
           y = some_packed_func
       else:
           y = some_primfunc
       return higher_order(y)
   ```
   
   We would not be able to determine statically that the call to `higher_order` 
in `g` will result in a non-`PrimFunc` being passed to `call_tir`. If we care 
about enforcing the distinction, we would have to check for such cases 
dynamically.


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