[clang] [llvm] [LLVM] Fix incorrect alignment on AMDGPU variadics (PR #96370)
Joseph Huber via cfe-commits
cfe-commits at lists.llvm.org
Sat Jun 22 04:51:42 PDT 2024
jhuber6 wrote:
> > Here, because the minimum alignment is 4, we will only increment the
> > buffer by 4,
>
> It should be incrementing by the size? 4 byte aligned access of 8 byte type should work fine
Guess that's an AMD thing, so I'm going to assume that @JonChesterfield wrote this intentionally to save on stack space? I suppose the issue I'm having with my `printf` implementation is that we then want to copy this struct and because it doesn't follow natural alignment the person printing it doesn't know where these are stored in a common sense. I suppose I could change the code to just be `ptr += sizeof(T)` instead of doing the alignment, but I feel like some architectures require strict alignment for these and it wouldn't work in the general case.
https://github.com/llvm/llvm-project/pull/96370
More information about the cfe-commits
mailing list