[PATCH] D110620: [SCEV] Infer ranges for SCC consisting of cycled Phis

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 5 05:37:53 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6245
     if (const PHINode *Phi = dyn_cast<PHINode>(U->getValue())) {
-      // Make sure that we do not run over cycled Phis.
-      if (PendingPhiRanges.insert(Phi).second) {
-        ConstantRange RangeFromOps(BitWidth, /*isFullSet=*/false);
-        for (auto &Op : Phi->operands()) {
-          auto OpRange = getRangeRef(getSCEV(Op), SignHint);
-          RangeFromOps = RangeFromOps.unionWith(OpRange);
+      if (!PendingPhiRanges.count(Phi)) {
+        // Collect strongly connected component (further on - SCC ) composed of
----------------
reames wrote:
> This block of code has gotten quite complicated, probably time for a helper function.  
Factored out.


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

https://reviews.llvm.org/D110620



More information about the llvm-commits mailing list