Skip to content

Commit 7f83c93

Browse files
committed
Address review comments
1 parent b06b9a3 commit 7f83c93

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5269,8 +5269,8 @@ static SDValue lowerDisjointIndicesShuffle(ShuffleVectorSDNode *SVN,
52695269
/// cost, at the cost of (possibly) an extra VTYPE toggle.
52705270
static SDValue tryWidenMaskForShuffle(SDValue Op, SelectionDAG &DAG) {
52715271
SDLoc DL(Op);
5272-
EVT VT = Op.getValueType();
5273-
EVT ScalarVT = VT.getVectorElementType();
5272+
MVT VT = Op.getSimpleValueType();
5273+
MVT ScalarVT = VT.getVectorElementType();
52745274
unsigned ElementSize = ScalarVT.getFixedSizeInBits();
52755275
SDValue V0 = Op.getOperand(0);
52765276
SDValue V1 = Op.getOperand(1);
@@ -5281,20 +5281,17 @@ static SDValue tryWidenMaskForShuffle(SDValue Op, SelectionDAG &DAG) {
52815281
return SDValue();
52825282

52835283
SmallVector<int, 8> NewMask;
5284-
if (widenShuffleMaskElts(Mask, NewMask)) {
5285-
MVT NewEltVT = VT.isFloatingPoint()
5286-
? MVT::getFloatingPointVT(ElementSize * 2)
5287-
: MVT::getIntegerVT(ElementSize * 2);
5288-
MVT NewVT = MVT::getVectorVT(NewEltVT, VT.getVectorNumElements() / 2);
5289-
if (DAG.getTargetLoweringInfo().isTypeLegal(NewVT)) {
5290-
V0 = DAG.getBitcast(NewVT, V0);
5291-
V1 = DAG.getBitcast(NewVT, V1);
5292-
return DAG.getBitcast(VT,
5293-
DAG.getVectorShuffle(NewVT, DL, V0, V1, NewMask));
5294-
}
5295-
}
5284+
if (!widenShuffleMaskElts(Mask, NewMask))
5285+
return SDValue();
52965286

5297-
return SDValue();
5287+
MVT NewEltVT = VT.isFloatingPoint() ? MVT::getFloatingPointVT(ElementSize * 2)
5288+
: MVT::getIntegerVT(ElementSize * 2);
5289+
MVT NewVT = MVT::getVectorVT(NewEltVT, VT.getVectorNumElements() / 2);
5290+
if (!DAG.getTargetLoweringInfo().isTypeLegal(NewVT))
5291+
return SDValue();
5292+
V0 = DAG.getBitcast(NewVT, V0);
5293+
V1 = DAG.getBitcast(NewVT, V1);
5294+
return DAG.getBitcast(VT, DAG.getVectorShuffle(NewVT, DL, V0, V1, NewMask));
52985295
}
52995296

53005297
static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,

0 commit comments

Comments
 (0)