[PATCH] D120494: [NVPTX][AsmPrinter] Respect metadata 'align' for aggregate input parameters

Kristina Bessonova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 13:08:13 PST 2022


krisb added a comment.
Herald added a project: All.

In D120494#3343880 <https://reviews.llvm.org/D120494#3343880>, @tra wrote:

> What is the problem the patch is intended to solve? To allow better vectorization of param-space loads/stores ?

I guess it may help vectorization, but I do not have a particular use case. 
My main motivation is to make this consistent: we already handle this metadata while emitting an aggregate as a return value, but ignore it for parameters, which is a bit unexpected if this is the same aggregate.



================
Comment at: llvm/test/CodeGen/NVPTX/align-annotation.ll:27
+
+!5 = !{%struct.S1_t (%struct.S1_t)* @_Z5dummy4S1_t, !"align", i32 32, !"align", i32 65568}
----------------
tra wrote:
> Does clang generate this metadata?  AFAICT, it does not. https://godbolt.org/z/s9EYbdfjT
> Where is this metadata expected to come from?
> 
Hmm, I looked at clang, and, surprisingly, it indeed doesn't generate `align` property, yet it generates all the other properties of `nvvm.annotations` metadata. We might add `align` to clang for the sake of completeness.
However, clang support does not matter much in this context (it could be different frontends or users could write IR manually as `align` is defined in NVVM IR specification). It appears that the backend already supports the metadata; so this patch does not introduce a new one, it just makes the existing a bit more consistent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120494



More information about the llvm-commits mailing list