[PATCH] D111353: [SCEV] Extend ability to infer flags to more complicates scopes

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 22:19:15 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6670
 
-  auto *BLoop = LI.getLoopFor(B->getParent());
-  if (BLoop && BLoop->getHeader() == B->getParent() &&
-      BLoop->getLoopPreheader() == A->getParent() &&
-      ::isGuaranteedToTransferExecutionToSuccessor(A->getIterator(),
-                                                   A->getParent()->end()) &&
-      ::isGuaranteedToTransferExecutionToSuccessor(B->getParent()->begin(),
-                                                   B->getIterator()))
-    return true;
-  return false;
+  // First find a path from B to A where if all blocks along path
+  // are transparent, then we can prove A reaches B.  Defer the actual
----------------
Quick check: `A` dominates `B`?


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6689
+
+  while (true) {
+    Path.push_back(PrevBB);
----------------
I guess this will hand if you call it on 2 unreachable blocks going to one another.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6716
+  // local search, we use the block local cache as a filter.
+  auto doLocalSearch = [&](BasicBlock::const_iterator Begin,
+                           BasicBlock::const_iterator End) {
----------------
nit: capitalize lambda name.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D111353



More information about the llvm-commits mailing list