[llvm] 8e199f0 - [RISCV] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 30 09:44:07 PDT 2025


Author: Kazu Hirata
Date: 2025-07-30T09:43:57-07:00
New Revision: 8e199f0f754dd263b3816705e650dded76273f66

URL: https://github.com/llvm/llvm-project/commit/8e199f0f754dd263b3816705e650dded76273f66
DIFF: https://github.com/llvm/llvm-project/commit/8e199f0f754dd263b3816705e650dded76273f66.diff

LOG: [RISCV] Fix a warning

This patch fixes:

  llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp:579:11: error: unused
  variable 'Subtarget' [-Werror,-Wunused-variable]

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp b/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
index af7b221c4c3b6..7e58b6f342689 100644
--- a/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
@@ -576,7 +576,6 @@ bool RISCVRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
     int64_t Val = Offset.getFixed();
     int64_t Lo12 = SignExtend64<12>(Val);
     unsigned Opc = MI.getOpcode();
-    auto &Subtarget = MF.getSubtarget<RISCVSubtarget>();
 
     if (Opc == RISCV::ADDI && !isInt<12>(Val)) {
       // We chose to emit the canonical immediate sequence rather than folding


        


More information about the llvm-commits mailing list