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


##########
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:
   I agree, the collected variable definitions may be useful in a lot of cases. 
 Exposing the visitor itself also allows for analyzing multiple expressions, 
then examining variables that are undefined in any of them.  I'm wondering if 
there's a tighter API that we'd want to expose, but nothing is coming to mind.



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