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
[CapturePromotion] Preserve DebugInfo when creating project_box. #13802
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.
This LGTM, thanks!
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.
Side-note: Swift frontend folks have already claimed the "DI" namespace for "definite initialization", better spell out debug info :-)
test/SILOptimizer/sr6709.swift
Outdated
// CHECK: sil hidden @_T04null19captureStackPromoteSiycyF : $@convention(thin) () -> @owned @callee_guaranteed () -> Int { | ||
// CHECK: bb0: | ||
// CHECK: %0 = alloc_box ${ var Int }, var, name "x", loc {{.*}}:32:7, scope 3 // users: %19, %7, %1 | ||
// CHECK: %1 = project_box %0 : ${ var Int }, 0, loc {{.*}}:32:7, scope 3 // users: %9, %6 |
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.
Leaving the comments in the CHECK lines is probably just asking for trouble. I would remove them.
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'll update this :)
Nice. Just idly curious -- what are the general guidelines when deciding whether to pick SILBuilder or SILBuilderWithScope? Do you only want the former for SIL that isn't meant to be debugged? |
You want to use SILBuilder when you are creating new code from scratch. |
When you are using SILBuilder you have to make sure to manually set a meaningful SILDebugScope. |
The code was assigning an incorrect lexical scope, which was responsible for an hole (and likely, wrong DI at `-Onone` in some cases). Fixes SR-6709.
Addressed Adrian's comments. Thanks! |
@swift-ci please test |
Build failed |
Build failed |
@dcci can you give a more descriptive name to the test file or even better just add this to the capture promotion test? |
@gottesmm I'd prefer to keep this one separate. What about |
Also simplify check lines and rename the test to be more descriptive. Thanks to Adrian and Michael for pointing out.
@swift-ci please test |
Build failed |
Build failed |
@dcci Why do you want it to be separate? Couldn't you make the capture promotion test correct in this way. Then when people make changes to CapturePromotion, you get more verification for free. |
I don't get the "you can't make the test correct in this way". |
Another reason to keep this test separate is that it's very sensitive to line informations. |
I and Michael chatted about this offline a bit. |
The code was assigning an incorrect lexical scope, which was
responsible for an hole (and likely, wrong DI at
-Onone
in somecases).
Fixes SR-6709.