Skip to content

MemoryLifetimeVerifier: use CalleeCache instead of AliasAnalysis #70155

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
Dec 4, 2023

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Dec 1, 2023

To verify if a function may read from an indirect argument, don't use AliasAnalysis.
Instead use the CalleeCache to get the list of callees of an apply instruction.
Then use a simple call-back into the swift Function to check if a callee has any relevant memory effect set.

This avoids a dependency from SIL to the Optimizer.
It fixes a linker error when building some unit tests in debug.

This change involves moving several things from the Optimizer component to SIL:
in SwiftCompilerSources:

  • WalkUtils
  • AccessUtils

in C++:

  • CalleeList
  • CalleeCache

@eeckstein
Copy link
Contributor Author

@swift-ci test

…er module to the SIL module

Those utilities are conceptually part of the SIL definition.
Extract the CalleeCache from BasicCalleeAnalysis so that it can be used in SIL without BasicCalleeAnalysis
To verify if a function may read from an indirect argument, don't use AliasAnalysis.
Instead use the CalleeCache to get the list of callees of an apply instruction.
Then use a simple call-back into the swift Function to check if a callee has any relevant memory effect set.

This avoids a dependency from SIL to the Optimizer.
It fixes a linker error when building some unit tests in debug.
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein merged commit 10ff55b into swiftlang:main Dec 4, 2023
@eeckstein eeckstein deleted the refactoring branch December 4, 2023 07:54
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