Skip to content

Run more function passes in a single run of the pass manager. #1627

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
Mar 11, 2016
Merged

Run more function passes in a single run of the pass manager. #1627

merged 1 commit into from
Mar 11, 2016

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Mar 10, 2016

What's in this pull request?

An improvement to the pass pipeline that reduces execution time while potentially improving generated code.

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

This commit moves the SILLinker pass out of AddSSAPasses, so that we run
more function passes on each function before moving up to it's callers.

Now the only remaining module passes in AddSSAPasses are GlobalOpt and
LetPropertiesOpt, which run only when we call AddSSAPasses for the
MidLevel optimizations.

This commit also adds the high level loop opt passes onto the same pass
run. As a result of this and moving SILLinker out of AddSSAPasses, we
now run far more passes together on a given function before moving up
the call graph to the callers.

The net result is that I am now seeing approximately a 2% reduction in
stdlib compile times, with only a single significant performance
regression (there are some other minor improvements and regressions, and
some major improvements with -Ounchecked).

The 2% reduction appears to come largely from the mechanism in the pass
manager that skips running passes if we've not made any changes to a
function since the last time the pass was run.

This commit moves the SILLinker pass out of AddSSAPasses, so that we run
more function passes on each function before moving up to it's callers.

Now the only remaining module passes in AddSSAPasses are GlobalOpt and
LetPropertiesOpt, which run only when we call AddSSAPasses for the
MidLevel optimizations.

This commit also adds the high level loop opt passes onto the same pass
run. As a result of this and moving SILLinker out of AddSSAPasses, we
now run far more passes together on a given function before moving up
the call graph to the callers.

The net result is that I am now seeing approximately a 2% reduction in
stdlib compile times, with only a single significant performance
regression (there are some other minor improvements and regressions, and
some major improvements with -Ounchecked).

The 2% reduction appears to come largely from the mechanism in the pass
manager that skips running passes if we've not made any changes to a
function since the last time the pass was run.
@rudkx rudkx self-assigned this Mar 10, 2016
@rudkx
Copy link
Contributor Author

rudkx commented Mar 10, 2016

@swift-ci Please test

@rudkx
Copy link
Contributor Author

rudkx commented Mar 10, 2016

It looks like OS X testing is failing on someone else's change.

@rudkx
Copy link
Contributor Author

rudkx commented Mar 11, 2016

@swift-ci Please test OS X platform

rudkx added a commit that referenced this pull request Mar 11, 2016
Run more function passes in a single run of the pass manager.
@rudkx rudkx merged commit 79ea412 into swiftlang:master Mar 11, 2016
@rudkx rudkx deleted the combine-phases branch March 11, 2016 04: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.

1 participant