[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 26 13:44:57 PST 2025


================
@@ -1468,6 +1468,15 @@ class TargetTransformInfo {
                                      TTI::TargetCostKind CostKind,
                                      unsigned Index = -1) const;
 
+  /// \return The expected of aggregate inserts and extracts. Use an empty
+  /// ArrayRef to indicate that there is no information on the indices. 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 getInsertExtractValueCost(unsigned Opcode, Type *AggType,
----------------
MacDue wrote:

I chose 0 to match the default value used in `getInstructionCost()`:

https://github.com/llvm/llvm-project/blob/80ab237c1187aa7e8a1f546175887d768fa14e2d/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h#L1299-L1301

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


More information about the llvm-commits mailing list