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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 03:42:19 PST 2025


================
@@ -1442,6 +1451,9 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
     Type *VectorTy = toVectorTy(Ctx.Types.inferScalarType(this), VF);
     return Ctx.TTI.getArithmeticInstrCost(Instruction::Mul, VectorTy, CostKind);
   }
+  case Instruction::ExtractValue:
+    return Ctx.TTI.getInstructionCost(cast<Instruction>(getUnderlyingValue()),
----------------
david-arm wrote:

Hmm, this is actually asking for the cost of the scalar version of the extract. Looking at llvm/Analysis/TargetTransformInfoImpl.h::getInstructionCost it seems like we return TTI::TCC_Free anyway so I guess this is ok.

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


More information about the llvm-commits mailing list