forked from neo-ai/tvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IR] Unify approach to Visitor/Mutator under Functor (apache#4606)
IRMutator and IRVisitor were the main data structures for doing low level IR visiting. As the project evolves, we start to introduce more powerful variants such as StmtFunctor and ExprFunctor. This PR brings new classes that allows us to migrate the visitor mutator to be sub-class of these functors. List of changes: - Create separate class for ExprMutator and StmtMutator, following convention used in relay. - Introduce copy-on-write to StmtMutator that can later benefit the statement mutations if we use move semantics and keep a single copy of stmt. - Move two generic visit mutate util to use the new classes. We will send followup PRs to migrate the existing passes that use the legacy visitors to the new one.
- Loading branch information
Showing
7 changed files
with
1,112 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.