Update some comments, and expose LCSSAID in preparation for having other passes

require LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28734 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2006-06-08 20:02:53 +00:00
parent 0c48fd4610
commit a452932171
2 changed files with 9 additions and 1 deletions

View 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

View 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);