[llvm] [RISCV][NFC] Combine redundant 'if' statements (PR #70423)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 29 23:06:16 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) {
----------------
topperc wrote:

No else after `if` that returns.

https://github.com/llvm/llvm-project/pull/70423


More information about the llvm-commits mailing list