[PATCH] D97698: [RISCV] Support fixed-length INSERT_VECTOR_ELT

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 10:08:52 PST 2021


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2214
       return Op;
-    SDValue Mask, VL;
-    std::tie(Mask, VL) = getDefaultScalableVLOps(VecVT, DL, DAG, Subtarget);
-    SDValue Slidedown = DAG.getNode(RISCVISD::VSLIDEDOWN_VL, DL, VecVT,
-                                    DAG.getUNDEF(VecVT), Vec, Idx, Mask, VL);
+    SDValue Slidedown =
+        DAG.getNode(RISCVISD::VSLIDEDOWN_VL, DL, ContainerVT,
----------------
frasercrmck wrote:
> Am I right in thinking we don't need to slide down: we set the VL to `insert_index + 1` and slide a vector with the element in the first position up by `insert_index`, while tying the original vector to the output?
I think that's right.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/fixed-vectors-insert.ll:23
+; RV32-NEXT:    vid.v v30
+; RV32-NEXT:    vsetvli a1, zero, e64,m2,ta,mu
+; RV32-NEXT:    vmseq.vi v0, v30, 3
----------------
Was it intended to switch to VLMAX here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97698/new/

https://reviews.llvm.org/D97698



More information about the llvm-commits mailing list