[PATCH] D28158: [SCEV] limit recursion depth and operands number in getAddExpr

Daniil Fukalov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 03:54:09 PST 2017


dfukalov added inline comments.


================
Comment at: include/llvm/Analysis/ScalarEvolution.h:1160
+    SmallVector<const SCEV *, 2> Ops = {LHS, RHS};
+    return getAddExpr(Ops, SCEV::FlagAnyWrap, Depth + 1);
+  }
----------------
hfinkel wrote:
> Increasing the depth here does not seem right - it is not a real recursion, but just a simple convenience wrapper.
These wrappers are called in a few places within getAddExpr implementation. If they are not supposed to be used there (but from "outside" users), I can modify such calls and remove depth parameter.


https://reviews.llvm.org/D28158





More information about the llvm-commits mailing list