diff --git a/llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp b/llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp index 967df35b4c447..59f1e8319ae72 100644 --- a/llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp +++ b/llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp @@ -72,7 +72,7 @@ class RISCVExpandAtomicPseudo : public MachineFunctionPass { char RISCVExpandAtomicPseudo::ID = 0; bool RISCVExpandAtomicPseudo::runOnMachineFunction(MachineFunction &MF) { - TII = static_cast(MF.getSubtarget().getInstrInfo()); + TII = MF.getSubtarget().getInstrInfo(); #ifndef NDEBUG const unsigned OldSize = getInstSizeInBytes(MF); diff --git a/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp b/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp index 6bb388f8e2222..6073d95c800ae 100644 --- a/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp +++ b/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp @@ -394,7 +394,7 @@ class RISCVPreRAExpandPseudo : public MachineFunctionPass { char RISCVPreRAExpandPseudo::ID = 0; bool RISCVPreRAExpandPseudo::runOnMachineFunction(MachineFunction &MF) { - TII = static_cast(MF.getSubtarget().getInstrInfo()); + TII = MF.getSubtarget().getInstrInfo(); #ifndef NDEBUG const unsigned OldSize = getInstSizeInBytes(MF); diff --git a/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp b/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp index 5eb990f19562f..a93e750eadc6f 100644 --- a/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp +++ b/llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp @@ -121,7 +121,7 @@ bool RISCVPushPopOpt::runOnMachineFunction(MachineFunction &Fn) { if (Fn.getTarget().Options.DisableFramePointerElim(Fn)) return false; - TII = static_cast(Subtarget->getInstrInfo()); + TII = Subtarget->getInstrInfo(); TRI = Subtarget->getRegisterInfo(); // Resize the modified and used register unit trackers. We do this once // per function and then clear the register units each time we determine