[PATCH] D15412: [SCEV][LAA] Add no overflow SCEV predicates and use use them to improve strided pointer detection

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 21:57:48 PST 2016


sanjoy added a comment.

SCEV bits lgtm with minor nits inline.


================
Comment at: include/llvm/Analysis/ScalarEvolution.h:297
@@ +296,3 @@
+    /// extending affine AddRec SCEV expressions when a SCEVWrapPredicate is
+    /// assumed. A {base,+,inc} expression is already commutative with
+    /// regards to base and inc, since it is interpreted as:
----------------
Do you mean "is already **non-commutative**"?

================
Comment at: include/llvm/Analysis/ScalarEvolution.h:303
@@ +302,3 @@
+      IncrementNUSW = (1 << 0), // No unsigned with signed increment wrap.
+      IncrementNSSW = (1 << 1), // No signed with signed increment wrap.
+      IncrementNoWrapMask = (1 << 2) - 1
----------------
This is much better, thanks!  Might be helpful to clarify htat NSSW is basically nsw, but NUSW is a hybrid specific to `SCEVWrapPredicate`.

================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:2011
@@ +2010,3 @@
+  if (Pred->getFlags() & SCEVWrapPredicate::IncrementNSSW)
+    Check = Builder.CreateOr(generateOverflowCheck(A, IP, true), Check);
+
----------------
I'd suggest not generating the redundant or instruction, since it is easy to avoid here.


http://reviews.llvm.org/D15412





More information about the llvm-commits mailing list