mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Avoid caching the MachineFunction, we don't use it outside of
runOnMachineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219847 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a72d8bb20
commit
55751ba9e2
@ -107,7 +107,6 @@ STATISTIC(NumRewrittenCopies, "Number of copies rewritten");
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class PeepholeOptimizer : public MachineFunctionPass {
|
class PeepholeOptimizer : public MachineFunctionPass {
|
||||||
MachineFunction *MF;
|
|
||||||
const TargetInstrInfo *TII;
|
const TargetInstrInfo *TII;
|
||||||
const TargetRegisterInfo *TRI;
|
const TargetRegisterInfo *TRI;
|
||||||
MachineRegisterInfo *MRI;
|
MachineRegisterInfo *MRI;
|
||||||
@ -1052,25 +1051,24 @@ bool PeepholeOptimizer::foldImmediate(MachineInstr *MI, MachineBasicBlock *MBB,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &mf) {
|
bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
|
||||||
if (skipOptnoneFunction(*mf.getFunction()))
|
if (skipOptnoneFunction(*MF.getFunction()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DEBUG(dbgs() << "********** PEEPHOLE OPTIMIZER **********\n");
|
DEBUG(dbgs() << "********** PEEPHOLE OPTIMIZER **********\n");
|
||||||
DEBUG(dbgs() << "********** Function: " << mf.getName() << '\n');
|
DEBUG(dbgs() << "********** Function: " << MF.getName() << '\n');
|
||||||
|
|
||||||
if (DisablePeephole)
|
if (DisablePeephole)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
MF = &mf;
|
TII = MF.getSubtarget().getInstrInfo();
|
||||||
TII = MF->getSubtarget().getInstrInfo();
|
TRI = MF.getSubtarget().getRegisterInfo();
|
||||||
TRI = MF->getSubtarget().getRegisterInfo();
|
MRI = &MF.getRegInfo();
|
||||||
MRI = &MF->getRegInfo();
|
|
||||||
DT = Aggressive ? &getAnalysis<MachineDominatorTree>() : nullptr;
|
DT = Aggressive ? &getAnalysis<MachineDominatorTree>() : nullptr;
|
||||||
|
|
||||||
bool Changed = false;
|
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;
|
MachineBasicBlock *MBB = &*I;
|
||||||
|
|
||||||
bool SeenMoveImm = false;
|
bool SeenMoveImm = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user