Skip to content

Data flow: No magic in returnFlowCallableCand #3142

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

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Mar 27, 2020

Adding implementations of PostUpdateNode for IR field flow in C++ (#3118) revealed a bad join order in DataFlowImpl::parameterThroughFlowCand when running on Wireshark/Wireshark:

[2020-03-27 10:24:07] (4076s) Tuple counts for DataFlowImpl::parameterThroughFlowCand#ff#antijoin_rhs:
                      2981323763 ~0%     {3} r1 = JOIN DataFlowImpl::parameterThroughFlowCand#ff#shared AS L WITH DataFlowUtil::InstructionNode::getEnclosingCallable_dispred#ff_10#join_rhs AS R ON FIRST 1 OUTPUT L.<2>, L.<1>, R.<1>
                      2968445848 ~2%     {4} r2 = JOIN r1 WITH DataFlowImplCommon::Cached::TParamUpdate#2#ff_10#join_rhs AS R ON FIRST 1 OUTPUT r1.<2>, R.<1>, r1.<1>, r1.<0>
                      832264     ~0%     {3} r3 = JOIN r2 WITH project#DataFlowUtil::ParameterNode::isParameterOf_dispred#2#fff AS R ON FIRST 2 OUTPUT r2.<2>, r2.<3>, r2.<0>
                                         return r3

The fix is to avoid inlining returnFlowCallableCand. I couldn't reproduce the bad join order in C++ without the changes in #3118, but I figured it'd be good to test the impact of this change on master in isolation.

@MathiasVP
Copy link
Contributor Author

MathiasVP commented Mar 27, 2020

@MathiasVP MathiasVP changed the title Data flow: No magic in parameterThroughFlowCand Data flow: No magic in returnFlowCallableCand Mar 27, 2020
@hvitved
Copy link
Contributor

hvitved commented Mar 27, 2020

LGTM. Now that you are implementing field-flow for C++, I'd be interested to see which effect #3110 has. It has a positive performance impact on large Java and C# projects, but performance for C++ was mostly unchanged.

@MathiasVP
Copy link
Contributor Author

LGTM. Now that you are implementing field-flow for C++, I'd be interested to see which effect #3110 has. It has a positive performance impact on large Java and C# projects, but performance for C++ was mostly unchanged.

Good point! I'll try merging #3110 into #3118 locally and see what happens.

MathiasVP added a commit to MathiasVP/ql that referenced this pull request Mar 28, 2020
Copy link
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

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

LGTM. @aschackmull, do you have any objection to merging this?

@aschackmull aschackmull merged commit 57c9277 into github:master Mar 30, 2020
max-schaefer pushed a commit to max-schaefer/codeql-go that referenced this pull request Mar 30, 2020
max-schaefer pushed a commit to max-schaefer/codeql-go that referenced this pull request May 6, 2020
max-schaefer pushed a commit to max-schaefer/codeql-go that referenced this pull request May 6, 2020
owen-mc pushed a commit to owen-mc/codeql-go that referenced this pull request Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants