-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DebugInfo] PATCH 2/3: Duplicate logics regarding debug_value_addr #39066
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
[DebugInfo] PATCH 2/3: Duplicate logics regarding debug_value_addr #39066
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.
Thanks for all the hard work!
There is one somewhat important comment in visitDebugValue() that I'd like to address before moving forward.
lib/IRGen/IRGenSIL.cpp
Outdated
// utility function to drop it? | ||
assert(VarInfo && VarInfo->DIExpr); | ||
auto &DIExpr = VarInfo->DIExpr; | ||
DIExpr.eraseElement(DIExpr.element_begin()); |
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 looks backwards. We should never emit a debug_value allocstack, op_deref
in SILGen/SILOpt instead of unconditionally stripping the operand here.
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.
You're right, I forgot to change LoadableByAddress to teach it not to attach op_deref if the value is loadable by address.
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.
just a FYI of how I fixed it: Instead of changing LoadableByAddress Pass, I simply change SILBuiler to teach it not to generate op_deref
for debug_value if the SILValue is alloc_stack.
3292da9
to
75d430e
Compare
@swift-ci please test |
75d430e
to
9cad58f
Compare
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 ```
9cad58f
to
d7a9830
Compare
Update test case |
Build failed |
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.
d7a9830
to
e1023bc
Compare
Update a test case in SILOptimizer that hasn't kept up with the previous change of not generating |
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 is a PR only for code review. DO NOT MERGE.