zhuwenxi commented on a change in pull request #7619:
URL: https://github.com/apache/tvm/pull/7619#discussion_r594922540
##########
File path: src/tir/transforms/lower_tvm_builtin.cc
##########
@@ -307,19 +393,37 @@ class BuiltinLower : public StmtExprMutator {
std::vector<Stmt> prep_seq_;
PrimExpr device_type_;
PrimExpr device_id_;
- // Var handle for each stack.
Var stack_shape_;
Var stack_array_;
Var stack_tcode_;
Var stack_value_;
+
+ // Mark the occurence of tvm_stack_make_shape of current stmt:
+ // 1. Set to true when the first tvm_stack_make_shape is met;
+ // 2. Reset to false at the end of VisitStmt();
+ bool emit_stack_shape_{false};
+
+ // Mark the occurence of tvm_stack_make_array of current stmt:
+ // 1. Set to true when the first tvm_stack_make_array is met;
+ // 2. Reset to false at the end of VisitStmt().
+ bool emit_stack_array_{false};
+
+ // Mark the occurence of tvm_call_packed of current stmt:
+ // 1. Set to true when tvm_call_packed intrinsic is met;
+ // 2. Reset to false at the end of VisitStmt().
+ bool emit_stack_value_tcode_{false};
+
// The running statistics
int64_t run_shape_stack_{-1};
uint64_t run_array_stack_{0};
uint64_t run_arg_stack_{0};
// statistics of stacks
int64_t max_shape_stack_{-1};
uint64_t max_array_stack_{0};
- uint64_t max_arg_stack_{0};
Review comment:
And for a non-parallel loop, we still need to provide a shared stack at
root, so anyway "max_arg_stack" should be kept, right?
----------------------------------------------------------------
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]