[llvm] [NVPTX] Fix crash caused by ComputePTXValueVTs (PR #104524)

Justin Fargnoli via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 15:46:13 PDT 2024


================
@@ -207,10 +207,15 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
     if (VT.isVector()) {
       unsigned NumElts = VT.getVectorNumElements();
       EVT EltVT = VT.getVectorElementType();
-      // Vectors with an even number of f16 elements will be passed to
-      // us as an array of v2f16/v2bf16 elements. We must match this so we
-      // stay in sync with Ins/Outs.
-      if ((Is16bitsType(EltVT.getSimpleVT())) && NumElts % 2 == 0) {
+      // We require power-of-2 sized vectors becuase
+      // TargetLoweringBase::getVectorTypeBreakdown() which is invoked in
+      // ComputePTXValueVTs() cannot currently break down non-power-of-2 sized
+      // vectors.
----------------
justinfargnoli wrote:

Added this comment in response to: https://github.com/llvm/llvm-project/pull/104524#discussion_r1733645755

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


More information about the llvm-commits mailing list