[PATCH] D23176: [LoopVectorizer] Fixed a bug in memory conflict run-time check

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 22:25:03 PDT 2016


anemet added a comment.

Did you forget to add the test?


================
Comment at: ../lib/Analysis/LoopAccessAnalysis.cpp:186
@@ -185,1 +185,3 @@
     }
+    // Add the size of the pointed element to ScEnd.
+    unsigned EltSize =
----------------
Ayal wrote:
> Worth commenting that this is needed when pointers are not naturally aligned (as in your "*(reinterpret_cast<long long*>(op)) = *(reinterpret_cast<const long long*>(src))" case of i8*'s discussed re: D20789), or a pair of pointers point to elements of distinct sizes.
> 
> Put differently, we can do w/o adding this size to ScEnd if all pointers point to naturally aligned data of same size (as in number-of-memchecks.ll  below).
> 
> 
> >(It may be "last memory access pointer + element size -1", since we use "<=" in bounds condition)
> 
> So, want to subtract 1 from EltSize?
or use < instead of <=.  I remember wondering about why we were using <=

I would also be good to finally have the full mathematical formula in comment somewhere.


Repository:
  rL LLVM

https://reviews.llvm.org/D23176





More information about the llvm-commits mailing list