[PATCH] D21935: Add TLI.allowsMisalignedMemoryAccesses to LoadStoreVectorizer

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 11:01:44 PDT 2016


jlebar accepted this revision.
This revision is now accepted and ready to land.

================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:391
@@ -390,1 +390,3 @@
 
+  /// \brief Indicate whether target allows misaligned memory accesses
+  bool allowsMisalignedMemoryAccesses(unsigned BitWidth, unsigned AddressSpace = 0,
----------------
sgtm

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:702
@@ -697,2 +701,3 @@
+      (Alignment % SzInBytes) != 0 && (Alignment % TargetBaseAlign) != 0) {
     if (S0->getPointerAddressSpace() == 0) {
       // If we're storing to an object on the stack, we control its alignment,
----------------
I still think it might make sense to move the (Alignment % SzInBytes) != 0 && (Alignment % TargetBaseAlign) != 0 checks into the helper function (currently called allowsMisalignedAndIsFast, would need a new name).  But, up to you.


http://reviews.llvm.org/D21935





More information about the llvm-commits mailing list