-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Debuginfo] Small fixes #73009
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] Small fixes #73009
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.
Changes look a ll good to me, it would be nice to add some tests though, if possible.
The source location for the variable should be the value in VarInfo if set, otherwise it should use the location of the instruction. Both ways should be consistent, and as we use column number if VarInfo is set, we have to do it if isnt, too.
SILBuilderWithScope ignores the scope of the debug value and uses the scope of the next real instruction. We want to preserve the scope of the original debug value, so we pass it explicitly.
7623a5d
to
06d39a2
Compare
Salvage Debug Info was only being called for simplifications, and not for function passes written in Swift. Salvage Debug Info is now called for both cases.
06d39a2
to
4a543c8
Compare
@swift-ci please smoke test |
bb0: | ||
%0 = alloc_stack $Int, var, name "a" | ||
%1 = integer_literal $Builtin.Int64, 1 | ||
%2 = struct $Int (%1 : $Builtin.Int64) |
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 test will probably not work on 32-bit platforms. Could you rewrite it to hardcode an Int32?
// CHECK: @llvm.dbg.declare(metadata ptr | ||
// CHECK-SAME: metadata ![[VAR_DI:[0-9]+]] | ||
// CHECK-SAME: ), !dbg ![[LOC_DI:[0-9]+]] | ||
debug_value %0 : $Builtin.Int64, var, name "x", loc "simple.swift":1:16, scope 2 |
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 test is fine!
@swift-ci test |
Well, test/SILOptimizer/dead_store_elim.sil seems to pass the bots and does this, so this isn't any worse. |
This PR includes multiple small fixes, necessary for a bigger change.
With those changes, there are 0.06% less variables lost at the SIL level. It does not change the number of variables in the final binary.