Skip to content

Commit fcf4d81

Browse files
fixup! VL operand is never x0
1 parent 3fc5297 commit fcf4d81

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/RISCV/RISCVVLOptimizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,7 @@ bool RISCVVLOptimizer::checkUsers(const MachineOperand *&CommonVL,
10701070
const MCInstrDesc &Desc = UserMI.getDesc();
10711071
unsigned VLOpNum = RISCVII::getVLOpNum(Desc);
10721072
const MachineOperand &VLOp = UserMI.getOperand(VLOpNum);
1073-
if ((VLOp.isReg() && VLOp.getReg() != RISCV::X0) ||
1074-
(VLOp.isImm() && VLOp.getImm() != 0)) {
1073+
if (VLOp.isReg() || (VLOp.isImm() && VLOp.getImm() != 0)) {
10751074
if (!CommonVL) {
10761075
CommonVL = &VLOp;
10771076
continue;

0 commit comments

Comments
 (0)