[clang] [llvm] [clang][CUDA] Avoid accounting for tail padding in LLVM offloading (PR #156229)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 17:01:39 PDT 2025


================
@@ -350,7 +351,15 @@ Address CGNVCUDARuntime::prepareKernelArgsLLVMOffload(CodeGenFunction &CGF,
       KernelLaunchParamsTy, CharUnits::fromQuantity(16),
       "kernel_launch_params");
 
-  auto KernelArgsSize = CGM.getDataLayout().getTypeAllocSize(KernelArgsTy);
+  // Avoid accounting the tail padding for the kernel arguments.
+  auto KernelArgsSize = llvm::TypeSize::getZero();
----------------
jhuber6 wrote:

I'm still a little iffy on this, what's the reason that we can't just mimic CUDA's handling? IIUC this is the old version where we passed these things through the `liboimptarget` interface. Wasn't there some effort to make a different one on top of libcudart?

https://github.com/llvm/llvm-project/pull/156229


More information about the llvm-commits mailing list