yzh119 commented on code in PR #14161:
URL: https://github.com/apache/tvm/pull/14161#discussion_r1122725090


##########
src/tir/schedule/primitive/cache_read_write.cc:
##########
@@ -1297,6 +1603,317 @@ StmtSRef CacheWrite(ScheduleState self, const StmtSRef& 
block_sref, int write_bu
   return result_block_sref;
 }
 
+/*! \brief A visitor that collects variables appeared in expressions, stored 
in `touched` field.*/
+class VarCollector : public ExprVisitor {

Review Comment:
   `UndefinedVars` only accepts `Stmt`/`Expr` as inputs while `BufferRegion` 
does not belong to any of them. Actually, we can use it in our case by calling 
`UndefinedVars` on each of the `range->min` and merge those results but 
apparently, it's not elegant. `UndefinedVars` depends on `VarUseDefAnalaysis`, 
and using this visitor would be much more convenient.
   
   `VarUseDefAnalysis` resides in `split_host_device.cc` which is not exposed 
in headers. I wonder would you mind me refactoring the code to expose it in 
some header like `analysis.h`?



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