mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-29 14:20:29 +00:00
Avoid caching the MachineFunction, we don't use it outside of
runOnMachineFunction. llvm-svn: 219847
This commit is contained in:
parent
527b1df834
commit
64e055d96c
@ -107,7 +107,6 @@ STATISTIC(NumRewrittenCopies, "Number of copies rewritten");
|
||||
|
||||
namespace {
|
||||
class PeepholeOptimizer : public MachineFunctionPass {
|
||||
MachineFunction *MF;
|
||||
const TargetInstrInfo *TII;
|
||||
const TargetRegisterInfo *TRI;
|
||||
MachineRegisterInfo *MRI;
|
||||
@ -1052,25 +1051,24 @@ bool PeepholeOptimizer::foldImmediate(MachineInstr *MI, MachineBasicBlock *MBB,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &mf) {
|
||||
if (skipOptnoneFunction(*mf.getFunction()))
|
||||
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||
if (skipOptnoneFunction(*MF.getFunction()))
|
||||
return false;
|
||||
|
||||
DEBUG(dbgs() << "********** PEEPHOLE OPTIMIZER **********\n");
|
||||
DEBUG(dbgs() << "********** Function: " << mf.getName() << '\n');
|
||||
DEBUG(dbgs() << "********** Function: " << MF.getName() << '\n');
|
||||
|
||||
if (DisablePeephole)
|
||||
return false;
|
||||
|
||||
MF = &mf;
|
||||
TII = MF->getSubtarget().getInstrInfo();
|
||||
TRI = MF->getSubtarget().getRegisterInfo();
|
||||
MRI = &MF->getRegInfo();
|
||||
TII = MF.getSubtarget().getInstrInfo();
|
||||
TRI = MF.getSubtarget().getRegisterInfo();
|
||||
MRI = &MF.getRegInfo();
|
||||
DT = Aggressive ? &getAnalysis<MachineDominatorTree>() : nullptr;
|
||||
|
||||
bool Changed = false;
|
||||
|
||||
for (MachineFunction::iterator I = MF->begin(), E = MF->end(); I != E; ++I) {
|
||||
for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
|
||||
MachineBasicBlock *MBB = &*I;
|
||||
|
||||
bool SeenMoveImm = false;
|
||||
|
Loading…
Reference in New Issue
Block a user