[PATCH] D114738: Fully delete stale SCEVs from ValuesAtScope map

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 02:31:57 PST 2021


nikic added a comment.

The idea here is right, but I'm concerned that this will have pathological cases, because we need to scan the whole ValuesAtScopes map any time we forget something. This map can be large. The proper way to handle this would be to add a reverse map for invalidation purposes (similar to D114784 <https://reviews.llvm.org/D114784>, but for ValuesAtScope).



================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:12897
+  for (auto &KV : ValuesAtScopes) {
+    // We could delete only the entry in the inner array.
+    typedef std::pair<const Loop *, const SCEV *> EntryTy;
----------------
Should be easy to do with `llvm::remove_if()`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114738/new/

https://reviews.llvm.org/D114738



More information about the llvm-commits mailing list