Skip to content

Commit aa8e2af

Browse files
fixup! VL operand is never x0
1 parent de60e95 commit aa8e2af

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
@@ -967,8 +967,7 @@ bool RISCVVLOptimizer::checkUsers(const MachineOperand *&CommonVL,
967967
const MCInstrDesc &Desc = UserMI.getDesc();
968968
unsigned VLOpNum = RISCVII::getVLOpNum(Desc);
969969
const MachineOperand &VLOp = UserMI.getOperand(VLOpNum);
970-
if ((VLOp.isReg() && VLOp.getReg() != RISCV::X0) ||
971-
(VLOp.isImm() && VLOp.getImm() != 0)) {
970+
if (VLOp.isReg() || (VLOp.isImm() && VLOp.getImm() != 0)) {
972971
if (!CommonVL) {
973972
CommonVL = &VLOp;
974973
continue;

0 commit comments

Comments
 (0)