diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index 8c39e25ccffc..1702546b58a6 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -10072,15 +10072,15 @@ static MachineBasicBlock *emitSelectPseudo(MachineInstr &MI, LastSelectPseudo = &*SequenceMBBI; SequenceMBBI->collectDebugValues(SelectDebugValues); SelectDests.insert(SequenceMBBI->getOperand(0).getReg()); - } else { - if (SequenceMBBI->hasUnmodeledSideEffects() || - SequenceMBBI->mayLoadOrStore()) - break; - if (llvm::any_of(SequenceMBBI->operands(), [&](MachineOperand &MO) { - return MO.isReg() && MO.isUse() && SelectDests.count(MO.getReg()); - })) - break; + continue; } + if (SequenceMBBI->hasUnmodeledSideEffects() || + SequenceMBBI->mayLoadOrStore()) + break; + if (llvm::any_of(SequenceMBBI->operands(), [&](MachineOperand &MO) { + return MO.isReg() && MO.isUse() && SelectDests.count(MO.getReg()); + })) + break; } const RISCVInstrInfo &TII = *Subtarget.getInstrInfo();