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

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 18:17:37 PDT 2024


================
@@ -66,6 +66,25 @@ void RISCVDAGToDAGISel::PreprocessISelDAG() {
           VT.isInteger() ? RISCVISD::VMV_V_X_VL : RISCVISD::VFMV_V_F_VL;
       SDLoc DL(N);
       SDValue VL = CurDAG->getRegister(RISCV::X0, Subtarget->getXLenVT());
+
+      if (VT.isRISCVVectorTuple()) {
+        unsigned NF = VT.getRISCVVectorTupleNumFields();
+        unsigned NumScalElts = VT.getSizeInBits() / (NF * 8);
+        SDValue EltVal = CurDAG->getConstant(0, DL, Subtarget->getXLenVT());
----------------
4vtomat wrote:

Yeah, good idea!

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


More information about the llvm-commits mailing list