[SLP] remove dead null check; NFC
authorSanjay Patel <spatel@rotateright.com>
Tue, 9 Mar 2021 21:56:43 +0000 (16:56 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 9 Mar 2021 22:43:07 +0000 (17:43 -0500)
We cast<> to Instruction (not dyn_cast<>), so we already
required/assumed that Cmp is not null.

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

index 065ddca..10ee163 100644 (file)
@@ -6682,7 +6682,7 @@ class HorizontalReduction {
                             bool IsRedOp) {
     if (IsRedOp && isCmpSel(Kind)) {
       auto *Cmp = cast<Instruction>(cast<SelectInst>(I)->getCondition());
-      return I->getParent() == BB && Cmp && Cmp->getParent() == BB;
+      return I->getParent() == BB && Cmp->getParent() == BB;
     }
     return I->getParent() == BB;
   }