summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-07-02 13:41:29 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-07-02 13:41:29 +0000
commitd5fb50e3bf483ede6ca1cbce5cc4a9d9d81d2671 (patch)
tree542c430e3a1efb0aff8bf89ebae147c17032ef98 /llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
parent951f617e163e90eb89419e34e642b16c52ad6cc8 (diff)
downloadbcm5719-llvm-d5fb50e3bf483ede6ca1cbce5cc4a9d9d81d2671.tar.gz
bcm5719-llvm-d5fb50e3bf483ede6ca1cbce5cc4a9d9d81d2671.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp6
1 files changed, 0 insertions, 6 deletions
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<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);
}
OpenPOWER on IntegriCloud