Author: dim
Date: Sun Feb 22 15:51:49 2015
New Revision: 279161
URL: https://svnweb.freebsd.org/changeset/base/279161

Log:
  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

Modified:
  head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp

Modified: head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp
==============================================================================
--- head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp    Sun Feb 22 
15:48:36 2015        (r279160)
+++ head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp    Sun Feb 22 
15:51:49 2015        (r279161)
@@ -498,6 +498,8 @@ bool LoopRotate::rotateLoop(Loop *L, boo
       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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to