[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 16 09:39:17 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()),
----------------
fhahn wrote:

This should query the cost using the ExtractValue opcode, if possible, instead of requiring there the be an underlying instruction.



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


More information about the llvm-commits mailing list