Clean up the AArch64 store pair suppression pass initialization

and remove and unnecessary class variable.

llvm-svn: 227175
This commit is contained in:
Eric Christopher 2015-01-27 07:54:36 +00:00
parent 2b5539651b
commit 36d9273128
1 changed files with 7 additions and 11 deletions

View File

@ -30,7 +30,6 @@ class AArch64StorePairSuppress : public MachineFunctionPass {
const AArch64InstrInfo *TII; const AArch64InstrInfo *TII;
const TargetRegisterInfo *TRI; const TargetRegisterInfo *TRI;
const MachineRegisterInfo *MRI; const MachineRegisterInfo *MRI;
MachineFunction *MF;
TargetSchedModel SchedModel; TargetSchedModel SchedModel;
MachineTraceMetrics *Traces; MachineTraceMetrics *Traces;
MachineTraceMetrics::Ensemble *MinInstr; MachineTraceMetrics::Ensemble *MinInstr;
@ -115,19 +114,16 @@ bool AArch64StorePairSuppress::isNarrowFPStore(const MachineInstr &MI) {
} }
} }
bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &mf) { bool AArch64StorePairSuppress::runOnMachineFunction(MachineFunction &MF) {
MF = &mf; const TargetSubtargetInfo &ST = MF.getSubtarget();
TII = TII = static_cast<const AArch64InstrInfo *>(ST.getInstrInfo());
static_cast<const AArch64InstrInfo *>(MF->getSubtarget().getInstrInfo()); TRI = ST.getRegisterInfo();
TRI = MF->getSubtarget().getRegisterInfo(); MRI = &MF.getRegInfo();
MRI = &MF->getRegInfo();
const TargetSubtargetInfo &ST = MF->getSubtarget();
SchedModel.init(ST.getSchedModel(), &ST, TII); SchedModel.init(ST.getSchedModel(), &ST, TII);
Traces = &getAnalysis<MachineTraceMetrics>(); Traces = &getAnalysis<MachineTraceMetrics>();
MinInstr = nullptr; MinInstr = nullptr;
DEBUG(dbgs() << "*** " << getPassName() << ": " << MF->getName() << '\n'); DEBUG(dbgs() << "*** " << getPassName() << ": " << MF.getName() << '\n');
if (!SchedModel.hasInstrSchedModel()) { if (!SchedModel.hasInstrSchedModel()) {
DEBUG(dbgs() << " Skipping pass: no machine model present.\n"); 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 // 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 // filter out most situations where we can't form store pairs to avoid
// computing trace metrics in those cases. // computing trace metrics in those cases.
for (auto &MBB : *MF) { for (auto &MBB : MF) {
bool SuppressSTP = false; bool SuppressSTP = false;
unsigned PrevBaseReg = 0; unsigned PrevBaseReg = 0;
for (auto &MI : MBB) { for (auto &MI : MBB) {