[llvm] 973bf4d - [RISCV] Remove unnecessary if guard before calling SignExtend64<6> in decodeCLUIImmOperand. NFC (#133514)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 28 15:46:06 PDT 2025


Author: Craig Topper
Date: 2025-03-28T15:46:02-07:00
New Revision: 973bf4d53b9cfac4400a9954d9c527092b238a86

URL: https://github.com/llvm/llvm-project/commit/973bf4d53b9cfac4400a9954d9c527092b238a86
DIFF: https://github.com/llvm/llvm-project/commit/973bf4d53b9cfac4400a9954d9c527092b238a86.diff

LOG: [RISCV] Remove unnecessary if guard before calling SignExtend64<6> in decodeCLUIImmOperand. NFC (#133514)

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
index e2a98e8bbbf4e..28c0623776977 100644
--- a/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
+++ b/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
@@ -455,8 +455,7 @@ static DecodeStatus decodeCLUIImmOperand(MCInst &Inst, uint32_t Imm,
   assert(isUInt<6>(Imm) && "Invalid immediate");
   if (Imm == 0)
     return MCDisassembler::Fail;
-  if (Imm > 31)
-    Imm = (SignExtend64<6>(Imm) & 0xfffff);
+  Imm = SignExtend64<6>(Imm) & 0xfffff;
   Inst.addOperand(MCOperand::createImm(Imm));
   return MCDisassembler::Success;
 }


        


More information about the llvm-commits mailing list