Skip to content
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

[AndersenAgnostic] Fix RegionAwareMemoryNodeProvider, now based on call graph and handling calls to external #827

Merged
merged 11 commits into from
Mar 20, 2025

Conversation

haved
Copy link
Collaborator

@haved haved commented Mar 14, 2025

Introduces a call graph creation step to the RegionAwareMemoryProvider, which ensures that all possible call paths are handled, even when going via external function calls.

SCCs are found in this call graph, and they are visited in reverse topological order.
This means that for any function call found during the "annotation" step, it either points to a function in an earlier SCC which is already finished, or in the same SCC. In the latter case a flag is used to remember that the call may be recursive.

RegionSummaries also remember if they may contain recursion. Once all functions have been annotated, a final pass goes through all summaries that may contain recursion, and add the whole SCC's summary of memory locations to it.

These changes made the encoding more precise in some of the tests, so they have been updated to account for that.

Testing the llvm-test-suite with --AAAndersenRegionAware passes on all tests, though I managed to get the encoder to fail when combining --AAAndersenRegionAware with other passes. I felt this PR was large enough already, so fixing encoder issues is not done here.

I am adding the [AndersenAgnostic] on this PR, but that is only because [AndersenRegionAware] does not exist yet.

@haved haved requested a review from phate March 14, 2025 14:55
Copy link

The execution time of dynamatic/pivot has changed
  Golden cycle time: 1190
  Simulated cycles: 1181

@phate
Copy link
Owner

phate commented Mar 15, 2025

@haved I am excited to review it, but is there any chance that we could move the iteration wrapper changes into its own PR?

@haved
Copy link
Collaborator Author

haved commented Mar 15, 2025

@phate that is absolutely possible, I can do that

Copy link

The execution time of dynamatic/pivot has changed
  Golden cycle time: 1190
  Simulated cycles: 1181

Copy link

The execution time of dynamatic/pivot has changed
  Golden cycle time: 1190
  Simulated cycles: 1181

Copy link
Owner

@phate phate left a comment

Choose a reason for hiding this comment

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

The first batch of comments. I need to go over it one more time, as I was not able to finish it completely.

@haved
Copy link
Collaborator Author

haved commented Mar 19, 2025

@phate I addressed your comments so far

Copy link

The execution time of dynamatic/pivot has changed
  Golden cycle time: 1190
  Simulated cycles: 1181

Copy link
Owner

@phate phate left a comment

Choose a reason for hiding this comment

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

Great work! The code is very readable and understandable.

There is still the empty TestIteratorWrapper.cpp in the PR that needs to be removed.

I have a question: I do not see that we handle setjmp/longjmp explicitly. Do we handle it correctly?

@haved
Copy link
Collaborator Author

haved commented Mar 20, 2025

@phate I created a Context to make it easier to clear temporary state (and actually clear it).

Regarding setjmp and longjmp, they are currently handled, as we are currently very conservative within each SCC, and anything that calls either will end up in the big "external + almost everything else"-SCC.

Copy link

The execution time of dynamatic/pivot has changed
  Golden cycle time: 1190
  Simulated cycles: 1181

@haved haved merged commit 181e872 into master Mar 20, 2025
12 checks passed
@haved haved deleted the region-provisioning branch March 20, 2025 09:42
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