Update built-in pass managers (followup of #11448)#11494
Closed
nkanazawa1989 wants to merge 1 commit into
Closed
Conversation
Collaborator
|
One or more of the the following people are requested to review this:
|
Contributor
Author
|
Blocked by #11448 |
Pull Request Test Coverage Report for Build 7580069842
💛 - Coveralls |
1cf1993 to
dfc3f76
Compare
Member
|
Sorry I didn't get to this sooner. Since it's just an internal code refactor, it's eligible for 1.1 and I'll defer it til then. |
Contributor
|
Thanks a lot for opening this PR @nkanazawa1989, unfortunately, I believe that the code base has diverged quite a bit from the original state that was considered in this PR. I will close it for backlog managing purposes. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is a followup of #11448 to keep logical change minimum. This PR overhauls built-in pass managers.
PassManager.appendpattern is almost removed from them since this is no longer necessary.Details and comments
PassManager can be instantiated with predefined pass sequence even though they include conditional or do-while controllers as follows
The append pattern may be necessary when the pipeline changes with some condition (conditional branching):
In principle this can be also updated by introducing something like
IfElseController. ThenPassManager.appendcan be also dropped like flow controllers. However this is not the scope of this PR.In addition, some inefficiency is removed with this PR. In the current code, following pattern is often used
this implicitly builds new instance instead of mutating the original instance, thus it always comes with extra memory overhead (the original instance is discarded by GC though).