[llvm] [CostModel][AArch64] Make extractelement, with fmul user, free whenev… (PR #111479)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 01:24:06 PDT 2024


================
@@ -1392,6 +1392,19 @@ class TargetTransformInfo {
                                      unsigned Index = -1, Value *Op0 = nullptr,
                                      Value *Op1 = nullptr) const;
 
+  /// \return The expected cost of vector Insert and Extract.
+  /// Use -1 to indicate that there is no information on the index value.
+  /// This is used when the instruction is not available; a typical use
+  /// case is to provision the cost of vectorization/scalarization in
+  /// vectorizer passes.
+  InstructionCost getVectorInstrCost(
+      unsigned Opcode, Type *Val, TTI::TargetCostKind CostKind, unsigned Index,
+      Value *Op0, Value *Op1, Value *Scalar,
+      const DenseMap<std::pair<Value *, unsigned>, SmallVector<Value *, 4>>
----------------
david-arm wrote:

In general in user interfaces I thought we typically avoided passing in `SmallVector<Type, 4>` in favour of `SmallVectorImpl<Type>` so that the user is not tied to a particular initial size?

https://github.com/llvm/llvm-project/pull/111479


More information about the llvm-commits mailing list