-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SIL][DebugInfo] PATCH 3/3: Deprecate debug_value_addr SIL instruciton #39082
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
[SIL][DebugInfo] PATCH 3/3: Deprecate debug_value_addr SIL instruciton #39082
Conversation
@swift-ci please test |
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.
Do we need to be able to parser older serialized SIL and upgrade debug_value_addr to debug_value?
580b7d7
to
7fa55ea
Compare
Are you referring to textual SIL here? Because according to this comment, it seems like we never serialize/deserialize debug_value and debug_value_addr instructions. |
Build failed |
Build failed |
7fa55ea
to
a8beb52
Compare
a8beb52
to
0dca880
Compare
@swift-ci please test |
0dca880
to
58c9e49
Compare
Sorry I messed up in a previous code rebase. |
case SILInstructionKind::DebugValueInst: | ||
if (cast<DebugValueInst>(&I)->hasAddrVal() && | ||
cast<DebugValueInst>(&I)->exprStartsWithDeref()) | ||
requireBitsSet(bits, I.getOperand(0), &I); |
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.
Can you explain what's going in here (and perhaps add a comment to that end)?
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.
oh yeah, I probably should add comments (after current buildbot finish) about this: Originally this code is
case SILInstructionKind::DebugValueAddrInst:
requireBitsSet(bits, I.getOperand(0), &I);
The requireBitsSet
is simply checking if memory pointed by I.getOperand(0)
(which is an address-type SSA value) is initialized or not.
When we're migrating to debug_value
+ op_deref
, the naive refactoring will be:
case SILInstructionKind::DebugValueInst:
if (cast<DebugValueInst>(&I)->hasAddrVal())
requireBitsSet(...);
However, the following SIL snippet will cause requireBitsSet
to raise a verification error:
%a = alloc_stack $Int ...
debug_value %a : $*Int, name ...
Because %a
is not initialized -- but it doesn't need to be initialized, since debug_value
here is used to specify value declaration (i.e. llvm.dbg.declare-alike) rather than value update.
So the current code is basically saying that we're only doing requireBitsSet
if the debug_value
is not used for specifying value declaration, in which case it has op_deref
in its di-expression.
Build failed |
58c9e49
to
65f0a19
Compare
Remove the occurrence of DebugValueAddrInst in libswift. |
65f0a19
to
c29bb1a
Compare
@swift-ci please test |
Build failed |
Build failed |
This new SIL di-expression represents the dereference on the SSA value. Similar to DW_OP_deref in DWARF. It is also going to replace the existing `debug_value_addr`. Namely, replacing the following instruction: ``` debug_value_addr %a : $*T, name "my_var" ``` with this one: ``` debug_value %a : $*T, name "my_var", expr op_deref ```
c29bb1a
to
e09cd4e
Compare
@swift-ci please test |
This patch replace all in-memory objects of DebugValueAddrInst with DebugValueInst + op_deref, and duplicates logics that handles DebugValueAddrInst with the latter. All related check in the tests have been updated as well. Note that this patch neither remove the DebugValueAddrInst class nor remove `debug_value_addr` syntax in the test inputs.
This patch removes all references to DebugValueAddrInst class and debug_value_addr instruction in textual SIL files.
e09cd4e
to
343d842
Compare
Build failed |
@swift-ci please test macos |
I think the current Windows buildbot failure is a false negative since the error was coming from the actor trace rather than some SIL code. I'm kicking off the buildbot one last time before merging this anyway. |
Following up #39065 and #39066 , this patch removes all references to DebugValueAddrInst class and debug_value_addr instruction in textual SIL files.