[PATCH] D62563: Fix incorrect expand of non-linear addrecs

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 14:07:59 PDT 2019


reames requested changes to this revision.
reames added inline comments.
This revision now requires changes to proceed.


================
Comment at: include/llvm/Analysis/ScalarEvolutionExpressions.h:347
+    ///
+    /// Note that for the resulting expression to be correct the iteration
+    /// number can't be narrower than what
----------------
Does this mean that evaluateAtIteration may return an incorrect result?  If so, I'd very much like to see an assert which trips on that usage.  


================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:1486
+  // back to non-canonical mode for non-affine addrecs.
+  if (!CanonicalMode || !S->isAffine())
+    return expandAddRecExprLiterally(S);
----------------
How about only falling back to literal expansion for non-affine addrecs which actually need the wider expansion?


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

https://reviews.llvm.org/D62563





More information about the llvm-commits mailing list