From ae7200cb3ce1e6de0a476952f4dbde57b84ad9fc Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 22 Feb 2015 15:51:49 +0000 Subject: 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 --- contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/llvm/lib/Transforms') 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((*PI)->getTerminator())) + continue; SplitLatchEdge |= L->getLoopLatch() == *PI; BasicBlock *ExitSplit = SplitCriticalEdge(*PI, Exit, this); ExitSplit->moveBefore(Exit); -- cgit v1.1