From 8e8a62006ecae016cfc345c2ec97fb3574b76d61 Mon Sep 17 00:00:00 2001 From: Kito Cheng Date: Wed, 24 Aug 2022 23:39:17 +0800 Subject: [PATCH] [RISCV][NFC] Minor cleanup in RISCVInstrInfo::getOutliningType The only use of TM is checking result of TargetMachine::getFunctionSections, check that directly instead of introdce a local variable. --- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp index 8f9e622..d24fd9a 100644 --- a/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVInstrInfo.cpp @@ -1412,8 +1412,6 @@ RISCVInstrInfo::getOutliningType(MachineBasicBlock::iterator &MBBI, MI.getDesc().hasImplicitDefOfPhysReg(RISCV::X5)) return outliner::InstrType::Illegal; - const auto &TM = - static_cast(MI.getMF()->getTarget()); // Make sure the operands don't reference something unsafe. for (const auto &MO : MI.operands()) { if (MO.isMBB() || MO.isBlockAddress() || MO.isCPI() || MO.isJTI()) @@ -1422,7 +1420,8 @@ RISCVInstrInfo::getOutliningType(MachineBasicBlock::iterator &MBBI, // pcrel-hi and pcrel-lo can't put in separate sections, filter that out // if any possible. if (MO.getTargetFlags() == RISCVII::MO_PCREL_LO && - (TM.getFunctionSections() || F.hasComdat() || F.hasSection())) + (MI.getMF()->getTarget().getFunctionSections() || F.hasComdat() || + F.hasSection())) return outliner::InstrType::Illegal; } -- 2.7.4