diff options
author | Bill Wendling <isanbard@gmail.com> | 2007-12-11 19:40:06 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2007-12-11 19:40:06 +0000 |
commit | b678ae7c38ac10bb5eafac66a0a09c7e146f2c46 (patch) | |
tree | 14982b4ddecebf054f4c6074059cbc13a361430e /llvm/lib/CodeGen/MachineLICM.cpp | |
parent | 7717a8a37d61cfb7b042c9225edb015257fbd80f (diff) | |
download | bcm5719-llvm-b678ae7c38ac10bb5eafac66a0a09c7e146f2c46.tar.gz bcm5719-llvm-b678ae7c38ac10bb5eafac66a0a09c7e146f2c46.zip |
Blark! How in the world did this work without this?!
llvm-svn: 44874
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineLICM.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index b5a00848a23..8277a430678 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -43,6 +43,8 @@ STATISTIC(NumHoisted, "Number of machine instructions hoisted out of loops"); namespace { class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass { + MachineFunction *CurMF;// Current MachineFunction + // Various analyses that we use... MachineLoopInfo *LI; // Current MachineLoopInfo MachineDominatorTree *DT; // Machine dominator tree for the current Loop @@ -91,7 +93,7 @@ namespace { /// MapVirtualRegisterDefs - Create a map of which machine instruction /// defines a virtual register. /// - void MapVirtualRegisterDefs(const MachineFunction &MF); + void MapVirtualRegisterDefs(); /// IsInSubLoop - A little predicate that returns true if the specified /// basic block is in a subloop of the current one, not the current one @@ -182,12 +184,15 @@ bool MachineLICM::runOnMachineFunction(MachineFunction &MF) { if (!PerformLICM) return false; // For debugging. Changed = false; - TII = MF.getTarget().getInstrInfo(); + CurMF = &MF; + TII = CurMF->getTarget().getInstrInfo(); // Get our Loop information... LI = &getAnalysis<MachineLoopInfo>(); DT = &getAnalysis<MachineDominatorTree>(); + MapVirtualRegisterDefs(); + for (MachineLoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) { MachineLoop *L = *I; @@ -205,9 +210,9 @@ bool MachineLICM::runOnMachineFunction(MachineFunction &MF) { /// MapVirtualRegisterDefs - Create a map of which machine instruction defines a /// virtual register. /// -void MachineLICM::MapVirtualRegisterDefs(const MachineFunction &MF) { +void MachineLICM::MapVirtualRegisterDefs() { for (MachineFunction::const_iterator - I = MF.begin(), E = MF.end(); I != E; ++I) { + I = CurMF->begin(), E = CurMF->end(); I != E; ++I) { const MachineBasicBlock &MBB = *I; for (MachineBasicBlock::const_iterator |