Skip to content

[Exclusivity] Support exclusivity checks originating from block arguments #20522

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
Nov 13, 2018

Conversation

shajrawi
Copy link

This includes:

  1. Not crashing in AccessEnforcementOpts in case we have an Unidentified storage access - rdar://problem/45956642 and rdar://problem/45956777
  2. Actually supporting finding the storage locations if we do begin_access <block argument>
  3. Test case for said support

@shajrawi shajrawi requested a review from atrick November 12, 2018 22:03
@shajrawi shajrawi force-pushed the block_args branch 3 times, most recently from 372fa72 to 964649f Compare November 12, 2018 22:18
@shajrawi
Copy link
Author

@swift-ci Please smoke test

@shajrawi
Copy link
Author

Seems like the linux bots are red with an unrelated problem in Clang importer

@shajrawi
Copy link
Author

And the Mac bots are red in LLVM...

@@ -536,8 +536,6 @@ void AccessConflictAndMergeAnalysis::identifyBeginAccesses() {
// here as an invalid `storage` value.
const AccessedStorage &storage =
findAccessedStorageNonNested(beginAccess->getSource());
if (!storage)
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment above explains that this optimization should bail out on unrecognized patterns, which may be generated by various SILOptimizer passes between the time that we select enforcement for markers and the time that we optimize them. This should still bailout and none of the other code in this pass should assume that access markers have a valid storage object.

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as we make it clear that the mapped storage may be invalid and comment getAccessInfo then it seems like this could work.

Copy link
Author

Choose a reason for hiding this comment

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

I added a long comment explaining this

…ents

This includes:
1) Not crashing in AccessEnforcementOpts in case we have an Unidentified storage access - rdar://problem/45956642 and rdar://problem/45956777
2) Actually supporting finding the storage locations if we do begin_access <block argument>
3) Test case for said support
@shajrawi
Copy link
Author

@swift-ci Please smoke test

@shajrawi shajrawi merged commit d32677e into swiftlang:master Nov 13, 2018
@shajrawi shajrawi deleted the block_args branch November 13, 2018 20:25
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