MachineLoopInfo Analysis Not Done

I'm trying to create the Machine LICM pass and I have this defined:

  class VISIBILITY_HIDDEN MachineLICM : public MachineFunctionPass {
    virtual void getAnalysisUsage(AnalysisUsage &AU) const {

But when I go to use it:

  bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
    // Get our Loop information...
    LI = &getAnalysis<MachineLoopInfo>();
    for (MachineLoopInfo::iterator
       I = LI->begin(), E = LI->end(); I != E; ++I) {

it doesn't execute the loop. In fact, the analysis is never ran. How
do I force it to be run?


Maybe this is because it has runOnFunction disabled?:

class MachineLoopInfo : public MachineFunctionPass {
   bool runOnFunction(Function& F) { return false; }


Fixed now!