Skip to content

Commit 984c3cc

Browse files
Bail if the vector element's types don't match
Signed-off-by: Mikhail R. Gadelha <[email protected]>
1 parent 8eb53a9 commit 984c3cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3500,6 +3500,10 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
35003500
// FIXME: Support i1 vectors, maybe by promoting to i8?
35013501
if (VT.getVectorElementType() == MVT::i1)
35023502
return SDValue();
3503+
// Additionally the element types should match
3504+
if (Vec.getSimpleValueType().getVectorElementType() !=
3505+
VT.getVectorElementType())
3506+
return SDValue();
35033507
SDValue Idx = SplatVal.getOperand(1);
35043508
// The index must be a legal type.
35053509
if (Idx.getValueType() != Subtarget.getXLenVT())

0 commit comments

Comments
 (0)