Skip to content

MemoryLifetimeVerifier: be more precise with indirect function arguments. #65592

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 3 commits into from
May 4, 2023

Conversation

eeckstein
Copy link
Contributor

Optimizations can rely on alias analysis to know that an in-argument (or parts of it) is not actually read.
We have to do the same in the verifier: if alias analysis says that an in-argument is not read, there is no need that the memory location is initialized.

Fixes a false verifier error.
rdar://106806899

Also simplify the getMemBehaviorFn in the CalleeAnalysis (a NFC), which I discovered while working on the verifier.

@eeckstein eeckstein requested a review from nate-chandler May 2, 2023 19:46
@eeckstein
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@nate-chandler nate-chandler left a comment

Choose a reason for hiding this comment

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

lgtm!

@eeckstein eeckstein force-pushed the fix-sil-verifier branch from 3cc98eb to 2e47bbf Compare May 3, 2023 05:17
@eeckstein
Copy link
Contributor Author

@swift-ci test

eeckstein added 3 commits May 3, 2023 14:33
verifier failures must be placed into memory_lifetime_failures.sil. Otherwise they won't be tested.
…nts.

Optimizations can rely on alias analysis to know that an in-argument (or parts of it) is not actually read.
We have to do the same in the verifier: if alias analysis says that an in-argument is not read, there is no need that the memory location is initialized.

Fixes a false verifier error.
rdar://106806899
@eeckstein eeckstein force-pushed the fix-sil-verifier branch from 2e47bbf to 4b33b99 Compare May 3, 2023 12:35
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein
Copy link
Contributor Author

@swift-ci smoke test macos

@eeckstein eeckstein merged commit ddc0219 into swiftlang:main May 4, 2023
@eeckstein eeckstein deleted the fix-sil-verifier branch May 4, 2023 05:52
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