[PATCH] D44715: [MemorySSA] Fix exponential compile-time updating MemorySSA.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 13:04:37 PDT 2018


efriedma added a subscriber: MatzeB.
efriedma added a comment.

I think the problem comes from the way we implement the marker variation.

In the main algorithm, readVariableRecursive only calls itself recursively in the case where a block has one predecessor.  In this case, it's theoretically possible to visit a block an arbitrary number of times if you have a deeply nested if statement, but that's at worst quadratic in the number of nested if statements. (I'm not sure the complexity analysis in the paper accounts for this correctly, but it probably doesn't have much practical impact.)

The exponential-time problem comes from the additional recursive calls introduced by the marker variation, I think.  The variation isn't fully described in the paper, but adding recursive calls for blocks with multiple predecessors makes the algorithm exponential if you don't use some sort of cache to stop the recursion.


Repository:
  rL LLVM

https://reviews.llvm.org/D44715





More information about the llvm-commits mailing list