Skip to content

C++: Reduce re-evaluation#21389

Closed
MathiasVP wants to merge 19 commits intogithub:mainfrom
MathiasVP:less-reevaluation-3
Closed

C++: Reduce re-evaluation#21389
MathiasVP wants to merge 19 commits intogithub:mainfrom
MathiasVP:less-reevaluation-3

Conversation

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Feb 27, 2026

This PR removes most of the re-evaluation of predicates from previous stages. In particular, the dataflow stage made use of various internal predicates from IR generation which caused some unfortunate re-evaluation.

There were also some other stage-related issues where various predicates in dataflow were cached, but not put inside a cached module, which produced unnecessary stages.

Unfortunately, this was easier said than done. It required a large refactoring of the dataflow files because I we have mad some fairly arbitrary choices as to what belonged in DataFlowUtil.qll and DataFlowPrivate.qll which made it hard to unify the stages. I tried my best to make this refactoring commit-by-commit reviewable.

Most of this PR has been guided by the output of Schack's stageoverlap.py script. There should be no changes to any resulting tuples.

DCA looks great. We shave off about 4-5% of the total analysis time 🎉 Additionally, my experience is that this PR removes a lot of recomputation of DataFlowUtil.qll/DataFlowPrivate.qll predicates when I modify an isSource or isSink in a query.

@github-actions github-actions bot added the C++ label Feb 27, 2026
*/
final class IndirectParameterNode = AbstractIndirectParameterNode;

/**

Check warning

Code scanning / CodeQL

Redundant import Warning

Redundant import, the module is already imported inside
DataFlowUtil
.
Comment on lines +1323 to +1325
override DataFlowCallable getEnclosingCallable() {
result.asSourceCallable() = this.getFunction()
}

Check warning

Code scanning / CodeQL

Class QLDoc style Warning

The QLDoc for a class should start with 'A', 'An', or 'The'.
@MathiasVP MathiasVP force-pushed the less-reevaluation-3 branch 2 times, most recently from 2a94da3 to 8b17a38 Compare February 27, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant