~ubuntu-branches/ubuntu/lucid/clamav/lucid-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/Transforms/Scalar/LoopDeletion.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-17 12:30:20 UTC
  • mfrom: (0.35.17 sid)
  • Revision ID: james.westby@ubuntu.com-20101217123020-nnk3656an8i339gp
Tags: 0.96.5+dfsg-1ubuntu1.10.04.1
* Microversion update for Lucid (LP: #691414)
  - Improved database login times
  - Expanded use of new bytecode signatures
  - Other bugfixes/improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  class LoopDeletion : public LoopPass {
29
29
  public:
30
30
    static char ID; // Pass ID, replacement for typeid
31
 
    LoopDeletion() : LoopPass(&ID) {}
 
31
    LoopDeletion() : LoopPass(ID) {}
32
32
    
33
33
    // Possibly eliminate loop L if it is dead.
34
34
    bool runOnLoop(Loop* L, LPPassManager& LPM);
38
38
                    bool &Changed, BasicBlock *Preheader);
39
39
 
40
40
    virtual void getAnalysisUsage(AnalysisUsage& AU) const {
41
 
      AU.addRequired<ScalarEvolution>();
42
41
      AU.addRequired<DominatorTree>();
43
42
      AU.addRequired<LoopInfo>();
 
43
      AU.addRequired<ScalarEvolution>();
44
44
      AU.addRequiredID(LoopSimplifyID);
45
45
      AU.addRequiredID(LCSSAID);
46
46
      
55
55
}
56
56
  
57
57
char LoopDeletion::ID = 0;
58
 
static RegisterPass<LoopDeletion> X("loop-deletion", "Delete dead loops");
 
58
INITIALIZE_PASS(LoopDeletion, "loop-deletion",
 
59
                "Delete dead loops", false, false);
59
60
 
60
61
Pass* llvm::createLoopDeletionPass() {
61
62
  return new LoopDeletion();
83
84
      if (!L->makeLoopInvariant(I, Changed, Preheader->getTerminator()))
84
85
        return false;
85
86
      
86
 
    BI++;
 
87
    ++BI;
87
88
  }
88
89
  
89
90
  // Make sure that no instructions in the block have potential side-effects.
176
177
  BasicBlock::iterator BI = exitBlock->begin();
177
178
  while (PHINode* P = dyn_cast<PHINode>(BI)) {
178
179
    P->replaceUsesOfWith(exitingBlock, preheader);
179
 
    BI++;
 
180
    ++BI;
180
181
  }
181
182
  
182
183
  // Update the dominator tree and remove the instructions and blocks that will
226
227
  LPM.deleteLoopFromQueue(L);
227
228
  Changed = true;
228
229
  
229
 
  NumDeleted++;
 
230
  ++NumDeleted;
230
231
  
231
232
  return Changed;
232
233
}