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

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 12:00:48 PDT 2022


davidxl added inline comments.


================
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.
----------------
Perhaps document this that this is used when the instruction is not available.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1161
+  /// \return The expected cost of vector Insert and Extract.
+  /// Caller guarantees that 'I' is not nullptr.
+  ///
----------------
Mention that this interface is used when I is available (and the interface implementation asserts it is not nullptr).


================
Comment at: llvm/lib/Analysis/TargetTransformInfo.cpp:869
+  // callers, but never asserted upon.
+  assert((Opcode == Instruction::ExtractElement ||
+          Opcode == Instruction::InsertElement) &&
----------------
probably submit this as a NFC patch seperately?


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.h:176
 
+  using BaseT::getVectorInstrCost;
   InstructionCost getVectorInstrCost(unsigned Opcode, Type *Val,
----------------
what is the purpose of the using statement here?


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