[llvm] [RISCV] Handle zeroinitializer of vector tuple Type (PR #113995)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 22:35:22 PST 2024


================
@@ -1896,6 +1896,17 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
                          DAG.getConstant(0, getCurSDLoc(), MVT::nxv16i1));
     }
 
+    if (VT.isRISCVVectorTuple()) {
+      assert(C->isNullValue() && "Can only zero this target type!");
+      return NodeMap[V] = DAG.getNode(
+                 ISD::BITCAST, getCurSDLoc(), VT,
+                 DAG.getNode(
+                     ISD::SPLAT_VECTOR, getCurSDLoc(),
+                     MVT::getScalableVectorVT(
+                         MVT::i8, VT.getSizeInBits().getKnownMinValue() / 8),
----------------
4vtomat wrote:

I see. After combined to RISCVISD, we should still expand to NF tuple insertions manually right?


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


More information about the llvm-commits mailing list