LoopSimplify bug fix. Handle indirect loop back edges.
authorAndrew Trick <atrick@apple.com>
Tue, 20 Mar 2012 21:24:52 +0000 (21:24 +0000)
committerAndrew Trick <atrick@apple.com>
Tue, 20 Mar 2012 21:24:52 +0000 (21:24 +0000)
commit7edc277f7214837d3b7cc382350ea1eb968d09aa
tree5da24a29f809e93293d1a83961b92f42a04f45eb
parentcd1142ef7f9ed5a570da8b332ba481061eb6fcb6
LoopSimplify bug fix. Handle indirect loop back edges.

Do not call SplitBlockPredecessors on a loop preheader when one of the
predecessors is an indirectbr. Otherwise, you will hit this assert:
!isa<IndirectBrInst>(Preds[i]->getTerminator()) && "Cannot split an edge from an IndirectBrInst"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153134 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopSimplify.cpp
test/Transforms/LoopSimplify/2012-03-20-indirectbr.ll [new file with mode: 0644]