[PATCH] D80276: [Alignment] Fix misaligned interleaved loads

Nuno Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 20 07:02:28 PDT 2020


nlopes added inline comments.


================
Comment at: llvm/lib/Target/X86/X86InterleavedAccess.cpp:219
+    Instruction *NewLoad = Builder.CreateAlignedLoad(
+        VecBaseTy, NewBasePtr, NewBasePtr->getPointerAlignment(DL));
     DecomposedVectors.push_back(NewLoad);
----------------
at least iteration at 0 you could take LI->getAlign(), as it might be larger than ABI alignment. Propagating this larger alignment to subsequent loads requires a bit more code; not sure it's worth it.


================
Comment at: llvm/test/Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll:45
 ; CHECK-NEXT:    [[TMP2:%.*]] = getelementptr <4 x i64>, <4 x i64>* [[TMP1]], i32 0
-; CHECK-NEXT:    [[TMP3:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 16
+; CHECK-NEXT:    [[TMP3:%.*]] = load <4 x i64>, <4 x i64>* [[TMP2]], align 32
 ; CHECK-NEXT:    [[TMP4:%.*]] = getelementptr <4 x i64>, <4 x i64>* [[TMP1]], i32 1
----------------
craig.topper wrote:
> The original load was only align 16 how did we get to 32?
this is probably the ABI alignment for the vector is 32 bytes(?) and the code now will just take that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80276





More information about the llvm-commits mailing list