[PATCH] D152386: [LoadStoreVectorizer] Only upgrade align for alloca

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 11:59:52 PDT 2023


tra added a comment.

Can you think of a test that would directly demonstrate effect of the patch on the alignment?

I think the current test does it indirectly. We manage to vectorize  loads/stores when we promote the alignment (though the test cases are inexplicably labeled `UNALIGNED`), and do it per-element otherwise.
At the very least, we should add a comment there explaining what the vectorization or lack of it indicates.



================
Comment at: llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/adjust-alloca-alignment.ll:281
 define void @private_store_2xi16_align2_not_alloca(ptr addrspace(5) %p, ptr addrspace(5) %r) #0 {
-; CHECK-LABEL: @private_store_2xi16_align2_not_alloca(
-; ALIGNED-NEXT:  [[GEP_R:%.*]] = getelementptr i16, ptr addrspace(5) [[R:%.*]], i32 1
-; ALIGNED-NEXT:  store i16 1, ptr addrspace(5) [[R]], align 2
-; ALIGNED-NEXT:  store i16 2, ptr addrspace(5) [[GEP_R]], align 2
-; UNALIGNED-NEXT:store <2 x i16>
-; CHECK-NEXT:    ret void
+; ALIGNED-LABEL: @private_store_2xi16_align2_not_alloca(
+; ALIGNED-NEXT:    [[GEP_R:%.*]] = getelementptr i16, ptr addrspace(5) [[R:%.*]], i32 1
----------------
Nit: I'd suggest keeping the common  `CHECK-LABEL`, instead of replicating it for aligned/unaligned variants.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152386



More information about the llvm-commits mailing list