[llvm] [LV]: Add costs to VPInstruction (PR #125008)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 30 01:18:26 PST 2025


================
@@ -1315,6 +1315,9 @@ class VPInstruction : public VPRecipeWithIRFlags,
   InstructionCost computeCost(ElementCount VF,
                               VPCostContext &Ctx) const override {
     // TODO: Compute accurate cost after retiring the legacy cost model.
+    // Use legacy cost model for now.
+    if (auto *I = dyn_cast_or_null<Instruction>(getUnderlyingValue()))
----------------
david-arm wrote:

Hi @hassnaaHamdi, I think you should be able to do this without falling back on the legacy cost model. I also plan to put a patch up fairly soon that start's filling this function in properly because it's needed for the early exit work. What instructions were you hitting when getting into this instruction?

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


More information about the llvm-commits mailing list