diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-09 22:31:43 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-09 22:31:43 +0000 |
commit | e0ef5ac6bd7109d1d125aa49e6231753fed42ad4 (patch) | |
tree | 5abe78b8acac4e722407422777d19aff657ef902 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | 39f65335d5e4a8d2fc7cc3cd364984e864b5348a (diff) | |
download | bcm5719-llvm-e0ef5ac6bd7109d1d125aa49e6231753fed42ad4.tar.gz bcm5719-llvm-e0ef5ac6bd7109d1d125aa49e6231753fed42ad4.zip |
Tabs -> Spaces
llvm-svn: 35841
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 5db72d48a0d..e4e0ff77356 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -420,7 +420,7 @@ static void AddBlockAndPredsToSet(BasicBlock *BB, BasicBlock *StopBlock, /// FindPHIToPartitionLoops - The first part of loop-nestification is to find a /// PHI node that tells us how to partition the loops. static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, - AliasAnalysis *AA) { + AliasAnalysis *AA) { for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) { PHINode *PN = cast<PHINode>(I); ++I; @@ -676,11 +676,11 @@ void LoopSimplify::InsertUniqueBackedgeBlock(Loop *L) { // Returns true if BasicBlock A dominates at least one block in vector B // Helper function for UpdateDomInfoForRevectoredPreds static bool BlockDominatesAny(BasicBlock* A, std::vector<BasicBlock*>& B, ETForest& ETF) { - for (std::vector<BasicBlock*>::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { - if (ETF.dominates(A, *BI)) - return true; - } - return false; + for (std::vector<BasicBlock*>::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { + if (ETF.dominates(A, *BI)) + return true; + } + return false; } /// UpdateDomInfoForRevectoredPreds - This method is used to update the four @@ -852,36 +852,36 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, // their dominance frontier must be updated to contain NewBB instead. // for (Function::iterator FI = NewBB->getParent()->begin(), - FE = NewBB->getParent()->end(); FI != FE; ++FI) { - DominanceFrontier::iterator DFI = DF->find(FI); - if (DFI == DF->end()) continue; // unreachable block. - - // Only consider dominators of NewBBSucc - if (!DFI->second.count(NewBBSucc)) continue; - if (BlockDominatesAny(FI, PredBlocks, ETF)) { - // If NewBBSucc should not stay in our dominator frontier, remove it. - // We remove it unless there is a predecessor of NewBBSucc that we - // dominate, but we don't strictly dominate NewBBSucc. - bool ShouldRemove = true; - if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) { - // Okay, we know that PredDom does not strictly dominate NewBBSucc. - // Check to see if it dominates any predecessors of NewBBSucc. - for (pred_iterator PI = pred_begin(NewBBSucc), - E = pred_end(NewBBSucc); PI != E; ++PI) - if (ETF.dominates(FI, *PI)) { - ShouldRemove = false; - break; - } - - if (ShouldRemove) - DF->removeFromFrontier(DFI, NewBBSucc); - DF->addToFrontier(DFI, NewBB); - - break; - } - } - } - } + FE = NewBB->getParent()->end(); FI != FE; ++FI) { + DominanceFrontier::iterator DFI = DF->find(FI); + if (DFI == DF->end()) continue; // unreachable block. + + // Only consider dominators of NewBBSucc + if (!DFI->second.count(NewBBSucc)) continue; + if (BlockDominatesAny(FI, PredBlocks, ETF)) { + // If NewBBSucc should not stay in our dominator frontier, remove it. + // We remove it unless there is a predecessor of NewBBSucc that we + // dominate, but we don't strictly dominate NewBBSucc. + bool ShouldRemove = true; + if ((BasicBlock*)FI == NewBBSucc || !ETF.dominates(FI, NewBBSucc)) { + // Okay, we know that PredDom does not strictly dominate NewBBSucc. + // Check to see if it dominates any predecessors of NewBBSucc. + for (pred_iterator PI = pred_begin(NewBBSucc), + E = pred_end(NewBBSucc); PI != E; ++PI) + if (ETF.dominates(FI, *PI)) { + ShouldRemove = false; + break; + } + + if (ShouldRemove) + DF->removeFromFrontier(DFI, NewBBSucc); + DF->addToFrontier(DFI, NewBB); + + break; + } + } + } + } } |