diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index a1ff684b2b801..8813ea3c208b6 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -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(getUnderlyingValue())) + return Ctx.getLegacyCost(I, VF); return 0; }