diff options
| author | Devang Patel <dpatel@apple.com> | 2008-07-03 06:48:21 +0000 | 
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2008-07-03 06:48:21 +0000 | 
| commit | d326a68e51698bb6b3d70712fc38e79dbb0fcc41 (patch) | |
| tree | aee28bb3644fa5c4877b9d4e62a1044814f7b124 /lib | |
| parent | a7e8b72c1dbc0194112ea4c72cd6963b40423d43 (diff) | |
| download | external_llvm-d326a68e51698bb6b3d70712fc38e79dbb0fcc41.zip external_llvm-d326a68e51698bb6b3d70712fc38e79dbb0fcc41.tar.gz external_llvm-d326a68e51698bb6b3d70712fc38e79dbb0fcc41.tar.bz2 | |
Reconstruct dom info, if loop is unswitched.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53086 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index f57b7bb..02dac92 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -113,8 +113,8 @@ namespace {        AU.addRequiredID(LCSSAID);        AU.addPreservedID(LCSSAID);        // FIXME: Loop Unswitch does not preserve dominator info in all cases. -      // AU.addPreserved<DominatorTree>(); -      // AU.addPreserved<DominanceFrontier>(); +      AU.addPreserved<DominatorTree>(); +      AU.addPreserved<DominanceFrontier>();      }    private: @@ -206,7 +206,6 @@ bool LoopUnswitch::runOnLoop(Loop *L, LPPassManager &LPM_Ref) {    DT = getAnalysisToUpdate<DominatorTree>();    currentLoop = L;    bool Changed = false; -    do {      assert(currentLoop->isLCSSAForm());      redoLoop = false; @@ -459,7 +458,13 @@ bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){    } else {      UnswitchNontrivialCondition(LoopCond, Val, currentLoop);    } -  + +  // FIXME: Reconstruct dom info, because it is not preserved properly. +  Function *F = loopHeader->getParent(); +  if (DT) +    DT->runOnFunction(*F); +  if (DF) +    DF->runOnFunction(*F);    return true;  } | 
