[llvm] [RISCV] Update matchSplatAsGather to convert vectors if they have different sizes (PR #117878)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 2 17:58:24 PST 2024
================
@@ -3496,21 +3496,26 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
if (SplatVal.getOpcode() != ISD::EXTRACT_VECTOR_ELT)
return SDValue();
SDValue Vec = SplatVal.getOperand(0);
- // Only perform this optimization on vectors of the same size for simplicity.
// Don't perform this optimization for i1 vectors.
// FIXME: Support i1 vectors, maybe by promoting to i8?
- if (Vec.getValueType() != VT || VT.getVectorElementType() == MVT::i1)
+ if (VT.getVectorElementType() == MVT::i1)
return SDValue();
SDValue Idx = SplatVal.getOperand(1);
// The index must be a legal type.
if (Idx.getValueType() != Subtarget.getXLenVT())
return SDValue();
+ if (Vec.getValueSizeInBits().getKnownMinValue() >
----------------
topperc wrote:
The check in isKnownLE allows LHS to be fixed and RHS to be scalable. I haven't yet checked if that's ok here.
https://github.com/llvm/llvm-project/pull/117878
More information about the llvm-commits
mailing list