-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Merged
aschackmull
merged 25 commits into
github:main
from
aschackmull:dataflow/callcontext-grouping
May 27, 2024
+933
−421
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
486eaad
Shared: Add MakeSets module.
aschackmull bc8ca1a
Dataflow: Introduce NodeRegions for use in isUnreachableInCall.
aschackmull 012e1b4
Dataflow: Remove duplicate definitions
aschackmull 86e6d0b
Dataflow: Switch local call contexts to use canonical representative.
aschackmull eb0b923
Dataflow: Switch column order in viableImplCallContextReducedReverse.
aschackmull 79b1cd7
Dataflow: Refactor getLocalCc to avoid reference to NodeEx.
aschackmull b2e3d78
Dataflow: Share getCallContextReturn in DataFlowImplCommon::CallConte…
aschackmull ace369f
Dataflow: Share getCallContextCall in DataFlowImplCommon::CallContext…
aschackmull aa87243
Dataflow: Rename prunedViableImplInCallContext to viableImplCallConte…
aschackmull 0561c65
Dataflow: Rename noPrunedViableImplInCallContext to viableImplNotCall…
aschackmull 740bb84
Dataflow: Rename prunedViableImplInCallContextReverse to viableImplCa…
aschackmull 5ac96d0
Dataflow: Move viableImplNotCallContextReducedReverse to DataFlowImpl…
aschackmull f6eb82e
Dataflow: Simplify.
aschackmull e1e6cd9
Dataflow: Simplify: remove Level1CallContextInput module
aschackmull 1dd1f12
Dataflow: Move Level1CallContext to DataFlowImplCommon
aschackmull 947c2bf
Dataflow: Move two declarations.
aschackmull 52a232e
Dataflow: Make CallContext type private to DataFlowImplCommon.
aschackmull b83416f
Dataflow: Make two predicates private.
aschackmull 972b81b
Util: Allow best-effort total orders with a reasonable fallback.
aschackmull 5a25984
Dataflow: Switch call context to a set representation.
aschackmull 1432519
Dataflow: Add totalorder predicates to all languages.
aschackmull 5c635e9
C++/C#/Java: Update expected output.
aschackmull 8085460
C++/Shared: Fix join order issues.
aschackmull 4ff37cc
Dataflow: Address review comments.
aschackmull 51c48c7
Dataflow: Address review comments (take 2).
aschackmull File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2380,16 +2380,31 @@ predicate expectsContent(Node n, ContentSet c) { | |
n.asExpr() instanceof SpreadElementExpr and c instanceof ElementContent | ||
} | ||
|
||
class NodeRegion instanceof ControlFlow::BasicBlock { | ||
string toString() { result = "NodeRegion" } | ||
Comment on lines
+2383
to
+2384
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
predicate contains(Node n) { this = n.getControlFlowNode().getBasicBlock() } | ||
|
||
int totalOrder() { | ||
this = | ||
rank[result](ControlFlow::BasicBlock b, int startline, int startcolumn | | ||
b.getLocation().hasLocationInfo(_, startline, startcolumn, _, _) | ||
| | ||
b order by startline, startcolumn | ||
) | ||
} | ||
} | ||
|
||
/** | ||
* Holds if the node `n` is unreachable when the call context is `call`. | ||
* Holds if the nodes in `nr` are unreachable when the call context is `call`. | ||
*/ | ||
predicate isUnreachableInCall(Node n, DataFlowCall call) { | ||
predicate isUnreachableInCall(NodeRegion nr, DataFlowCall call) { | ||
exists( | ||
ExplicitParameterNode paramNode, Guard guard, ControlFlow::SuccessorTypes::BooleanSuccessor bs | ||
| | ||
viableConstantBooleanParamArg(paramNode, bs.getValue().booleanNot(), call) and | ||
paramNode.getSsaDefinition().getARead() = guard and | ||
guard.controlsBlock(n.getControlFlowNode().getBasicBlock(), bs, _) | ||
guard.controlsBlock(nr, bs, _) | ||
) | ||
} | ||
|
||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
final extends
?