[llvm] [RISCV] Reduce LMUL when index is known when lowering insert_vector_elt (PR #66087)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 03:09:16 PDT 2023


================
@@ -7401,6 +7401,19 @@ SDValue RISCVTargetLowering::lowerINSERT_VECTOR_ELT(SDValue Op,
     Vec = convertToScalableVector(ContainerVT, Vec, DAG, Subtarget);
   }
 
+  MVT OrigContainerVT = ContainerVT;
+  SDValue OrigVec = Vec;
+  // If we know the index we're going to insert at, we can shrink down Vec so
+  // we're performing the vslide1down on a smaller LMUL.
----------------
lukel97 wrote:

Yeah, I updated the comment in https://github.com/llvm/llvm-project/pull/66087/commits/0ec8328a5f772860f9430448de7e14c2c15c2562

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


More information about the llvm-commits mailing list