[clang] [Clang][CUDA] Preserve addresses of scalar grid-constant parameters (PR #231567)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 21 10:16:53 PST 2026


================
@@ -670,6 +672,10 @@ class CGFunctionInfo final
 
   unsigned NumArgs;
 
+  /// Indices of CUDA grid-constant arguments. These affect ABI classification
+  /// but are not part of the source function type.
+  size_t NumGridConstantArgs;
----------------
Artem-B wrote:

Nit: `unsigned NumGridConstantArgs;` (matching `unsigned NumArgs;` right above it, since `NumGridConstantArgs <= NumArgs`) avoids widening every `CGFunctionInfo` by 8 bytes instead of 4 on 64-bit hosts.

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


More information about the cfe-commits mailing list