[llvm-branch-commits] [llvm-branch] r182785 - Merging r182656:

Bill Wendling isanbard at gmail.com
Tue May 28 11:37:10 PDT 2013


Author: void
Date: Tue May 28 13:37:09 2013
New Revision: 182785

URL: http://llvm.org/viewvc/llvm-project?rev=182785&view=rev
Log:
Merging r182656:
------------------------------------------------------------------------
r182656 | d0k | 2013-05-24 11:05:35 -0700 (Fri, 24 May 2013) | 3 lines

LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.

Fixes PR16139.
------------------------------------------------------------------------

Modified:
    llvm/branches/release_33/   (props changed)
    llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp
    llvm/branches/release_33/test/Transforms/LoopVectorize/lcssa-crash.ll

Propchange: llvm/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 28 13:37:09 2013
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,181286,181296,181313,181363,181366,181397,181423,181450,181524,181529,181540,181576-181580,181586,181600,181678,181706,181792,181800,181842,181864,182072,182112-182113,182344,182364,182385,182387,182485-182486
+/llvm/trunk:155241,181286,181296,181313,181363,181366,181397,181423,181450,181524,181529,181540,181576-181580,181586,181600,181678,181706,181792,181800,181842,181864,182072,182112-182113,182344,182364,182385,182387,182485-182486,182656

Modified: llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=182785&r1=182784&r2=182785&view=diff
==============================================================================
--- llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp Tue May 28 13:37:09 2013
@@ -2308,7 +2308,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())

Modified: llvm/branches/release_33/test/Transforms/LoopVectorize/lcssa-crash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_33/test/Transforms/LoopVectorize/lcssa-crash.ll?rev=182785&r1=182784&r2=182785&view=diff
==============================================================================
--- llvm/branches/release_33/test/Transforms/LoopVectorize/lcssa-crash.ll (original)
+++ llvm/branches/release_33/test/Transforms/LoopVectorize/lcssa-crash.ll Tue May 28 13:37:09 2013
@@ -27,3 +27,14 @@ for.end.i.i.i:
   unreachable
 }
 
+; PR16139
+define void @test2(i8* %x) {
+entry:
+  indirectbr i8* %x, [ label %L0, label %L1 ]
+
+L0:
+  br label %L0
+
+L1:
+  ret void
+}





More information about the llvm-branch-commits mailing list