Skip to content

Commit bc8293d

Browse files
Rewrite as suggested by reviewer
Signed-off-by: Mikhail R. Gadelha <[email protected]>
1 parent e81105b commit bc8293d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3526,11 +3526,12 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
35263526
return SDValue();
35273527

35283528
// Check that we know Idx lies within VT
3529-
if (auto *CIdx = dyn_cast<ConstantSDNode>(Idx)) {
3530-
if (CIdx->getZExtValue() >= VT.getVectorElementCount().getKnownMinValue())
3529+
if (!TypeSize::isKnownLE(Vec.getValueSizeInBits(), VT.getSizeInBits())) {
3530+
auto *CIdx = dyn_cast(Idx);
3531+
if (!CIdx ||
3532+
CIdx->getZExtValue() >= VT.getVectorElementCount().getKnownMinValue())
35313533
return SDValue();
3532-
} else if (!TypeSize::isKnownLE(Vec.getValueSizeInBits(), VT.getSizeInBits()))
3533-
return SDValue();
3534+
}
35343535

35353536
// Convert fixed length vectors to scalable
35363537
MVT ContainerVT = VT;

0 commit comments

Comments
 (0)