-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DataFlow: Add language-specific predicate for ignoring steps in flow-through calculation #14799
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
Conversation
This file contains hidden or 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
aschackmull
reviewed
Nov 28, 2023
aschackmull
reviewed
Nov 28, 2023
…ate in flow-through summaries.
816adfa
to
339bf13
Compare
aschackmull
approved these changes
Dec 6, 2023
I love that this didn't ping all the language teams for review. Yay for properly shared code! |
Indeed 😂. Super happy about that as well! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
TLDR
This PR adds a language-level hook for excluding steps from the flow-through calculation. It's a no-op PR for all other languages than C/C++.
Slightly longer explanation
We have a well-known source of FPs in C/C++ caused by the following pattern:
This happens because we model each indirection of a parameter as a separate SSA variable, so dataflow really sees the above program as
and in the above program it's easy to see that there's a
ReturnNodeExt
generated that updates the parameterderef_p
inmodify_copy
.The problem is the SSA step generated by
int x = *p;
which should be treated special when generating flow-throughs since a subsequent update ofx
should not affect*p
(which is currently what the flow-through summaries give us).@aschackmull I'd like to hear if you have any problems with 748625c? I hope it's not controversial since:
DCA looks good. I've verified that all the removed results are instances of the
test_modify_copy_of_pointer
testcase.