]> granicus.if.org Git - llvm/commitdiff
[SLPVectorizer] Remove null-pointer test. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 23 Jul 2019 10:51:43 +0000 (10:51 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 23 Jul 2019 10:51:43 +0000 (10:51 +0000)
cast<CallInst> shouldn't return null and we dereference the pointer in a lot of other places, causing both MSVC + cppcheck to warn about dereferenced null pointers

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

lib/Transforms/Vectorize/SLPVectorizer.cpp

index 804a1e889ec3c9f6e23d88e4dbefb042b4a07ed8..e1b2653e50857d40637ba673540b1e2b9c6a765b 100644 (file)
@@ -3879,12 +3879,12 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
     case Instruction::Call: {
       CallInst *CI = cast<CallInst>(VL0);
       setInsertPointAfterBundle(E->Scalars, S);
-      Function *FI;
+
       Intrinsic::ID IID  = Intrinsic::not_intrinsic;
-      Value *ScalarArg = nullptr;
-      if (CI && (FI = CI->getCalledFunction())) {
+      if (Function *FI = CI->getCalledFunction())
         IID = FI->getIntrinsicID();
-      }
+
+      Value *ScalarArg = nullptr;
       std::vector<Value *> OpVecs;
       for (int j = 0, e = CI->getNumArgOperands(); j < e; ++j) {
         ValueList OpVL;