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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 14:37:19 PST 2025


================
@@ -745,6 +745,19 @@ class TargetTransformInfoImplBase {
     return 1;
   }
 
+  InstructionCost getInsertExtractValueCost(unsigned Opcode, Type *AggType,
+                                            TTI::TargetCostKind CostKind,
+                                            ArrayRef<unsigned> Indices,
+                                            Value *AggDef) const {
+    // Extract/insert values are generally assumed to be free (as the aggregates
+    // will be removed e.g. by SROA). A target may want to override this to cost
+    // an extract operation differently based on the producer (AggDef). E.g. if
----------------
fhahn wrote:

Not 100% sure about including this here, TTI generally tries to answer the cost of the current state. Might be best to just leave it for the producers to account for the cost

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


More information about the llvm-commits mailing list