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
Dataflow: Implement call context grouping to improve performance #16456
base: main
Are you sure you want to change the base?
Dataflow: Implement call context grouping to improve performance #16456
Conversation
|
||
import CallContextSensitivity<CallContextSensitivityInput> | ||
import LocalCallContext | ||
} |
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInCallContext
Candidate predicate to
reducedViableImplInCallContext
} | ||
|
||
private class CallContext = PrunedCallContextSensitivityStage5::Cc; | ||
|
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInReturn
Candidate predicate to
reducedViableImplInReturn
|
||
private module CallSets = MakeSets<CallSetsInput>; | ||
|
||
private module CallSetOption = Option<CallSets::ValueSet>; |
Check warning
Code scanning / CodeQL
Dead code Warning
|
||
private module DispatchSets = MakeSets<DispatchSetsInput>; | ||
|
||
private module DispatchSetsOption = Option<DispatchSets::ValueSet>; |
Check warning
Code scanning / CodeQL
Dead code Warning
178d18c
to
985b8f0
Compare
…llContextReducedReverse.
…Common::CallContextSensitivity.
985b8f0
to
0520839
Compare
predicate reducedViableImplInReturnCand = | ||
CachedCallContextSensitivity::reducedViableImplInReturn/2; | ||
} | ||
predicate reducedViableImplInCallContextCand = |
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInCallContext
Candidate predicate to
reducedViableImplInCallContext
|
||
import CallContextSensitivity<CallContextSensitivityInput> | ||
predicate reducedViableImplInReturnCand = |
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInReturn
Candidate predicate to
reducedViableImplInReturn
predicate reducedViableImplInReturnCand = | ||
Stage3Param::Level1CallContextInput::reducedViableImplInReturn/2; | ||
} | ||
predicate reducedViableImplInCallContextCand = |
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInCallContext
Candidate predicate to
reducedViableImplInCallContext
|
||
import CallContextSensitivity<CallContextSensitivityInput> | ||
predicate reducedViableImplInReturnCand = Stage3Param::reducedViableImplInReturn/2; |
Check warning
Code scanning / CodeQL
Candidate predicate not marked as `nomagic` Warning
reducedViableImplInReturn
Candidate predicate to
reducedViableImplInReturn
|
||
predicate callContextNone = CachedCallContextSensitivity::ccNone/0; | ||
|
||
predicate callContextSomeCall = CachedCallContextSensitivity::ccSomeCall/0; |
Check warning
Code scanning / CodeQL
Dead code Warning
This replaces our call context representation with a set-based representation of the allowed call edges, thus unifying equivalent call contexts. This unification means that we avoid redundant computation when a callable is reachable with several different, but equivalent call contexts.
In some cases I've observed 3000 equivalent call contexts, which will now be replaced by a single entity, and in that particular case the total tuple count for the stage was cut in half.
Commit-by-commit review encouraged. The first commit introduces the
MakeSets
primitive, which is then used to collapse local call contexts. Then a sequence of refactoring commits follow. And finally, the "Dataflow: Switch call context to a set representation" commit contains the implementation of and switch to fully set-based call contexts. This commit also does some reshuffling to ensure proper caching inCachedCallContextSensitivity
.