diff options
author | Erik Eckstein <eeckstein@apple.com> | 2014-08-22 01:18:39 +0000 |
---|---|---|
committer | Erik Eckstein <eeckstein@apple.com> | 2014-08-22 01:18:39 +0000 |
commit | b49d7abb7b289b73af0485c50c642216a5509eaa (patch) | |
tree | 1a922bfec9273c1a1f4af710fee1bec1e20bc87c /llvm/lib/Transforms | |
parent | fab565a56b1cad144053a91c78cb1f333210e431 (diff) | |
download | bcm5719-llvm-b49d7abb7b289b73af0485c50c642216a5509eaa.tar.gz bcm5719-llvm-b49d7abb7b289b73af0485c50c642216a5509eaa.zip |
fix: SLPVectorizer crashes for unreachable blocks containing not schedulable instructions.
In unreachable blocks it's legal to have instructions like "%x = op %x".
Such instuctions are not schedulable. Therefore the SLPVectorizer has to check for
unreachable blocks and ignore them.
Fixes bug 20646.
llvm-svn: 216256
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 9fea4450a10..3aced0b4c40 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -976,6 +976,14 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth) { Instruction *VL0 = cast<Instruction>(VL[0]); BasicBlock *BB = cast<Instruction>(VL0)->getParent(); + if (!DT->isReachableFromEntry(BB)) { + // Don't go into unreachable blocks. They may contain instructions with + // dependency cycles which confuse the final scheduling. + DEBUG(dbgs() << "SLP: bundle in unreachable block.\n"); + newTreeEntry(VL, false); + return; + } + // Check that every instructions appears once in this bundle. for (unsigned i = 0, e = VL.size(); i < e; ++i) for (unsigned j = i+1; j < e; ++j) |