[PATCH] D35990: [SCEV] Prohibit SCEV transformations for huge SCEVs

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 09:42:11 PST 2019


sanjoy added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:862
+
+static bool hasHugeExpression(SmallVectorImpl<const SCEV *> &Ops) {
+  return any_of(Ops, isHugeExpression);
----------------
mkazantsev wrote:
> reames wrote:
> > Probably better to use an ArrayRef as the argument.
> SCEV uses `SmallVectorImpl` to pass argument lists in all places. What you propose is inconsistent with the current code. We can do a global refactoring if there is any benefit from it.
SCEV uses `SmallVectorImpl` in many places because it needs to modify the container in place (e.g. `getAddExpr` will reduce the size of `SmallVectorImpl` in place when folding constants).  Functions that do not modify the input sequence in place should use `ArrayRef`.


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

https://reviews.llvm.org/D35990





More information about the llvm-commits mailing list