[PATCH] D38435: [SCEV] Maintain and use a loop->loop invalidation dependency

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 13 01:32:53 PDT 2017


mkazantsev added a comment.

I have one real question left, why we don't use `forgetLoop`.



================
Comment at: include/llvm/Analysis/ScalarEvolution.h:1269
+    void findUsedLoops(ScalarEvolution &SE,
+                       SmallPtrSet<const Loop *, 8> &Result) const;
   };
----------------
`SmallPtrSetImpl`?


================
Comment at: lib/Analysis/ScalarEvolution.cpp:6414
+        else {
+          BackedgeTakenCounts.erase(LoopOrSCEV.get<const Loop *>());
+          PredicatedBackedgeTakenCounts.erase(LoopOrSCEV.get<const Loop *>());
----------------
Why we are not using `forgetLoop` here?


================
Comment at: lib/Analysis/ScalarEvolution.cpp:6563
+static void findUsedLoopsInSCEVExpr(const SCEV *S,
+                                    SmallPtrSet<const Loop *, 8> &Result) {
+  struct FindUsedLoops {
----------------
`SmallPtrSetImpl`?


================
Comment at: lib/Analysis/ScalarEvolution.cpp:11071
 
-  for (auto *L : F.LoopsUsed)
-    LoopUsers[L].push_back(S);
+  for (auto *UsedL : LoopsUsed) {
+    LoopUsers[UsedL].push_back({L});
----------------
Why do we need `{ }` here?


https://reviews.llvm.org/D38435





More information about the llvm-commits mailing list