Skip to content

Data flow: Fix bad join-orders in summaryNodeType #6256

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

hvitved
Copy link
Contributor

@hvitved hvitved commented Jul 12, 2021

Before:

[2021-07-12 11:41:57] (608s) Tuple counts for FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs#1/3@6219ab:
                      66848     ~4%      {3} r1 = SCAN FlowSummaryImpl::Private::summaryNodeOutputState#fff OUTPUT In.2 'arg0', In.0, In.1
                      66848     ~0%      {3} r2 = JOIN r1 WITH DataFlowPrivate::NodeImpl#class#f ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.0 'arg0'
                      781342050 ~0%      {5} r3 = JOIN r2 WITH FlowSummaryImpl::Private::summaryNodeOutputState#fff ON FIRST 1 OUTPUT Rhs.1, 1, Lhs.1, Lhs.2 'arg0', Rhs.2 'arg0'
                      58817     ~0%      {3} r4 = JOIN r3 WITH FlowSummaryImpl::Public::SummaryComponentStack::drop#fff ON FIRST 3 OUTPUT Lhs.0, Lhs.3 'arg0', Lhs.4 'arg1'
                      58817     ~1%      {3} r5 = JOIN r4 WITH FlowSummaryImpl::Public::SummaryComponentStack::head_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1'
                      504       ~2%      {3} r6 = JOIN r5 WITH construct<TSummaryComponent,1>@dom#FlowSummaryImpl::Private::TParameterSummaryComponent#1#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Rhs.1 'arg2'
                                         return r6


[2021-07-12 11:43:35] (706s) Tuple counts for FlowSummaryImpl::Private::summaryNodeType#ff/2@i3#4a74bx:
                      0         ~0%     {2} r1 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryPostUpdateNode#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'n', Lhs.1 'result'
                      
                      0         ~0%     {3} r2 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs#2 ON FIRST 1 OUTPUT Rhs.2, Rhs.1, Lhs.1 'result'
                      0         ~0%     {2} r3 = JOIN r2 WITH FlowSummaryImpl::Private::summaryNodeInputState#fff ON FIRST 2 OUTPUT Lhs.2, Rhs.2 'n'
                      0         ~0%     {2} r4 = JOIN r3 WITH FlowSummaryImplSpecific::getCallbackReturnType#cpe#13#ff ON FIRST 1 OUTPUT Lhs.1 'n', Rhs.1 'result'
                      
                      64113     ~0%     {3} r5 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs#3 ON FIRST 1 OUTPUT Rhs.1, Rhs.2, Lhs.1 'result'
                      781333898 ~0%     {5} r6 = JOIN r5 WITH FlowSummaryImpl::Private::summaryNodeOutputState#fff ON FIRST 1 OUTPUT Rhs.1, 1, Lhs.1, Lhs.2, Rhs.2 'n'
                      57159     ~0%     {3} r7 = JOIN r6 WITH FlowSummaryImpl::Public::SummaryComponentStack::drop#fff ON FIRST 3 OUTPUT Lhs.0, Lhs.3, Lhs.4 'n'
                      57159     ~0%     {3} r8 = JOIN r7 WITH FlowSummaryImpl::Public::SummaryComponentStack::head_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2 'n'
                      0         ~0%     {3} r9 = JOIN r8 WITH construct<TSummaryComponent,1>@dom#FlowSummaryImpl::Private::TParameterSummaryComponent#1#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2 'n'
                      0         ~0%     {2} r10 = JOIN r9 WITH FlowSummaryImplSpecific::getCallbackParameterType#fff ON FIRST 2 OUTPUT Lhs.2 'n', Rhs.2 'result'
                      
                      0         ~0%     {2} r11 = r4 UNION r10
                      0         ~0%     {2} r12 = r1 UNION r11
                      0         ~0%     {2} r13 = r12 AND NOT FlowSummaryImpl::Private::summaryNodeType#ff#prev(Lhs.0 'n', Lhs.1 'result')
                                        return r13

After

[2021-07-12 12:08:52] (572s) Tuple counts for FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs#1/3@41a32a:
                      66848   ~4%      {3} r1 = SCAN FlowSummaryImpl::Private::summaryNodeOutputState#fff OUTPUT In.2 'arg0', In.0, In.1
                      66848   ~1%      {4} r2 = JOIN r1 WITH DataFlowPrivate::NodeImpl#class#f ON FIRST 1 OUTPUT 1, Lhs.2, Lhs.1, Lhs.0 'arg0'
                      1406384 ~0%      {3} r3 = JOIN r2 WITH FlowSummaryImpl::Public::SummaryComponentStack::drop#fff_120#join_rhs ON FIRST 2 OUTPUT Lhs.2, Rhs.2, Lhs.3 'arg0'
                      58817   ~0%      {3} r4 = JOIN r3 WITH FlowSummaryImpl::Private::summaryNodeOutputState#fff ON FIRST 2 OUTPUT Lhs.1, Lhs.2 'arg0', Rhs.2 'arg0'
                      58817   ~1%      {3} r5 = JOIN r4 WITH FlowSummaryImpl::Public::SummaryComponentStack::head_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'arg0', Lhs.2 'arg1'
                      504     ~2%      {3} r6 = JOIN r5 WITH construct<TSummaryComponent,1>@dom#FlowSummaryImpl::Private::TParameterSummaryComponent#1#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1 'arg0', Lhs.2 'arg1', Rhs.1 'arg2'
                                       return r6


[2021-07-12 12:09:06] (586s) Tuple counts for FlowSummaryImpl::Private::summaryNodeType#ff/2@i3#67f70x:
                      0       ~0%      {2} r1 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryPostUpdateNode#ff_10#join_rhs ON FIRST 1 OUTPUT Rhs.1 'n', Lhs.1 'result'
                      
                      0       ~0%      {2} r2 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs ON FIRST 1 OUTPUT Lhs.1 'result', Rhs.1 'n'
                      0       ~0%      {2} r3 = JOIN r2 WITH FlowSummaryImplSpecific::getCallbackReturnType#cpe#13#ff ON FIRST 1 OUTPUT Lhs.1 'n', Rhs.1 'result'
                      
                      64113   ~0%      {4} r4 = JOIN DataFlowPrivate::NodeImpl::getDataFlowType_dispred#ff#prev_delta WITH FlowSummaryImpl::Private::summaryNodeType#ff#join_rhs#2 ON FIRST 1 OUTPUT 1, Rhs.2, Rhs.1, Lhs.1 'result'
                      742352  ~10%     {3} r5 = JOIN r4 WITH FlowSummaryImpl::Public::SummaryComponentStack::drop#fff_120#join_rhs ON FIRST 2 OUTPUT Lhs.2, Rhs.2, Lhs.3
                      57159   ~0%      {3} r6 = JOIN r5 WITH FlowSummaryImpl::Private::summaryNodeOutputState#fff ON FIRST 2 OUTPUT Lhs.1, Lhs.2, Rhs.2 'n'
                      57159   ~0%      {3} r7 = JOIN r6 WITH FlowSummaryImpl::Public::SummaryComponentStack::head_dispred#ff ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2 'n'
                      0       ~0%      {3} r8 = JOIN r7 WITH construct<TSummaryComponent,1>@dom#FlowSummaryImpl::Private::TParameterSummaryComponent#1#ff_10#join_rhs ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2 'n'
                      0       ~0%      {2} r9 = JOIN r8 WITH FlowSummaryImplSpecific::getCallbackParameterType#fff ON FIRST 2 OUTPUT Lhs.2 'n', Rhs.2 'result'
                      
                      0       ~0%      {2} r10 = r3 UNION r9
                      0       ~0%      {2} r11 = r1 UNION r10
                      0       ~0%      {2} r12 = r11 AND NOT FlowSummaryImpl::Private::summaryNodeType#ff#prev(Lhs.0 'n', Lhs.1 'result')
                                       return r12

https://jenkins.internal.semmle.com/job/Changes/job/CSharp-Differences/1192/
https://jenkins.internal.semmle.com/job/Changes/job/Java-Differences/1499/

@hvitved hvitved marked this pull request as ready for review July 13, 2021 07:33
@hvitved hvitved requested review from a team as code owners July 13, 2021 07:33
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Jul 13, 2021
@aschackmull aschackmull merged commit be96647 into github:main Jul 13, 2021
@hvitved hvitved deleted the dataflow/summary-node-type-join-order branch July 13, 2021 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants