slyubomirsky commented on code in PR #15689: URL: https://github.com/apache/tvm/pull/15689#discussion_r1393367489
########## include/tvm/relax/analysis.h: ########## @@ -404,6 +404,18 @@ TVM_DLL Map<Var, Array<Var>> DataflowBlockUseDef(const DataflowBlock& dfb); */ std::pair<Map<Var, Array<Var>>, Array<Var>> FunctionUseDef(const Function& fn); +/*! + * \brief Perform a liveness analysis on the function, indicating which variables + * are live at which location in the function. + * + * \param fn The function to be analyzed. + * \return An array of arrays of live variables per binding in the function. + * The array is indexed based on the corresponding control flow graph, + * so use `ExtractCFG` and `GetBindingIndex` to match locations in `fn` + * to indices in the result. + */ +Array<Array<Var>> LivenessAnalysis(const Function& fn); Review Comment: Good idea, I'll see about trying it. -- 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]
