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 | c4dcf82a1665d24e0fc41908aedcedda411e6f56 (patch) | |
tree | 1d6cf205d69c54f4654385b41be24041c6591272 /llvm/lib/Transforms | |
parent | e491bb8845eb392e032d473c5a9eb95bd432622a (diff) | |
download | bcm5719-llvm-c4dcf82a1665d24e0fc41908aedcedda411e6f56.tar.gz bcm5719-llvm-c4dcf82a1665d24e0fc41908aedcedda411e6f56.zip |
Reconstruct dom info, if loop is unswitched.
llvm-svn: 53086
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index f57b7bb5194..02dac92aa13 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/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; } |