[PATCH] D131114: [AArch64][TTI][NFC] Overload method 'getVectorInstrCost' to provide vector instruction itself, as a context information for cost estimation.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 15:03:37 PDT 2022


davidxl added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetTransformInfo.h:1181
+  /// exists (e.g., from basic blocks during transformation).
+  InstructionCost getVectorInstrCost(const Instruction *I, Type *Val,
+                                     unsigned Index = -1) const;
----------------
Is the Type *val always from instruction? If yes, this parameter can be removed.  Alternatively add an assert in the implementation that I->getType() == Val.  The latter may be better  as Type is readily available at callsite.


================
Comment at: llvm/test/Analysis/CostModel/AArch64/kryo.ll:36
 
+    ; Vector extracts - extracting each element should have a cost
+    ; if they are used as integers.
----------------
This test change belong to the follow up patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131114



More information about the llvm-commits mailing list