diff options
author | Owen Anderson <resistor@mac.com> | 2007-04-09 22:54:50 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-04-09 22:54:50 +0000 |
commit | ad190145912facc6fbf2fbe58023bb238fbf2365 (patch) | |
tree | a926e5ae037570c6092438be937ccc5d84f3fbcc /lib/Transforms/Utils/LoopSimplify.cpp | |
parent | 0cd04618734590b3328d6db2214ee523d11104ed (diff) |
Const-ify some parameters, and some cosmetic cleanups. No functionality
change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | lib/Transforms/Utils/LoopSimplify.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/LoopSimplify.cpp b/lib/Transforms/Utils/LoopSimplify.cpp index e4e0ff7735..f9e5fbc850 100644 --- a/lib/Transforms/Utils/LoopSimplify.cpp +++ b/lib/Transforms/Utils/LoopSimplify.cpp @@ -419,8 +419,8 @@ 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) { +static PHINode *FindPHIToPartitionLoops(Loop *L, ETForest *EF, + AliasAnalysis *AA) { for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) { PHINode *PN = cast<PHINode>(I); ++I; @@ -675,7 +675,7 @@ 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) { +static bool BlockDominatesAny(BasicBlock* A, const std::vector<BasicBlock*>& B, const ETForest& ETF) { for (std::vector<BasicBlock*>::iterator BI = B.begin(), BE = B.end(); BI != BE; ++BI) { if (ETF.dominates(A, *BI)) return true; @@ -858,6 +858,7 @@ void LoopSimplify::UpdateDomInfoForRevectoredPreds(BasicBlock *NewBB, // 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 |