[PATCH] D23906: LSV: Fix incorrectly increasing alignment

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 11:36:12 PDT 2016


jlebar added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:800
@@ -802,1 +799,3 @@
+                                                   DL, S0, nullptr, &DT);
+    if (NewAlign <= Alignment)
       return false;
----------------
getOrEnforceKnownAlignment returns 0 on failure, maybe we should check for that instead?  (If you want, you could also assert that NewAlign is either 0 or >= StackAdjustedAlignment.)

================
Comment at: lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:1028
@@ -1031,1 +1027,3 @@
+  if (Alignment >= SzInBytes)
     return false;
+
----------------
Why this change?  It's equivalent to the old code assuming the alignment is a power of two (which, if we depend on this, we should assert?), but I don't see why we need to make the change at all.


https://reviews.llvm.org/D23906





More information about the llvm-commits mailing list