diff options
author | Eli Friedman <efriedma@codeaurora.org> | 2018-03-26 19:52:54 +0000 |
---|---|---|
committer | Eli Friedman <efriedma@codeaurora.org> | 2018-03-26 19:52:54 +0000 |
commit | 88e2bac94d14b1e6d65aea3d3b3d48695ec0835d (patch) | |
tree | 18494c02be38ee1e426ce7b75679842031482faa /llvm/lib/DebugInfo | |
parent | 93ce24838cd83c728d0cc852c4ae56700bac5b15 (diff) | |
download | bcm5719-llvm-88e2bac94d14b1e6d65aea3d3b3d48695ec0835d.tar.gz bcm5719-llvm-88e2bac94d14b1e6d65aea3d3b3d48695ec0835d.zip |
[MemorySSA] Fix exponential compile-time updating MemorySSA.
MemorySSAUpdater::getPreviousDefRecursive is a recursive algorithm, for
each block, it computes the previous definition for each predecessor,
then takes those definitions and combines them. But currently it doesn't
remember results which it already computed; this means it can visit the
same block multiple times, which adds up to exponential time overall.
To fix this, this patch adds a cache. If we computed the result for a
block already, we don't need to visit it again because we'll come up
with the same result. Well, unless we RAUW a MemoryPHI; in that case,
the TrackingVH will be updated automatically.
This matches the original source paper for this algorithm.
The testcase isn't really a test for the bug, but it adds coverage for
the case where tryRemoveTrivialPhi erases an existing PHI node. (It's
hard to write a good regression test for a performance issue.)
Differential Revision: https://reviews.llvm.org/D44715
llvm-svn: 328577
Diffstat (limited to 'llvm/lib/DebugInfo')
0 files changed, 0 insertions, 0 deletions