Skip to content

EscapeUtils: fix some bugs related to followLoads #63614

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 4 commits into from
Feb 13, 2023

Conversation

eeckstein
Copy link
Contributor

  • correctly handle "exclusive" argument -> return effects
  • consider that a begin_apply can yield it's indirect arguments
  • fix handling a raw pointer during up-walk

For details see the commit messages

Fixes a wrong address-escaping effect in case the called function copies an indirect argument to a newly created object.
rdar://105133434

…fects.

Exclusive argument -> argument effects cannot appear because such an effect would involve a store which is not permitted for exclusive escapes.
… effects

* Disallow stores in the return -> argument path. When walking up in the EscapeUtils, it's allowed to follow stores. Therefore stores wouldn't be handled correctly.
* Also make sure that there is a return -> argument path at all

Fixes a wrong address-escaping effect in case the called function copies an indirect argument to a newly created object.
rdar://105133434
…guments

This is the only apply instruction where address arguments actually can "escape"
When walking up we shouldn't end up at a load where followLoads is false, because going from a (non-followLoads) address to a load always involves a class indirection.
There is one exception: loading a raw pointer
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein eeckstein changed the title Fix a few bugs in EscapeUtils EscapeUtils: fix some bugs related to followLoads Feb 13, 2023
@eeckstein eeckstein merged commit b67187c into swiftlang:main Feb 13, 2023
@eeckstein eeckstein deleted the fix-escape-utils branch February 13, 2023 20:37
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