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

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 10:36:25 PDT 2023


bjope created this revision.
bjope added reviewers: jlebar, tra, arsenm.
Herald added subscribers: kerbowa, hiraditya, jvesely.
Herald added a project: All.
bjope requested review of this revision.
Herald added subscribers: pcwang-thead, wdng.
Herald added a project: LLVM.

In commit 2be0abb7fe72ed453 <https://reviews.llvm.org/rG2be0abb7fe72ed4537b3eabcd3102d48ea845717> (D149893 <https://reviews.llvm.org/D149893>) the load store vectorized was
reimplemented. One thing that can happen with the new LSV is that
it can increase the align of alloca and global objects. However,
the code comments indicate that the intention only was to increase
alignment of alloca.
This patch is using stripInBoundsOffsets to analyse if the load/store
actually is accessing an alloca. And then we only try to change the
align if we find an alloca instruction. This way the actual code will
match better with code comments (and we won't see that alignment is
changed to 4 bytes, for global variables, just because the load
store vectorizer assumes that it is fine for align stack variables
at a four byte boundary).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152386

Files:
  llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
  llvm/test/Transforms/LoadStoreVectorizer/AMDGPU/adjust-alloca-alignment.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152386.529360.patch
Type: text/x-patch
Size: 11511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/1514f40d/attachment-0001.bin>


More information about the llvm-commits mailing list