This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Don't cache report generation ExplodedNodes
ClosedPublic

Authored by bcraig on Jun 10 2016, 8:18 AM.

Details

Summary

During the core analysis, ExplodedNodes are added to the ExplodedGraph, and those nodes are cached for deduplication purposes.

After core analysis, reports are generated. Here, trimmed copies of the ExplodedGraph are made. Since the ExplodedGraph has already been deduplicated, there is no need to deduplicate again.

This change makes it possible to add ExplodedNodes to an ExplodedGraph without the overhead of deduplication. "Uncached" nodes also cannot be iterated over, but none of the report generation code attempts to iterate over all nodes. This change reduces the analysis time of a large .C file from 3m43.941s to 3m40.256s (~1.6% speedup). It should slightly reduce memory consumption. Gains should be roughly proportional to the number (and path length) of static analysis warnings.

This patch enables future work that should remove the need for an InterExplodedGraphMap inverse map. I plan on using the (now unused) ExplodedNode link to connect new nodes to the original nodes.

Diff Detail

Event Timeline

bcraig updated this revision to Diff 60355.Jun 10 2016, 8:18 AM
bcraig retitled this revision from to [Analyzer] Don't cache report generation ExplodedNodes.
bcraig updated this object.
bcraig added a subscriber: cfe-commits.
zaks.anna accepted this revision.Jun 21 2016, 3:05 PM
zaks.anna edited edge metadata.

LGTM. Please, measure that this does not regress memory consumption just to be sure.

Thanks!
Anna.

This revision is now accepted and ready to land.Jun 21 2016, 3:05 PM
bcraig closed this revision.Jun 23 2016, 8:55 AM

Old: 106,657,666
New: 105,346,818

Submitted in r273572