-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Rename dealloc_ref [stack]
and enable StackPromotion for OSSA
#40738
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
@swift-ci test |
@swift-ci benchmark |
Performance (x86_64): -OCode size: -OPerformance (x86_64): -Osize
Code size: -OsizePerformance (x86_64): -OnoneCode size: -swiftlibsHow to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
Meghana fixed this here, then closed the PR:
If we care about the SIL making sense, then it would look like this:
After devirtualization:
The OSSA lifetime utilities might end up working in practice if Regardless, |
I though about the two-return-value variant of alloc_ref [stack], too. But this would be a massive change and would complicate many other parts of the SIL and optimizer. IMO we don't have to over-engineer this. @atrick what do you think of |
That's a reasonable position. We shouldn't block forward progress on doing that work.
Yes, that's fine! I'm also fine with just adding a property to dealloc_stack that can be checked by the code that searches for Then we'd have (1) (2) Has exactly same issue as #1. Just a bit more explicit |
The verifier checked for `isTypeDependentOperand()` (which was the only NonUse operand case we had so far) instead of OperandOwnership::NonUse.
6c7f4c7
to
00301de
Compare
@swift-ci smoke test |
Introduce a new instruction `dealloc_stack_ref ` and remove the `stack` flag from `dealloc_ref`. The `dealloc_ref [stack]` was confusing, because all it does is to mark the deallocation of the stack space for a stack promoted object.
00301de
to
802d11a
Compare
@swift-ci smoke test |
1 similar comment
@swift-ci smoke test |
The blocker for enabling StackPromotion for OSSA was that the ownership of
dealloc_ref [stack]
was wrong. It should haveNonUse
ownership, because it's just an end-of-lifetime marker for analloc_ref [stack]
.Also, the instruction syntax
dealloc_ref [stack]
is very confusing, because it does not do anything like a deallocation.It's renamed to
dealloc_stack_ref
, which better describes its purpose.Renaming means: removed the
[stack]
flag fromdealloc_ref
and introduced a new instructiondealloc_stack_ref
(with correct operand ownership ofNonUse
)