Update some comments, and expose LCSSAID in preparation for having other passes
authorOwen Anderson <resistor@mac.com>
Thu, 8 Jun 2006 20:02:53 +0000 (20:02 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 8 Jun 2006 20:02:53 +0000 (20:02 +0000)
require LCSSA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28734 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Scalar.h
lib/Transforms/Utils/LCSSA.cpp

index 111ced11d64b6f80d749c461bcd381d5a4b208a5..d901972c9d059182b1cbb427ab18418bc3749e18 100644 (file)
@@ -306,6 +306,7 @@ FunctionPass *createBlockPlacementPass();
 // This pass inserts phi nodes at loop boundaries to simplify other loop 
 // optimizations.
 FunctionPass *createLCSSAPass();
+extern const PassInfo *LCSSAID;
 
 } // End llvm namespace
 
index 061e548e70874399453f3566aa94aedef0f14f80..e1af50e7454cf7ebf7e63696a00aa6ac9c6caf7b 100644 (file)
@@ -86,7 +86,9 @@ namespace {
 }
 
 FunctionPass *llvm::createLCSSAPass() { return new LCSSA(); }
+const PassInfo *llvm::LCSSAID = X.getPassInfo();
 
+/// runOnFunction - Process all loops in the function, inner-most out.
 bool LCSSA::runOnFunction(Function &F) {
   bool changed = false;
   LI = &getAnalysis<LoopInfo>();
@@ -100,6 +102,8 @@ bool LCSSA::runOnFunction(Function &F) {
   return changed;
 }
 
+/// visitSubloop - Recursively process all subloops, and then process the given
+/// loop if it has live-out values.
 bool LCSSA::visitSubloop(Loop* L) {
   for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
     visitSubloop(*I);
@@ -131,7 +135,8 @@ bool LCSSA::visitSubloop(Loop* L) {
   return true;
 }
 
-/// processInstruction - 
+/// processInstruction - Given a live-out instruction, insert LCSSA Phi nodes,
+/// eliminate all out-of-loop uses.
 void LCSSA::processInstruction(Instruction* Instr,
                                const std::vector<BasicBlock*>& exitBlocks)
 {
@@ -252,6 +257,8 @@ SetVector<Instruction*> LCSSA::getLoopValuesUsedOutsideLoop(Loop *L) {
   return AffectedValues;
 }
 
+/// getValueDominatingBlock - Return the value within the potential dominators
+/// map that dominates the given block.
 Instruction *LCSSA::getValueDominatingBlock(BasicBlock *BB,
                                  std::map<BasicBlock*, Instruction*>& PotDoms) {
   DominatorTree::Node* bbNode = DT->getNode(BB);