[Refactor] Move VarUseDefAnalysis to header file#14185
[Refactor] Move VarUseDefAnalysis to header file#14185Hzfengsy merged 11 commits intoapache:mainfrom
VarUseDefAnalysis to header file#14185Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
@Hzfengsy @Lunderberg @tqchen I have decoupled the previous
I know this class has been used for long time and we don't want any changes on its behavior, so we need to be careful in this refactor, and please correct me if I made any mistakes. One thing I'm not sure is if we need to couple the three functionalities together in a single pass, or we can decouple them like what I did in the refactor. If my refactor doesn't work, I'm totally okay if we keep the original class and create a simpler |
Lunderberg
left a comment
There was a problem hiding this comment.
LGTM! Just a couple of small nitpicks.
|
cc @Hzfengsy please take another look and manage the PR |
Motivation
UndefinedVarsis a frequently used function in our codebase and its implementation relies onVarUseDefAnalysisclass which is more general, currently we exposeUndefinedVarsinanalysis.h, but both the definitions ofUndefinedVarsandVarUseDefAnalysisresides insplit_host_device.cc.This PR moves
VarUseDefAnalysisclass toanalysis.hso that developers can use it in other files that requires use/def analysis thansplit_host_devices.cc. We create avar_use_def_analysis.ccundersrc/src/analysisfor the implementations of bothUndefinedVarsandVarUseDefAnalysis.Notes
We rename
VarUseDefAnalysistoVarUseDefAnalyzer.cc @Hzfengsy @Lunderberg