[PATCH] ScalarEvolution incorrectly assumes that the start of certain add recurrences don't overflow

hfinkel at anl.gov hfinkel at anl.gov
Sun Feb 8 11:33:36 PST 2015


================
Comment at: lib/Analysis/ScalarEvolution.cpp:1382
@@ -1368,1 +1381,3 @@
+  if (PreAR && PreAR->getNoWrapFlags(SCEV::FlagNSW) &&
+      L->getExitingBlock() == L->getLoopLatch())
     return PreStart;
----------------
I think that you need to make sure that both L->getExitingBlock() and L->getLoopLatch() are not nullptr (which could happen if there is no unique loop latch and also no unique exiting block). Otherwise, LGTM.

http://reviews.llvm.org/D7331

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list