summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-12-11 04:55:10 +0000
committerNadav Rotem <nrotem@apple.com>2012-12-11 04:55:10 +0000
commitdbb3328194004c1777f9ec9cd965891db5d88289 (patch)
treecf8a94d3e29ead6405e121f3fe3399f1e7bea86a /llvm/lib/Transforms
parent6ee19d28f48e01de8a8b44943f55adda80bb15ad (diff)
downloadbcm5719-llvm-dbb3328194004c1777f9ec9cd965891db5d88289.tar.gz
bcm5719-llvm-dbb3328194004c1777f9ec9cd965891db5d88289.zip
Fix PR14565. Don't if-convert loops that have switch statements in them.
llvm-svn: 169813
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index feeececedb9..a69124032be 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1263,6 +1263,10 @@ bool LoopVectorizationLegality::canVectorizeWithIfConvert() {
for (unsigned i = 0, e = LoopBlocks.size(); i < e; ++i) {
BasicBlock *BB = LoopBlocks[i];
+ // We don't support switch statements inside loops.
+ if (!isa<BranchInst>(BB->getTerminator()))
+ return false;
+
// We must have at most two predecessors because we need to convert
// all PHIs to selects.
unsigned Preds = std::distance(pred_begin(BB), pred_end(BB));
OpenPOWER on IntegriCloud