From 36d927312841af04194c86ecccce3816a6773d93 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 27 Jan 2015 07:54:36 +0000 Subject: [PATCH] Clean up the AArch64 store pair suppression pass initialization and remove and unnecessary class variable. llvm-svn: 227175 --- .../AArch64/AArch64StorePairSuppress.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp b/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp index 076903e6c2f8..85b44a20e11a 100644 --- a/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp +++ b/llvm/lib/Target/AArch64/AArch64StorePairSuppress.cpp @@ -30,7 +30,6 @@ class AArch64StorePairSuppress : public MachineFunctionPass { const AArch64InstrInfo *TII; const TargetRegisterInfo *TRI; const MachineRegisterInfo *MRI; - MachineFunction *MF; TargetSchedModel SchedModel; MachineTraceMetrics *Traces; MachineTraceMetrics::Ensemble *MinInstr; @@ -115,19 +114,16 @@ bool AArch64StorePairSuppress::isNarrowFPStore(const MachineInstr &MI) { } } -bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &mf) { - MF = &mf; - TII = - static_cast(MF->getSubtarget().getInstrInfo()); - TRI = MF->getSubtarget().getRegisterInfo(); - MRI = &MF->getRegInfo(); - const TargetSubtargetInfo &ST = MF->getSubtarget(); +bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &MF) { + const TargetSubtargetInfo &ST = MF.getSubtarget(); + TII = static_cast(ST.getInstrInfo()); + TRI = ST.getRegisterInfo(); + MRI = &MF.getRegInfo(); SchedModel.init(ST.getSchedModel(), &ST, TII); - Traces = &getAnalysis(); MinInstr = nullptr; - DEBUG(dbgs() << "*** " << getPassName() << ": " << MF->getName() << '\n'); + DEBUG(dbgs() << "*** " << getPassName() << ": " << MF.getName() << '\n'); if (!SchedModel.hasInstrSchedModel()) { DEBUG(dbgs() << " Skipping pass: no machine model present.\n"); @@ -138,7 +134,7 @@ bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &mf) { // precisely determine whether a store pair can be formed. But we do want to // filter out most situations where we can't form store pairs to avoid // computing trace metrics in those cases. - for (auto &MBB : *MF) { + for (auto &MBB : MF) { bool SuppressSTP = false; unsigned PrevBaseReg = 0; for (auto &MI : MBB) {