From d5fb50e3bf483ede6ca1cbce5cc4a9d9d81d2671 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 2 Jul 2018 13:41:29 +0000 Subject: [SLPVectorizer] Remove nullptr early-outs from Instruction::ShuffleVector getEntryCost This code is only used by alternate opcodes so the InstructionsState has already confirmed that every Value is an Instruction, plus we use cast which will assert on failure. llvm-svn: 336102 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp') diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index f69f18db8c5..81878b7abb1 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -2357,15 +2357,11 @@ int BoUpSLP::getEntryCost(TreeEntry *E) { if (NeedToShuffleReuses) { for (unsigned Idx : E->ReuseShuffleIndices) { Instruction *I = cast(VL[Idx]); - if (!I) - continue; ReuseShuffleCost -= TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy); } for (Value *V : VL) { Instruction *I = cast(V); - if (!I) - continue; ReuseShuffleCost += TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy); } @@ -2373,8 +2369,6 @@ int BoUpSLP::getEntryCost(TreeEntry *E) { int VecCost = 0; for (Value *i : VL) { Instruction *I = cast(i); - if (!I) - break; assert(S.isOpcodeOrAlt(I) && "Unexpected main/alternate opcode"); ScalarCost += TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy); } -- cgit v1.2.3