zhuwenxi commented on issue #7246:
URL: https://github.com/apache/tvm/issues/7246#issuecomment-783849908


   > Possible way to resolve the issue:
   > 
   > * Introduce the packed_arg_alloca intrinsic that is only gauranteed to be 
valid for the specific packed func call
   >   
   >   * Skip the lifting alloca step, and keep alloca always next to the func 
call
   > * Update LLVM codegen to insert alloca always to the beginning of the 
current function block
   > * Update StackVM and C codegen to support things accordingly
   
   @tqchen , I have a few questions about the implementation detail of your 
proposal. That is:
   
   1. What is the detailed definition or semantic of `packed_arg_alloca` 
intrinsic, and how to guarantee it is valid only for the specific packed func 
call?
       How does the generated tir look like? Something like:
       `let stack_1 = @tir.packed_arg_alloca(...)` 
       `tir.tvm_call_packed_lowered("tvm.contrib.cblas.matmul", stack_1)`
       `let stack_2 = @tir.packed_arg_alloca(...)`
       `tir.tvm_call_packed_lowered("tvm.contrib.cblas.matmul", stack_2)`
   2. How does "insert alloca always to the beginning of the current function 
block" work?  
       According to my understanding, stack is used to communicate parameters 
between caller and callee, so it is definitely required to be allocated & 
assigned parameters at the call-site. Allocating stack at the beginning of a 
function does not make sense according to my point of view. Could you further 
explain this a little bit more?  


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


Reply via email to