[llvm] 7bb14f1 - [X86] Remove unreachable code in X86TargetTransformInfo.cpp

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 21:33:15 PDT 2023


Author: Wang, Xin10
Date: 2023-03-17T00:33:06-04:00
New Revision: 7bb14f196b2fc332c0fec46cb2ab6ac641efa1e3

URL: https://github.com/llvm/llvm-project/commit/7bb14f196b2fc332c0fec46cb2ab6ac641efa1e3
DIFF: https://github.com/llvm/llvm-project/commit/7bb14f196b2fc332c0fec46cb2ab6ac641efa1e3.diff

LOG: [X86] Remove unreachable code in X86TargetTransformInfo.cpp

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

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index fb05dc0e96cce..e2678f337384d 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -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;
 }


        


More information about the llvm-commits mailing list