codeql icon indicating copy to clipboard operation
codeql copied to clipboard

Dataflow: Implement call context grouping to improve performance

Open aschackmull opened this issue 1 year ago • 3 comments

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 in CachedCallContextSensitivity.

aschackmull avatar May 08 '24 13:05 aschackmull

Overall approach LGTM. A few comments/suggestions.

All comments should be addressed now.

aschackmull avatar May 24 '24 09:05 aschackmull

More comments addressed. (Including one change that had somehow slipped from the first commit).

aschackmull avatar May 24 '24 12:05 aschackmull

Perhaps it is worth running a final batch of DCA for all languages before merging?

Sure. Running now.

aschackmull avatar May 24 '24 13:05 aschackmull

Dca looks good.

aschackmull avatar May 27 '24 07:05 aschackmull

Rebased to fix CI.

aschackmull avatar May 27 '24 09:05 aschackmull