Skip to content

[silcombine] (store (struct_gep addr) value) -> (store addr (struct v… #21791

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

gottesmm
Copy link
Contributor

…alue)) for single field structs.

@gottesmm
Copy link
Contributor Author

@swift-ci test

@gottesmm gottesmm force-pushed the pr-5a4e17411328a11ec4d37cc30ead812b7087badf branch from 98f033a to 632ddd5 Compare January 11, 2019 07:47
@jrose-apple
Copy link
Contributor

As an observer, can I ask why the new pattern is better than the old one?

@gottesmm
Copy link
Contributor Author

@jrose-apple Semantically the two are equivalent. The difference is that at an optimizer level it is easier to promote from further up the type tree to a lower level of the type tree vs promoting from a lower level of the type tree to an upper level of the type tree. Generally the former is possible and the other is not. This PR changes the only case where it is possible to promote an available value of field in a type tree to an available value of the parent type (namely where one where all of the struct fields are single element) to one that most passes handle, the other.

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jrose-apple
Copy link
Contributor

Thanks for the explanation!

@gottesmm gottesmm force-pushed the pr-5a4e17411328a11ec4d37cc30ead812b7087badf branch from 632ddd5 to 556001a Compare January 11, 2019 20:19
@gottesmm gottesmm force-pushed the pr-5a4e17411328a11ec4d37cc30ead812b7087badf branch from 556001a to cf43a93 Compare January 11, 2019 20:23
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm gottesmm merged commit e8a6646 into swiftlang:master Jan 11, 2019
@gottesmm gottesmm deleted the pr-5a4e17411328a11ec4d37cc30ead812b7087badf branch January 11, 2019 21:53
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.

5 participants