-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Retain more debug info in optimized builds #85244
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
Conversation
d1aece3 to
53b21e3
Compare
adrian-prantl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
SwiftCompilerSources/Sources/Optimizer/FunctionPasses/TempLValueElimination.swift
Show resolved
Hide resolved
SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift
Outdated
Show resolved
Hide resolved
3faa1e9 to
fb593f4
Compare
| } | ||
| } | ||
|
|
||
| first.salvageDebugInfo(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why this is needed.
The following replace calls erase(instruction:) which itself calls salvageDebugInfo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The replace is for the second instruction, while this salvage is for the first instruction. It should only be necessary in optimized builds, so I'm changing this code. The test for this case is DebugInfo/simplify_struct_extract.sil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, okay
118f114 to
af515fd
Compare
aidan-hall
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one point of confusion
|
@swift-ci smoke test |
1 similar comment
|
@swift-ci smoke test |
af515fd to
9240379
Compare
|
macOS & Windows passed, but Linux had a crash in my new |
|
@swift-ci smoke test linux |
|
@swift-ci smoke test macos |
9d9dcc0 to
8c1debd
Compare
|
@swift-ci smoke test |
|
@swift-ci test windows |
8c1debd to
e80a0f5
Compare
|
@swift-ci smoke test linux |
e80a0f5 to
7e8b65e
Compare
|
@swift-ci smoke test linux |
7e8b65e to
966d4ef
Compare
|
@swift-ci smoke test linux |
|
@swift-ci smoke test |
966d4ef to
7e8b65e
Compare
|
@swift-ci smoke test linux |
7e8b65e to
eb9071c
Compare
|
@swift-ci smoke test |
|
@swift-ci smoke test linux |
|
@swift-ci test |
|
@swift-ci test macos |
|
@swift-ci test windows |
Specifically, improved debug info retention in: * tryReplaceRedundantInstructionPair, * splitAggregateLoad, * TempLValueElimination, * Mem2Reg, * ConstantFolding. The changes to Mem2Reg allow debug info to be retained in the case tested by self-nostorage.swift in -O builds, so we have just enabled -O in that file instead of writing a new test for it. We attempted to add a case to salvageDebugInfo for unchecked_enum_data, but it caused crashes in Linux CI that we were not able to reproduce.
eb9071c to
a95d297
Compare
|
@swift-ci smoke test |
|
The Linux & MacOS validation tests succeeded before that last force-push, which was just a whitespace change to unblock the Windows tests, so we don't need to run those again. |
|
@swift-ci test windows |
3 similar comments
|
@swift-ci test windows |
|
@swift-ci test windows |
|
@swift-ci test windows |
This reverts commit b1eb70b. The original PR (swiftlang#85244) was reverted (swiftlang#85836) due to rdar://165667449 This version fixes the aforementioned issue, and (potentially) improves overall debug info retention by salvaging info in erase(instructionIncludingDebugUses:), rather than inserting many explicit salvageDebugInfo calls throughout the code to make the test cases pass. Bridging: Make salvageDebugInfo a method of MutatingContext This feels more consistent than making it a method of Instruction. DebugInfo: Salvage from trivially dead instructions This handles the case we were checking in constantFoldBuiltin, so we do not need to salvage debug info there any more.
This reverts commit b1eb70b. The original PR (swiftlang#85244) was reverted (swiftlang#85836) due to rdar://165667449 This version fixes the aforementioned issue, and (potentially) improves overall debug info retention by salvaging info in erase(instructionIncludingDebugUses:), rather than inserting many explicit salvageDebugInfo calls throughout the code to make the test cases pass. Bridging: Make salvageDebugInfo a method of MutatingContext This feels more consistent than making it a method of Instruction. DebugInfo: Salvage from trivially dead instructions This handles the case we were checking in constantFoldBuiltin, so we do not need to salvage debug info there any more.
Depends on #85237: Ignore b353bb3 in this PR.