-
Notifications
You must be signed in to change notification settings - Fork 0
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
Analyze across the call graph #8
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Need to implement invalidation - Need to work out a better way to trigger the upper-level pass from the lower-level one / put it in the pipeline
For some reason, this is getting bogged down in the _loop analysis_ part of the per-function evaluation...eh? Weird.
The same pass (`FunctionBoundedTermination`) completes as expected when invoked from a function-level transform pass (`print<function-bounded-termination>`), but not when invoked from a module-level transform pass `print<bounded-termination>` Is this something weird with the proxy?
Several (all?) testdata files were failing when the `FunctionTerminationPass` was run via proxy (from the module-level pass), instead of being run at the function level. Unfortunately, "run from the module" is the only way we think we can handle the call-graph level analysis. The symptom was LLVM stalling out -- looping forever? -- when we asked for `ScalarEvolutionAnalysis`. I opened up LLDB and stepped through, and... it was fine! Looking at `simple.c`, the pass produced results for `get_value` and `main` just fine. ...but our functions are not the only functions listed in a module! For instance, `simple.c` invokes `malloc`; as a result, `malloc` gets a `declare`d in our module, without a function body. And *that's* where the analysis was stalling out -- our pass was running on `F.getName() == "malloc"`! Apparently, function-level passes are only run across functions `define`d in the module -- but the listing of module contents includes functions `define`d or `declare`d. I haven't really checked this, but it is consistent with what we've seen, and would explain the difference between running in function/module modes. My fix (this commit) is to return `Unknown` if the function does not have a body, i.e. has no basic blocks. This gets us back to a passing -- though incorrect -- state.
This doesn't propagate it back via the worklist, but it does tell us about recursive loops.
cceckman
changed the title
Reorder members to prepare for adding CGSCC
Analyze across the call graph
Jun 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
...I think this does what it's supposed to.