diff options
| author | Devang Patel <dpatel@apple.com> | 2007-03-20 20:18:12 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2007-03-20 20:18:12 +0000 |
| commit | 1758cb50deb62539cf5028b1f689adc1d3fdf7f1 (patch) | |
| tree | 3bc0dbaa388cbb201125305c11d6ff7e88c15d12 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
| parent | 971aa1886708ae7318d30694801dff18ad025c8e (diff) | |
| download | bcm5719-llvm-1758cb50deb62539cf5028b1f689adc1d3fdf7f1.tar.gz bcm5719-llvm-1758cb50deb62539cf5028b1f689adc1d3fdf7f1.zip | |
LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.
llvm-svn: 35221
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index ab850d58fc6..044ca5b0fc3 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -66,6 +66,7 @@ namespace { AU.addRequired<LoopInfo>(); AU.addRequired<DominatorSet>(); AU.addRequired<DominatorTree>(); + AU.addRequired<ETForest>(); AU.addPreserved<LoopInfo>(); AU.addPreserved<DominatorSet>(); @@ -417,13 +418,13 @@ 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, DominatorSet &DS, - 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; if (Value *V = PN->hasConstantValue()) - if (!isa<Instruction>(V) || DS.dominates(cast<Instruction>(V), PN)) { + if (!isa<Instruction>(V) || EF->dominates(cast<Instruction>(V), PN)) { // This is a degenerate PHI already, don't modify it! PN->replaceAllUsesWith(V); if (AA) AA->deleteValue(PN); @@ -497,7 +498,8 @@ void LoopSimplify::PlaceSplitBlockCarefully(BasicBlock *NewBB, /// created. /// Loop *LoopSimplify::SeparateNestedLoop(Loop *L) { - PHINode *PN = FindPHIToPartitionLoops(L, getAnalysis<DominatorSet>(), AA); + ETForest *EF = getAnalysisToUpdate<ETForest>(); + PHINode *PN = FindPHIToPartitionLoops(L, EF, AA); if (PN == 0) return 0; // No known way to partition. // Pull out all predecessors that have varying values in the loop. This |

