Skip to content

[capture-promotion] When checking if a (struct_element_addr (project_box box)) is written to, check that all of the operands are loads, instead of returning early when we find one. #10270

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

Merged
merged 1 commit into from
Jun 15, 2017

Conversation

gottesmm
Copy link
Contributor

[capture-promotion] When checking if a (struct_element_addr (project_box box)) is written to, check that all of the operands are loads, instead of returning early when we find one.

I found this bug by inspection.

This is an important bug to fix since this pass runs at -Onone and the bug
results in the compiler hitting an unreachable.

The way the unreachable is triggered is that when we detect that we are going to
promote a box, if we see a (struct_element_addr (project_box box)), we don't map
the struct_element_addr to a cloned value. If we have a load, this is not an
issue, since we are mapping the load to the struct_extract. But if we have /any/
other non-load users of the struct_element_addr, the cloner will attempt to look
up the struct_element_addr and will be unable to find it, hitting an
unreachable.

rdar://32776202

…box box)) is written to, check that all of the operands are loads, instead of returning early when we find one.

I found this bug by inspection.

This is an important bug to fix since this pass runs at -Onone and the bug
results in the compiler hitting an unreachable.

The way the unreachable is triggered is that when we detect that we are going to
promote a box, if we see a (struct_element_addr (project_box box)), we don't map
the struct_element_addr to a cloned value. If we have a load, this is not an
issue, since we are mapping the load to the struct_extract. But if we have /any/
other non-load users of the struct_element_addr, the cloner will attempt to look
up the struct_element_addr and will be unable to find it, hitting an
unreachable.

rdar://32776202
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@shahmishal Sorry. Forgot that you were updating the CI!

@shahmishal
Copy link
Member

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 63a9905 into swiftlang:master Jun 15, 2017
@gottesmm gottesmm deleted the rdar32776202 branch June 15, 2017 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants