[PATCH] D43759: [SCEV] Smarter logic in computeConstantDifference

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 1 02:51:37 PST 2018


mkazantsev added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:9396
+  if (auto *Difference = dyn_cast<SCEVConstant>(
+          getMinusSCEV(More, Less, SCEV::FlagAnyWrap, MaxArithDepth - 1)))
+    return Difference->getAPInt();
----------------
sanjoy wrote:
> I'd much rather not put all of this (albeit non-recursive) work here when it is possible to easily extend the existing code to handle your pattern.
Do we really want to add every easy pattern we find here in future just because it is easy? It looks counter-general. And we don't know how many other relatively simple cases we do not handle.


https://reviews.llvm.org/D43759





More information about the llvm-commits mailing list