[SLP] Merge null and dyn_cast<> checks into dyn_cast_or_null<>. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 22 Sep 2020 12:44:35 +0000 (13:44 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 22 Sep 2020 13:01:47 +0000 (14:01 +0100)
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

index 5fad740..8f73d5c 100644 (file)
@@ -7421,9 +7421,7 @@ static bool tryToVectorizeHorReductionOrInstOperands(
 bool SLPVectorizerPass::vectorizeRootInstruction(PHINode *P, Value *V,
                                                  BasicBlock *BB, BoUpSLP &R,
                                                  TargetTransformInfo *TTI) {
-  if (!V)
-    return false;
-  auto *I = dyn_cast<Instruction>(V);
+  auto *I = dyn_cast_or_null<Instruction>(V);
   if (!I)
     return false;