[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
Wed Sep 27 12:18:38 PDT 2023
================
@@ -7510,6 +7531,10 @@ SDValue RISCVTargetLowering::lowerINSERT_VECTOR_ELT(SDValue Op,
Policy = RISCVII::TAIL_AGNOSTIC;
SDValue Slideup = getVSlideup(DAG, Subtarget, DL, ContainerVT, Vec, ValInVec,
Idx, Mask, InsertVL, Policy);
+
+ if (ContainerVT != OrigContainerVT)
+ Slideup = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, OrigContainerVT, OrigVec,
+ Slideup, DAG.getVectorIdxConstant(0, DL));
if (!VecVT.isFixedLengthVector())
return Slideup;
return convertFromScalableVector(VecVT, Slideup, DAG, Subtarget);
----------------
lukel97 wrote:
Making a mental note here re: #65997, all the return paths here should be covered by a reinsert into the correct original vector type after shrinking
https://github.com/llvm/llvm-project/pull/66087
More information about the llvm-commits
mailing list