-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Add reverse reads to IR field flow #3419
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
Conversation
edd1f87
to
609b939
Compare
I'm finding the parent/child and beginning/end terminology in the store chain to be unintuitive, and I can't find a written explanation of what exactly a reverse read is anywhere. If I'm understanding the store side correctly, for each instruction which stores to the result of a |
Good point. I'll add some more comments about what a reverse read is. I guess it
Correct. For
Correct. For
Correct. In the
Yes, that is accurate. In |
…edicates. I also simplified the code a bit by moving common implementations of predicates into shared super classes. Finally, I added a getLocation predicate to StoreNode to match the structure of the LoadNode class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Actually, I just went back and looked at the performance numbers in the difference job - the 5% slowdown on Linux looks pretty bad, but I think it's partly noise (42% of the slowdown was from TaintedPath.ql, but most of the rest is from unrelated queries). I've triggered a rebuild: https://jenkins.internal.semmle.com/job/Changes/job/CPP-Differences/1169/ |
Thanks for rebuilding! It looks like the Linux slowdown was mostly noise: the slowdown is down to 1.7% now. The slowdown is still mostly in cpp/path-injection, though. I'll investigate this. Edit: I've pushed a tiny change that should improve performance (but probably not much). For some reason I hadn't restricted the side effect column of |
…o be WriteSideEffectInstructions
Looks like the performance improvement didn't have any negative consequences (although it didn't have any noticeable positive effects either). |
Since this PR is still open I decided to fix a low-hanging fruit that was waiting for #3123 to be merged. |
There was unfortunately a semantic merge conflict between github#3419 and github#3587 that caused a performance regression on (at least) OpenJDK. This reverts commit 982fb38, reversing changes made to b841cac.
C++: Revert #3419 to fix OpenJDK performance
This PR adds support for reverse read field flow in the IR instantiation of the shared dataflow library. It does this by adding two new dataflow nodes, which adds "source code"-like structure to field lookups.
The previous iterations of this PR hasn't had any performance problems, but I've started a new CPP-differences anwyay to be safe: https://jenkins.internal.semmle.com/job/Changes/job/CPP-Differences/1159/