[llvm] [VPlan] Add cost for `VPWidenMemoryRecipe` (PR #105614)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 02:18:12 PDT 2024


================
@@ -2084,6 +2084,37 @@ void VPPredInstPHIRecipe::print(raw_ostream &O, const Twine &Indent,
 }
 #endif
 
+InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
+                                                 VPCostContext &Ctx) const {
+  Instruction *I = getInstructionForCost(this);
+  Type *Ty = ToVectorTy(getElementType(), VF);
+  const Align Alignment = getLoadStoreAlignment(const_cast<Instruction *>(I));
+  const Value *Ptr = getLoadStorePointerOperand(I);
----------------
fhahn wrote:

Sink closer to use? Is this required? Using the original IR pointer here won't be accurate I think. If needed, please leave a TODO behind to refactor reliance on underlying IR here and explain why it is currently needed.

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


More information about the llvm-commits mailing list