summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-05-26 14:14:42 +0000
committerdim <dim@FreeBSD.org>2013-05-26 14:14:42 +0000
commit811490bc9116f189d045605221e749b33cf3a1ab (patch)
treef1e2dd1a5d57b6b0c89b68e0f17dda029da07ce6
parentcfbc0d116c6b115e4e312319a6e0d5cdb842e9c7 (diff)
downloadFreeBSD-src-811490bc9116f189d045605221e749b33cf3a1ab.zip
FreeBSD-src-811490bc9116f189d045605221e749b33cf3a1ab.tar.gz
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
-rw-r--r--contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 9d65a5e..d26154e 100644
--- a/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2169,7 +2169,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())
OpenPOWER on IntegriCloud