mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216256 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user