diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-02-22 15:51:49 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-02-22 15:51:49 +0000 |
commit | a6d980a99e038087dc0d79d375036365e7b3076a (patch) | |
tree | 424730c5cd3a73d59d3390944e3d9f815b790f6a /contrib/llvm/lib/Transforms | |
parent | 62debcc7f351c7cab89ec6b23dfc7dc96005691b (diff) | |
download | src-a6d980a99e038087dc0d79d375036365e7b3076a.tar.gz src-a6d980a99e038087dc0d79d375036365e7b3076a.zip |
Pull in r230058 from upstream llvm trunk (by Benjamin Kramer):
LoopRotate: When reconstructing loop simplify form don't split edges
from indirectbrs.
Yet another chapter in the endless story. While this looks like we
leave the loop in a non-canonical state this replicates the logic in
LoopSimplify so it doesn't diverge from the canonical form in any way.
http://llvm.org/PR21968
This fixes a "Cannot split critical edge from IndirectBrInst" assertion
failure when building the devel/radare2 port.
PR: 195480, 196987
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=279161
Diffstat (limited to 'contrib/llvm/lib/Transforms')
-rw-r--r-- | contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp index 2ce58314f8ef..55e48b4bde55 100644 --- a/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -498,6 +498,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) { Loop *PredLoop = LI->getLoopFor(*PI); if (!PredLoop || PredLoop->contains(Exit)) continue; + if (isa<IndirectBrInst>((*PI)->getTerminator())) + continue; SplitLatchEdge |= L->getLoopLatch() == *PI; BasicBlock *ExitSplit = SplitCriticalEdge(*PI, Exit, this); ExitSplit->moveBefore(Exit); |