Skip to content

Commit

Permalink
[X86] Remove unreachable code in X86TargetTransformInfo.cpp
Browse files Browse the repository at this point in the history
In Function getVectorInstrCost, situation Opcode == Instruction::ExtractElement
and Opcode == Instruction::InsertElement are all handled in the first 2 if-statements,
So we have no chance for the code in line 4401.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D145908
  • Loading branch information
XinWang10 authored and xin10.wang committed Mar 17, 2023
1 parent 9d8b60d commit 7bb14f1
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions llvm/lib/Target/X86/X86TargetTransformInfo.cpp
Expand Up @@ -4396,11 +4396,6 @@ InstructionCost X86TTIImpl::getVectorInstrCost(unsigned Opcode, Type *Val,
return ShuffleCost + IntOrFpCost + RegisterFileMoveCost;
}

// Add to the base cost if we know that the extracted element of a vector is
// destined to be moved to and used in the integer register file.
if (Opcode == Instruction::ExtractElement && ScalarType->isPointerTy())
RegisterFileMoveCost += 1;

return BaseT::getVectorInstrCost(Opcode, Val, CostKind, Index, Op0, Op1) +
RegisterFileMoveCost;
}
Expand Down

0 comments on commit 7bb14f1

Please sign in to comment.