Lunderberg commented on code in PR #14185:
URL: https://github.com/apache/tvm/pull/14185#discussion_r1124541359


##########
include/tvm/tir/analysis.h:
##########
@@ -86,6 +87,58 @@ TVM_DLL double EstimateTIRFlops(const Stmt& stmt);
  */
 TVM_DLL double EstimateTIRFlops(const IRModule& mod);
 
+/*!
+ * \brief Visitor class to perform use/def analysis, also delete unreferenced 
lets.
+ * \sa UndefinedVars
+ */
+class VarUseDefAnalyzer : public StmtExprMutator {

Review Comment:
   Though, could we inherit from `StmtExprVisitor` instead of 
`StmtExprMutator`?  The only modification done is the deletion of unreferenced 
lets, but that really feels like something that should be part of the 
`RemoveNoOp` pass.



##########
include/tvm/tir/analysis.h:
##########
@@ -86,6 +87,58 @@ TVM_DLL double EstimateTIRFlops(const Stmt& stmt);
  */
 TVM_DLL double EstimateTIRFlops(const IRModule& mod);
 
+/*!
+ * \brief Visitor class to perform use/def analysis, also delete unreferenced 
lets.
+ * \sa UndefinedVars
+ */
+class VarUseDefAnalyzer : public StmtExprMutator {

Review Comment:
   Though, could we inherit from `StmtExprVisitor` instead of 
`StmtExprMutator`?  The only modification done is the deletion of unreferenced 
lets, but that really feels like something that should be part of the 
`RemoveNoOp` pass rather than an analysis pass.



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