summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Transforms
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-02-22 15:51:49 +0000
committerdim <dim@FreeBSD.org>2015-02-22 15:51:49 +0000
commitae7200cb3ce1e6de0a476952f4dbde57b84ad9fc (patch)
tree424730c5cd3a73d59d3390944e3d9f815b790f6a /contrib/llvm/lib/Transforms
parent321f45d8e81dd2b0ab127ad12a928d3bb2b52766 (diff)
downloadFreeBSD-src-ae7200cb3ce1e6de0a476952f4dbde57b84ad9fc.zip
FreeBSD-src-ae7200cb3ce1e6de0a476952f4dbde57b84ad9fc.tar.gz
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
Diffstat (limited to 'contrib/llvm/lib/Transforms')
-rw-r--r--contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp2
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 2ce5831..55e48b4 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);
OpenPOWER on IntegriCloud