aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2006-06-08 20:02:53 +0000
committerOwen Anderson <resistor@mac.com>2006-06-08 20:02:53 +0000
commita4529321713313545f53ee759800705bdb3f2a29 (patch)
treee6341f7e1c17be2e67690af5b1297286680126c9 /lib
parent0c48fd4610cc7a90a998428c93a0c68246e79e57 (diff)
downloadexternal_llvm-a4529321713313545f53ee759800705bdb3f2a29.zip
external_llvm-a4529321713313545f53ee759800705bdb3f2a29.tar.gz
external_llvm-a4529321713313545f53ee759800705bdb3f2a29.tar.bz2
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Utils/LCSSA.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp
index 061e548..e1af50e 100644
--- a/lib/Transforms/Utils/LCSSA.cpp
+++ b/lib/Transforms/Utils/LCSSA.cpp
@@ -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);