-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Optimizer: remove the ArrayElementPropagation optimization #77806
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
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
@swift-ci test |
@swift-ci benchmark |
@swift-ci test linux |
1 similar comment
@swift-ci test linux |
This will allow load-simplification to replace a load of such an array.
…ed array Loading array elements or the array's count/capacity can be replaced with the actual value if the array is a statically allocated global let-variable.
It was already handled in the ValueDefUseWalker
30b0c92
to
deceed0
Compare
@swift-ci test |
@swift-ci benchmark |
The comment already says that we need a lower complexity limit for ARCSequenceOpts, but the actual budget was not set correctly to a lower limit.
Propagating array element values is done by load-simplification and redundant-load-elimination. So ArrayElementPropagation is not needed anymore. ArrayElementPropagation also replaced `Array.append(contentsOf:)` with individual `Array.append` calls. This optimization is removed, because the benefit is questionably, anyway. In most cases it resulted in a code size increase.
deceed0
to
63f6a2f
Compare
@swift-ci test |
@swift-ci benchmark |
eeckstein
added a commit
to eeckstein/swift
that referenced
this pull request
Dec 2, 2024
…t.gyb Triggered by swiftlang#77806 rdar://140778726
eeckstein
added a commit
to eeckstein/swift
that referenced
this pull request
Dec 3, 2024
The code is not used anymore because the ArrayElementPropagation pass was removed: swiftlang#77806
andrurogerz
pushed a commit
to andrurogerz/swift
that referenced
this pull request
Dec 3, 2024
The code is not used anymore because the ArrayElementPropagation pass was removed: swiftlang#77806
andrurogerz
pushed a commit
to andrurogerz/swift
that referenced
this pull request
Dec 5, 2024
The code is not used anymore because the ArrayElementPropagation pass was removed: swiftlang#77806
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.
Instead, improve load-simplification and redundant-load-elimination so that those optimizations can do what ArrayElementPropagation did.
Therefore ArrayElementPropagation is not needed anymore.
ArrayElementPropagation also performed a second optimization: replace
Array.append(contentsOf:)
with individualArray.append
calls. But the benefit of this optimization is questionably, anyway. In most cases it resulted in a code size increase. So makes sense to remove it without a replacement.