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

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 21 15:00:12 PDT 2018


dberlin requested changes to this revision.
dberlin added a comment.
This revision now requires changes to proceed.

(there is a longer report version that describes the marker variation in detail that is escaping me at the moment. There is also code that implements it in clang).

So staring, i think the main difference is in fact, like you say, that they have an effective cache and we don't.
In particular, the marker variation code looks at the variable map before continuing to traverse blocks, acting exactly as the cache you've implemented. It stores the ongoing results in writeVariable (which we don't have) to avoid having to find them again.
(I didn't notice this at first because the coding style is truly horrible).

So, IMHO, what you've done seems exactly right.

We should be updating the CachedPreviousDef for phis we insert/remove as well.
(IOW, it should be updated where you see the writevariable calls in the algorithm, i believe)


Repository:
  rL LLVM

https://reviews.llvm.org/D44715





More information about the llvm-commits mailing list