[PATCH] Exit ScalarEvolution::getMulExpr Early when Choose Overflows

Nick Lewycky nicholas at mxc.ca
Sun Aug 31 22:35:19 PDT 2014


================
Comment at: lib/Analysis/ScalarEvolution.cpp:2120
@@ -2094,3 +2119,3 @@
           const SCEV *Term = getConstant(Ty, 0);
           for (int y = x, ye = 2*x+1; y != ye && !Overflow; ++y) {
             uint64_t Coeff1 = Choose(x, 2*x - y, Overflow);
----------------
You tested whether we'll overflow up front. Is that the exact case where we overflow or does it only catch some of the cases where we overflow? If it's exactly right, then we can stop updating and checking Overflow in here, right?

================
Comment at: test/Analysis/ScalarEvolution/choose-overflow-fast.ll:1
@@ +1,2 @@
+; RUN: opt < %s -iv-users
+
----------------
Can you use "opt < %s -analyze -scalar-evolution" instead?

http://reviews.llvm.org/D5113






More information about the llvm-commits mailing list