[PATCH] D145908: [X86] Remove unreachable code in X86TargetTransformInfo.cpp

Wang, Xin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 13 02:23:39 PDT 2023


XinWang10 created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
XinWang10 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D145908

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


Index: llvm/lib/Target/X86/X86TargetTransformInfo.cpp
===================================================================
--- llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -4396,11 +4396,6 @@
     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;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145908.504557.patch
Type: text/x-patch
Size: 687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230313/6ef83c40/attachment.bin>


More information about the llvm-commits mailing list