[PATCH] D134614: [SCEV] Support clearing Block/LoopDispositions for a single value.

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 02:33:35 PDT 2022


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8388
+void ScalarEvolution::forgetBlockAndLoopDispositions(Value *V) {
+  if (V) {
+    if (const SCEV *S = getExistingSCEV(V)) {
----------------
```
if (!V)
  return;
...
```


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8396
+        const SCEV *Curr = Worklist.pop_back_val();
+        if (!LoopDispositions.erase(Curr))
+          continue;
----------------
I' not sure this is right. Imagine we have:
```
a = ...
x = a + 1;
y = b + 1;
```
Loop dispositions for `a` and `y` have been cached but not for `x`. If we stop at `x`, then `y` won't be invalidated.

Is this an impossible situation?


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8407
+      LoopDispositions.erase(S);
+      return;
+    }
----------------
not needed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134614



More information about the llvm-commits mailing list