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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 00:47:56 PST 2025


================
@@ -1506,6 +1514,8 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
     return Ctx.TTI.getArithmeticInstrCost(Instruction::Mul, VectorTy,
                                           Ctx.CostKind);
   }
+  case Instruction::ExtractValue:
+    return 0;
----------------
fhahn wrote:

Should this call something like `getVectorInstrCost`?

Would be good to make sure we estimate the cost correctly when the extracts might not be completely free, e.g. if the results are returned via the stack (e.g. something like https://llvm.godbolt.org/z/zsv3G3h7n)


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


More information about the llvm-commits mailing list