]> granicus.if.org Git - llvm/commitdiff
[SLPVectorizer] Silence null dereference warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 16 Aug 2019 10:28:23 +0000 (10:28 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 16 Aug 2019 10:28:23 +0000 (10:28 +0000)
cppcheck + MSVC analyzer both over zealously warn that we might dereference a null Bundle pointer - add an assertion to check for null to silence the warning, plus its a good idea to check that we succeeded in finding a schedule bundle anyway....

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369094 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/SLPVectorizer.cpp

index e2a04dbaa8fdb8ae6a5eb38c2a871d2ca661c42b..7381e8014fa1528dcc87284f150ad6287676ee83 100644 (file)
@@ -4308,6 +4308,7 @@ bool BoUpSLP::BlockScheduling::tryScheduleBundle(ArrayRef<Value *> VL,
     resetSchedule();
     initialFillReadyList(ReadyInsts);
   }
+  assert(Bundle && "Failed to find schedule bundle");
 
   LLVM_DEBUG(dbgs() << "SLP: try schedule bundle " << *Bundle << " in block "
                     << BB->getName() << "\n");