[PATCH] D135708: [NVPTX] Fix alignment for arguments of function pointer calls
Luke Drummond via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 12 03:45:45 PDT 2022
ldrumm added subscribers: asavonic, kovdan01, tra.
ldrumm added a comment.
> Index: llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
> ==================================================
>
> - llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
>
> +++ llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
> @@ -4326,8 +4326,13 @@
> const uint64_t ABITypeAlign = DL.getABITypeAlign(ArgTy).value();
>
> // If a function has linkage different from internal or private, we
>
> - // must use default ABI alignment as external users rely on it.
> - if (!(F && F->hasLocalLinkage()))
>
> + // must use default ABI alignment as external users rely on it. Same
> + // for a function that may be called from a function pointer.
> + if (!F || !F->hasLocalLinkage()) ||
> + F->hasAddressTaken(/*Users=*/nullptr,
> + /*IgnoreCallbackUses=*/false,
> + /*IgnoreAssumeLikeCalls=*/true,
> + /*IngoreLLVMUsed=*/true))
> return Align(ABITypeAlign);
>
> assert(!isKernelFunction(*F) && "Expect kernels to have non-local
> linkage");
s/IngoreLLVMUsed/IgnoreLLVMUsed/g
otherwise LGTM
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135708/new/
https://reviews.llvm.org/D135708
More information about the llvm-commits
mailing list