[X86] Remove unreachable code in X86TargetTransformInfo.cpp
authorWang, Xin10 <xin10.wang@intel.com>
Fri, 17 Mar 2023 02:55:08 +0000 (22:55 -0400)
committerxin10.wang <wangxin8@f90srv19.nh.intel.com>
Fri, 17 Mar 2023 04:33:06 +0000 (00:33 -0400)
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

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

index fb05dc0..e2678f3 100644 (file)
@@ -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;
 }