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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 16:44:40 PDT 2024


================
@@ -226,7 +227,8 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
         }
         NumElts /= 2;
       } else if (EltVT.getSimpleVT() == MVT::i8 &&
-                 (NumElts % 4 == 0 || NumElts == 3)) {
+                 ((NumElts % 4 == 0 && isPowerOf2_32(NumElts)) ||
----------------
Artem-B wrote:

This condition is rather puzzling. 
AFAICT, previously, we'd accept i8 vectors with multiples of 4 elements, and a special case of v3i8, and lowered them all as N * v4i8.

Now we'll only accept multiples of 4, that are also a power of 2 and it's not clear why. Is there any reason we should  be able to handle `v16i8` here but not `v12i8`?.

This, at the very least, needs a comment explaining what's going on, or, possibly, a change to the condition to better reflect what we're checking for here.


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


More information about the llvm-commits mailing list