diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index 967e527b16d51..84d00d50e7bc8 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -7668,6 +7668,11 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) { } BS->initialFillReadyList(ReadyInsts); + assert((!ReadyInsts.empty() || + (VectorizableTree.size() == 1 && + VectorizableTree[0]->State == TreeEntry::NeedToGather)) && + "why no ready insts from scheduleable tree?"); + Instruction *LastScheduledInst = BS->ScheduleEnd; // Do the "real" scheduling.