diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-31 22:04:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-31 22:04:43 +0000 |
commit | c872b09676366b4c7649e7a2d06f0213e79316d6 (patch) | |
tree | b4b61f702dbe32e194dbb9a0bb8b93059f3d9219 /llvm/lib/Transforms/Scalar | |
parent | 0de95af62d1d2cd78464480bdfdedb992c48ca9a (diff) | |
download | bcm5719-llvm-c872b09676366b4c7649e7a2d06f0213e79316d6.tar.gz bcm5719-llvm-c872b09676366b4c7649e7a2d06f0213e79316d6.zip |
llvm::SplitEdge should refuse to split an edge from an indirectbr.
Fix CodeGenPrepare to not try to split edges from indirectbr.
llvm-svn: 85690
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 42209b8cbe2..9ca90c333af 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -318,6 +318,7 @@ static void SplitEdgeNicely(TerminatorInst *TI, unsigned SuccNum, if (Invoke->getSuccessor(1) == Dest) return; } + // As a hack, never split backedges of loops. Even though the copy for any // PHIs inserted on the backedge would be dead for exits from the loop, we @@ -852,7 +853,7 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) { // Split all critical edges where the dest block has a PHI. TerminatorInst *BBTI = BB.getTerminator(); - if (BBTI->getNumSuccessors() > 1) { + if (BBTI->getNumSuccessors() > 1 && !isa<IndirectBrInst>(BBTI)) { for (unsigned i = 0, e = BBTI->getNumSuccessors(); i != e; ++i) { BasicBlock *SuccBB = BBTI->getSuccessor(i); if (isa<PHINode>(SuccBB->begin()) && isCriticalEdge(BBTI, i, true)) |