Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 2013 14:14:42 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250997 - head/contrib/llvm/lib/Transforms/Vectorize
Message-ID:  <201305261414.r4QEEgC3041907@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Sun May 26 14:14:42 2013
New Revision: 250997
URL: http://svnweb.freebsd.org/changeset/base/250997

Log:
  Pull in r182656 from upstream llvm trunk:
  
    LoopVectorize: LoopSimplify can't canonicalize loops with an
    indirectbr in it, don't assert on those cases.
  
    Fixes PR16139.
  
  This should fix clang assertion failures when optimizing at -O3, similar
  to:
  
    Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"),
    function canVectorize, file
    contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171.
  
  Reported by:	O. Hartmann <ohartman@zedat.fu-berlin.de>
  PR:		ports/178332, ports/178977
  MFC after:	3 days

Modified:
  head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
==============================================================================
--- head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp	Sun May 26 12:36:56 2013	(r250996)
+++ head/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp	Sun May 26 14:14:42 2013	(r250997)
@@ -2169,7 +2169,10 @@ bool LoopVectorizationLegality::canVecto
 }
 
 bool LoopVectorizationLegality::canVectorize() {
-  assert(TheLoop->getLoopPreheader() && "No preheader!!");
+  // We must have a loop in canonical form. Loops with indirectbr in them cannot
+  // be canonicalized.
+  if (!TheLoop->getLoopPreheader())
+    return false;
 
   // We can only vectorize innermost loops.
   if (TheLoop->getSubLoopsVector().size())



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305261414.r4QEEgC3041907>