[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<Instruction> which will assert on failure.

llvm-svn: 336102
This commit is contained in:
Simon Pilgrim 2018-07-02 13:41:29 +00:00
parent 951f617e16
commit d5fb50e3bf
1 changed files with 0 additions and 6 deletions

View File

@ -2357,15 +2357,11 @@ int BoUpSLP::getEntryCost(TreeEntry *E) {
if (NeedToShuffleReuses) {
for (unsigned Idx : E->ReuseShuffleIndices) {
Instruction *I = cast<Instruction>(VL[Idx]);
if (!I)
continue;
ReuseShuffleCost -=
TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy);
}
for (Value *V : VL) {
Instruction *I = cast<Instruction>(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<Instruction>(i);
if (!I)
break;
assert(S.isOpcodeOrAlt(I) && "Unexpected main/alternate opcode");
ScalarCost += TTI->getArithmeticInstrCost(I->getOpcode(), ScalarTy);
}