diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-24 18:05:35 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-05-24 18:05:35 +0000 |
commit | 959ecb2eec9cffd762edc46fd496a7bb6c65a2e6 (patch) | |
tree | 8e379ef26678dc3cc216300718bcc598402f1abd /lib/Transforms/Vectorize | |
parent | fe808927ac50545ee434f14a4dd6bff44ac48a30 (diff) | |
download | llvm-959ecb2eec9cffd762edc46fd496a7bb6c65a2e6.tar.gz llvm-959ecb2eec9cffd762edc46fd496a7bb6c65a2e6.tar.bz2 llvm-959ecb2eec9cffd762edc46fd496a7bb6c65a2e6.tar.xz |
LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases.
Fixes PR16139.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Vectorize')
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index f88ebfd015..f6c4dea04c 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2428,7 +2428,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()) |