Page MenuHomePhabricator

Improve caching scheme in ProvenanceAnalysis.
ClosedPublic

Authored by mzolotukhin on Mar 8 2018, 12:31 PM.

Details

Summary

ProvenanceAnalysis::related(A, B) currently memoizes its results, and on big
tests the cache grows too large, and we're spending most of the time
growing/looking through DenseMap.

This patch reduces the size of the cache by normalizing keys first: we do that
by calling GetUnderlyingObjCPtr on the input values. The results of
GetUnderlyingObjCPtr are also memoized in a separate cache.

The patch doesn't bring noticable changes to compile time on CTMark, however
significantly helps one of our internal tests.

Diff Detail

Repository
rL LLVM

Event Timeline

mzolotukhin created this revision.Mar 8 2018, 12:31 PM
pete accepted this revision.Mar 9 2018, 4:02 PM
pete added a subscriber: pete.

This all looks reasonable. Its a nice localized change to this pass. LGTM.

This revision is now accepted and ready to land.Mar 9 2018, 4:02 PM
This revision was automatically updated to reflect the committed changes.