[llvm] [NVPTX] Make i16x2 a native type and add supported vec instructions (PR #65432)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 11:52:27 PDT 2023


================
@@ -207,8 +209,13 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
       // 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 ((Isf16Orbf16Type(EltVT.getSimpleVT())) && NumElts % 2 == 0) {
-        EltVT = EltVT == MVT::f16 ? MVT::v2f16 : MVT::v2bf16;
+      if ((Is16bitsType(EltVT.getSimpleVT())) && NumElts % 2 == 0) {
+        if (EltVT == MVT::f16)
----------------
Artem-B wrote:

Nit: I'd use `switch(EltVT)`. This is fine, too.

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


More information about the llvm-commits mailing list