[PATCH] D111191: [SCEV] Search operand tree for scope bound when inferring flags from IR

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 14:30:40 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6622
+        Bound = DefI;
+    } if (auto *S2 = dyn_cast<SCEVCastExpr>(S))
+      for (auto *Op : S2->operands())
----------------
Is an `else` missing here? We probably don't want to recurse through addrecs here, as the addrec will already have the smallest scope.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6630
+      for (auto *Op : S2->operands())
+        pushOp(Op);
+
----------------
Huh, I'm surprised we don't have a simpler way to write this.


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

https://reviews.llvm.org/D111191



More information about the llvm-commits mailing list