-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[LifetimeCompletion] Avoid instruction list walk. #76095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nate-chandler
merged 6 commits into
swiftlang:main
from
nate-chandler:lifetime-completion/20240826/1
Aug 30, 2024
Merged
[LifetimeCompletion] Avoid instruction list walk. #76095
nate-chandler
merged 6 commits into
swiftlang:main
from
nate-chandler:lifetime-completion/20240826/1
Aug 30, 2024
Conversation
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
Specifically, those pertaining to lifetime completion.
PrunedLiveness records users and their lifetime-ending-ness. Make this available to clients by way of a visitor.
To enable those clients which care only about _blocks_ whose instructions or dead-defs make up the liveness boundary to avoid iterating instruction lists, enhance boundary computation with a second type (`PrunedLivenessBlockBoundary`) and migrate some methods from liveness onto the boundary types to enable dispatching on the boundary type to do only the amount of analysis that's necessary.
When computing the available region, a forward walk is done from the non-lifetime-ending boundary of the live region. That boundary consists of (1) the target blocks of boundary edges, (2) dead defs, and (3) last users which are non-consuming. This forward walk is done at the block level, so neither the specific dead def (for (2)) nor specific last non-consuming user (for (3)) is required to perform the walk; indeed currently these are computed and then immediately used only to obtain the blocks in which they appear and then discarded. Avoid computing the specific dead defs and specific last non-consuming users by switching to a lower-fidelity liveness boundary computation via `PrunedLivenessBlockBoundary`.
Now that the compile time regressions observed in rdar://132552637 are fixed, enable completion of lifetimes during the SILGenCleanup.
@swift-ci please test |
@swift-ci please apple silicon benchmark |
@swift-ci please test source compatibility |
preset=buildbot_osx_package |
preset=buildbot,tools=RA,stdlib=RDA,long_test |
preset=buildbot_incremental_linux,long_test |
@swift-ci please test |
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.
When computing the available region, a forward walk is done from the non-lifetime-ending boundary of the live region. That boundary consists of (1) the target blocks of boundary edges, (2) dead defs, and (3) last users which are non-consuming. This forward walk is done at the block level, so neither the specific dead def (for (2)) nor specific last non-consuming user (for (3)) is required to perform the walk; indeed currently these are computed and then immediately used only to obtain the blocks in which they appear and then discarded. Avoid computing the specific dead defs and specific last non-consuming users by switching to a lower-fidelity liveness boundary computation via
PrunedLivenessBlockBoundary
.