Skip to content

Commit 87adcf8

Browse files
committed
[SLPVectorizer] Remove null-pointer test. NFCI.
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 llvm-svn: 366793
1 parent 739a935 commit 87adcf8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3879,12 +3879,12 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
38793879
case Instruction::Call: {
38803880
CallInst *CI = cast<CallInst>(VL0);
38813881
setInsertPointAfterBundle(E->Scalars, S);
3882-
Function *FI;
3882+
38833883
Intrinsic::ID IID = Intrinsic::not_intrinsic;
3884-
Value *ScalarArg = nullptr;
3885-
if (CI && (FI = CI->getCalledFunction())) {
3884+
if (Function *FI = CI->getCalledFunction())
38863885
IID = FI->getIntrinsicID();
3887-
}
3886+
3887+
Value *ScalarArg = nullptr;
38883888
std::vector<Value *> OpVecs;
38893889
for (int j = 0, e = CI->getNumArgOperands(); j < e; ++j) {
38903890
ValueList OpVL;

0 commit comments

Comments
 (0)