Skip to content

[ome] Eliminate inefficiencies in lowering of destructures to ensure -Onone output stays the same. #22506

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

Conversation

gottesmm
Copy link
Contributor

This is just fixing a few inefficiencies so that -Onone code output stays the same [and I can avoid needing to update certain tests ; )]. Specifically:

  1. We only emit projections if a destructure's result is actually used. (Before we eagerly emitted).
  2. If we do insert a projection, we try to simplify the projection. This is a quick, stateless check that seems to eliminate unnecessary aggregate formation in -Onone output.

…e projections for used results.

This is not technically necessary, but it eliminates some differences in the
tests at -Onone.
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test

@gottesmm
Copy link
Contributor Author

I investigated the failure here. We are just emitting better code due to the simplification (specifically we are eliminating an unnecessary tuple_extract). I am going to update the test.

@gottesmm
Copy link
Contributor Author

(and put in a better pattern that is more descriptive about what is happening in the test)

…possible.

I noticed that this is needed at -Onone to maintain the same codegen output.
@gottesmm gottesmm force-pushed the pr-1976b9749f89a8476a3c2744d1c8e2a758c40fdf branch from cf86dea to 89a447a Compare February 11, 2019 19:53
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

2 similar comments
@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 3f54a46 into swiftlang:master Feb 11, 2019
@gottesmm gottesmm deleted the pr-1976b9749f89a8476a3c2744d1c8e2a758c40fdf branch February 11, 2019 20:42
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.

2 participants