Skip to content

Commit

Permalink
[RISCV][NFC] Get rid of additional unneeded static_cast around RISCVS…
Browse files Browse the repository at this point in the history
…ubtarget

Some similar cases to 60152f1.
  • Loading branch information
asb committed Jul 20, 2023
1 parent d6b0af0 commit cde5e42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RISCVExpandAtomicPseudo : public MachineFunctionPass {
char RISCVExpandAtomicPseudo::ID = 0;

bool RISCVExpandAtomicPseudo::runOnMachineFunction(MachineFunction &MF) {
TII = static_cast<const RISCVInstrInfo *>(MF.getSubtarget().getInstrInfo());
TII = MF.getSubtarget<RISCVSubtarget>().getInstrInfo();

#ifndef NDEBUG
const unsigned OldSize = getInstSizeInBytes(MF);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ class RISCVPreRAExpandPseudo : public MachineFunctionPass {
char RISCVPreRAExpandPseudo::ID = 0;

bool RISCVPreRAExpandPseudo::runOnMachineFunction(MachineFunction &MF) {
TII = static_cast<const RISCVInstrInfo *>(MF.getSubtarget().getInstrInfo());
TII = MF.getSubtarget<RISCVSubtarget>().getInstrInfo();

#ifndef NDEBUG
const unsigned OldSize = getInstSizeInBytes(MF);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ bool RISCVPushPopOpt::runOnMachineFunction(MachineFunction &Fn) {
if (Fn.getTarget().Options.DisableFramePointerElim(Fn))
return false;

TII = static_cast<const RISCVInstrInfo *>(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
Expand Down

0 comments on commit cde5e42

Please sign in to comment.