[PATCH] D128302: [AArch64][CostModel] Detects that ExtractElement at index is not free in AArch64 when result is used as integer.

Mingming Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 12:44:51 PDT 2022


mingmingl added a comment.





================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1155
 
   /// \return The expected cost of vector Insert and Extract.
   /// Use -1 to indicate that there is no information on the index value.
----------------
davidxl wrote:
> Perhaps document this that this is used when the instruction is not available.
Done. Mention the typical use as provision vectorization/scalarization cost in vectorizer passes.


================
Comment at: llvm/lib/Analysis/TargetTransformInfo.cpp:869
+  // callers, but never asserted upon.
+  assert((Opcode == Instruction::ExtractElement ||
+          Opcode == Instruction::InsertElement) &&
----------------
davidxl wrote:
> probably submit this as a NFC patch seperately?
Sure. Will leave the FIXME inside this function, and the assert the newly added 'getVectorInstrCost'.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h:176
 
+  using BaseT::getVectorInstrCost;
   InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val,
----------------
davidxl wrote:
> what is the purpose of the using statement here?
Oh good catch. This is a mistake. 'using statement' is not needed for AArch64 since there is an override for new interface.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128302/new/

https://reviews.llvm.org/D128302



More information about the llvm-commits mailing list