-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[4.0] [sil-combine] Make sure that (apply (partial_apply)) -> (apply') bail… #11261
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
[4.0] [sil-combine] Make sure that (apply (partial_apply)) -> (apply') bail… #11261
Conversation
…s if we have an argument with a dependent type. What is going on here is that currently this optimization if itneeds to perform lfietime extension always creates an alloc_stack at the beginning/end of a function. If the object whose lifetime is being extended has a dependent type, then the alloc_stack will be created before the dependent type exists resulting in the compiler crashing. rdar://33595317
@swiftix Can I get a review? |
@swift-ci test |
Build failed |
Build failed |
I don't think that this is from my change. |
It is a typechecker error. Just out of paranoia I am going to try compiling again, this time clean maybe? |
@swift-ci clean test |
1 similar comment
@swift-ci clean test |
Build failed |
Build failed |
@swiftix I took a look at the bots. It looks like swift-4.0-branch is broken: https://ci.swift.org/view/swift-4.0-branch/job/oss-swift-4.0-incremental-RA-osx/ Since here: https://ci.swift.org/view/swift-4.0-branch/job/oss-swift-4.0-incremental-RA-osx/863/ |
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.
LGTM!
@swift-ci test |
Mishal said that the problem here is fixed. |
Explanation: This small patch stops the optimizer from transforming (apply (partial-apply)) -> (apply') when the partial apply: 1. has an address argument that needs to be lifetime extended. 2. Uses a dependent type. In such a situation, the currently the implemented algorithm would create stack locations at the beginning and end of the function to lifetime extend the address arguments. Since the type parameter does not exist at that point, and the compiler needs the type parameter to create the stack location, the compiler crashes. |
Approved by Ted via email. |
…s if we have an argument with a dependent type.
What is going on here is that currently this optimization if itneeds to perform
lfietime extension always creates an alloc_stack at the beginning/end of a
function. If the object whose lifetime is being extended has a dependent type,
then the alloc_stack will be created before the dependent type exists resulting
in the compiler crashing.
rdar://33595317