Skip to content

[LICM/Exclusivity] Hoist (some) conflicting begin_accesses out of loops #19023

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
Aug 29, 2018

Conversation

shajrawi
Copy link

Consider the attached test cases:

We have a begin_access [dynamic] to a global inside of a loop

There’s a nested conflict on said access due to an apply() instruction between the begin and end accesses.

LICM is currently very conservative: If there are any function calls inside of the loop that conflict with begin and end access, we do not hoist out of the loop.

However, if all conflicting applies are “sandwiched” between the begin and end access. So there’s no reason we can’t hoist out of the loop.

See radar rdar://problem/43660965 - this improves some internal benchmarks by over 3X

Consider the attached test cases:

We have a begin_access [dynamic] to a global inside of a loop

There’s a nested conflict on said access due to an apply() instruction between the begin and end accesses.

LICM is currently very conservative: If there are any function calls inside of the loop that conflict with begin and end access, we do not hoist out of the loop.

However, if all conflicting applies are “sandwiched” between the begin and end access. So there’s no reason we can’t hoist out of the loop.

See radar rdar://problem/43660965 - this improves some internal benchmarks by over 3X
@shajrawi shajrawi requested a review from atrick August 28, 2018 18:52
@shajrawi
Copy link
Author

@atrick can you please review?

@shajrawi
Copy link
Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 95344f6

@shajrawi
Copy link
Author

@swift-ci Please clean test Linux

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 95344f6

@shajrawi
Copy link
Author

Linux test failure is unrelated - debug info problem on the bots:

******************** TEST 'Swift(linux-x86_64) :: DebugInfo/local-vars.swift.gyb' FAILED ********************

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

Thanks!

@shajrawi
Copy link
Author

@swift-ci Please smoke test Linux

@shajrawi shajrawi merged commit bbb6ca1 into swiftlang:master Aug 29, 2018
@shajrawi shajrawi deleted the licm_apply_begin branch August 29, 2018 01:56
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