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

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 07:41:30 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()),
----------------
MacDue wrote:

I couldn't find a way to call `TLI.getInstructionCost` for `extractvalue` without having an instruction. However, since these are treated as free, I've just changed this to `return 0`. 

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


More information about the llvm-commits mailing list