[clang] [llvm] [NVPTX] Support short entry param pointers (PR #206512)

Alex MacLean via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 09:41:51 PDT 2026


================
@@ -4060,11 +4060,13 @@ SDValue NVPTXTargetLowering::LowerFormalArguments(
     SelectionDAG &DAG, SmallVectorImpl<SDValue> &InVals) const {
   const DataLayout &DL = DAG.getDataLayout();
   LLVMContext &Ctx = *DAG.getContext();
-  auto PtrVT = getPointerTy(DAG.getDataLayout());
 
   const Function &F = DAG.getMachineFunction().getFunction();
   const bool IsKernel = isKernelFunction(F);
 
+  const MVT PtrVT = getPointerTy(DL, IsKernel ? ADDRESS_SPACE_ENTRY_PARAM
+                                              : ADDRESS_SPACE_LOCAL);
----------------
AlexMaclean wrote:

EVTs don't store the address space in the type (unlike LLVM types) so this isn't as impactful of a change as it might look at first. All we're doing here is making the size of the integer type dependent on the size of pointers in a non-generic AS which matters for short-ptr. 

> Using param space pointer presumably assumes availability of cvta.param instruction and that is gated by the PTX version (>=7.7) and GPU variant (sm_70+).

This won't have any impact on `cvta.param` generation. We need these anywhere a ASC to/from `param` AS is used and this does not introduce any more of these nodes. 

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


More information about the cfe-commits mailing list