OSDN Git Service

Re-apply r80926, with fixes: keep the domtree informed of new blocks
authorDan Gohman <gohman@apple.com>
Tue, 8 Sep 2009 15:45:00 +0000 (15:45 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 8 Sep 2009 15:45:00 +0000 (15:45 +0000)
commit5c89b5240c90eb8171f999e5f06f815502d0321c
treef34aa8c5b5b7783f84d985d44c086360683dc226
parent6ca0b9e7220911a6d1fccf34e532e69c7e37cd2f
Re-apply r80926, with fixes: keep the domtree informed of new blocks
that get created during loop unswitching, and fix SplitBlockPredecessors'
LCSSA updating code to create new PHIs instead of trying to just move
existing ones.

Also, optimize Loop::verifyLoop, since it gets called a lot. Use
searches on a sorted list of blocks instead of calling the "contains"
function, as is done in other places in the Loop class, since "contains"
does a linear search. Also, don't call verifyLoop from LoopSimplify or
LCSSA, as the PassManager is already calling verifyLoop as part of
LoopInfo's verifyAnalysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81221 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/Analysis/LoopInfo.h
include/llvm/Transforms/Utils/BasicBlockUtils.h
lib/Analysis/LoopInfo.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopStrengthReduce.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/Transforms/Utils/BasicBlockUtils.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/LCSSA.cpp
lib/Transforms/Utils/LoopSimplify.cpp
test/Transforms/LoopUnswitch/2009-09-05-DomAssert.ll [deleted file]
test/Transforms/LoopUnswitch/preserve-analyses.ll [new file with mode: 0644]