Skip to content

Commit b1fe070

Browse files
committed
Remove unnecessary VL select
1 parent 51102a4 commit b1fe070

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3287,25 +3287,24 @@ bool RISCVDAGToDAGISel::selectVSplatUimm(SDValue N, unsigned Bits,
32873287
}
32883288

32893289
bool RISCVDAGToDAGISel::selectLow8BitsVSplat(SDValue N, SDValue &SplatVal) {
3290-
auto IsVLNode = [this](SDValue N) {
3290+
auto IsExtOrTrunc = [](SDValue N) {
32913291
switch (N->getOpcode()) {
3292+
case ISD::SIGN_EXTEND:
3293+
case ISD::ZERO_EXTEND:
3294+
// There's no passthru on these _VL nodes so any VL/mask is ok, since any
3295+
// inactive elements will be undef.
32923296
case RISCVISD::TRUNCATE_VECTOR_VL:
32933297
case RISCVISD::VSEXT_VL:
32943298
case RISCVISD::VZEXT_VL:
3295-
break;
3299+
return true;
32963300
default:
32973301
return false;
32983302
}
3299-
SDValue VL;
3300-
selectVLOp(N->getOperand(2), VL);
3301-
// There's no passthru so any mask is ok, since any inactive elements will
3302-
// be undef.
33033303
return true;
33043304
};
33053305

33063306
// We can have multiple nested nodes, so unravel them all if needed.
3307-
while (N->getOpcode() == ISD::SIGN_EXTEND ||
3308-
N->getOpcode() == ISD::ZERO_EXTEND || IsVLNode(N)) {
3307+
while (IsExtOrTrunc(N)) {
33093308
if (!N.hasOneUse() ||
33103309
N.getValueType().getSizeInBits().getKnownMinValue() < 8)
33113310
return false;

0 commit comments

Comments
 (0)