[llvm] [NVPTX] Vectorize loads when lowering of byval calls, misc. cleanup (PR #151070)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 29 16:46:11 PDT 2025


================
@@ -382,6 +382,51 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
   }
 }
 
+static EVT getVectorizedVT(EVT VT, unsigned N, LLVMContext &C) {
----------------
Artem-B wrote:

This could use a comment. 

We return an EVT that can hold N VTs
If the VT is a vector, the resulting EVT is a flat vector with the same element type as VT's element type (as opposed to N-element vector of VT vectors).

If may be better for readability to restructure the code so we don't need to explain it as a comment:
```
   return VT.isVector()
        ? EVT::getVectorVT(C, VT.getScalarType(), VT.getVectorNumElements()  * N)
        : EVT::getVectorVT(C, VT, N);
```

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


More information about the llvm-commits mailing list