Commit 487e8e6b authored by Bill Wendling's avatar Bill Wendling
Browse files

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.
------------------------------------------------------------------------

llvm-svn: 182785
parent ce59b557
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2308,7 +2308,10 @@ bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
}

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())
+11 −0
Original line number Diff line number Diff line
@@ -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
}