[llvm] [NVPTX] Generalize and extend upsizing when lowering 8/16-bit-element vector loads/stores (PR #119622)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 11:58:25 PST 2024


================
@@ -3185,10 +3205,15 @@ NVPTXTargetLowering::LowerSTOREVector(SDValue Op, SelectionDAG &DAG) const {
     case MVT::v4f16:
     case MVT::v4bf16:
     case MVT::v4f32:
-    case MVT::v8f16: // <4 x f16x2>
+      // This is a "native" vector type
+      break;
+    case MVT::v8i8:   // <2 x i8x4>
+    case MVT::v8f16:  // <4 x f16x2>
     case MVT::v8bf16: // <4 x bf16x2>
     case MVT::v8i16:  // <4 x i16x2>
-      // This is a "native" vector type
+    case MVT::v16i8:  // <4 x i8x4>
+      // This can be upsized into a "native" vector type
+      UpsizeElementTypes = true;
----------------
Artem-B wrote:

Fair enough. So, the answers we're looking for are: should we handle this vector, and if so, how.

That asks for either returning a `std::optional<std::pair<>>` or just represent "can't do it" as `NumElts == 0`.
The latter is probably more concise. The function entry would look roughly like this:
```
auto NumElts, EltType = getVectorLoweringParams(Val);
if (NumElts == 0)
  return SDValue();

... lower as `NumElts x EltType`.
```


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


More information about the llvm-commits mailing list