[llvm] [RISCV][NFC] Combine redundant 'if' statements (PR #70423)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 29 23:10:21 PDT 2023
================
@@ -257,15 +248,12 @@ static DecodeStatus decodeVMaskReg(MCInst &Inst, uint64_t RegNo,
uint64_t Address,
const MCDisassembler *Decoder) {
MCRegister Reg = RISCV::NoRegister;
- switch (RegNo) {
- default:
+ if (RegNo > 2) {
return MCDisassembler::Fail;
- case 0:
+ } else if (RegNo == 0) {
----------------
knightXun wrote:
Because there is an initial default value in front, I omitted the "else" part.
https://github.com/llvm/llvm-project/pull/70423
More information about the llvm-commits
mailing list