[DebugInfo] Salvage ref_tail_addr#90022
Open
Snowy1803 wants to merge 6 commits into
Open
Conversation
Member
Author
|
@swift-ci test |
As mentioned in the comment, the DIExpr is present for easily moving debug info. The same variable with different DIExpr still refer to the same variable. The only pass using SILDebugVariable as a DenseMap key, is only run at -Onone, so its handling of fragments isn't needed. The fragment handling didn't even work, as the DIExpr didn't have an equality operator, so only its existence (via the bool() operator) was compared, not its content.
If a debug_value is being salvaged through a lifetime-ending instruction, the salvaged operand will be invalid and cause an ownership error. In that case, hoist the debug_value to be where the salvaged instruction was. If a debug_value for the same variable exists between both locations, the hoist is not legal: kill the operand instead.
The lifetime of guaranteed values is tied to the original borrow, not to the operand which might be a projection.
2cf8253 to
cceb87e
Compare
Member
Author
|
@swift-ci test |
Member
Author
|
@swift-ci test macOS platform |
3 similar comments
Member
Author
|
@swift-ci test macOS platform |
Member
Author
|
@swift-ci test macOS platform |
Member
Author
|
@swift-ci test macOS platform |
The value being borrowed has always a longer lifetime than the borrow, so this allows more debug values to be successfully salvaged rather than killed if the borrow ends before the debug_value.
Accounts for 1.6% of missing salvages in the Source Compatibility Test Suite.
cceb87e to
b9579f0
Compare
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.
Based on #89692
Accounts for 1.6% of missing salvages in the Source Compatibility Test Suite.
Decreases lost variables in stdlib by 0.2% and increases variables with location at DWARF level by 0.02%.
Tail elements are used by arrays to store values inline, so this is necessary for code making heavy use of arrays.