+23
−0
Loading
InlineCost::getStaticBonusApplied() triggers an assertion failure if the CostBenefitPriority constructor calls it when IC.isVariable() is false. This is because getStaticBonusApplied() expects isVariable() to be true. Unconditionally populating CostBenefit also incorrectly prioritizes a NeverInline candidate with a cost-benefit pair over other valid variable-cost sites. This patch fixes the crash and the sorting issue by calling getStaticBonusApplied() and populating CostBenefit only when IC.isVariable() is true. For AlwaysInline and NeverInline costs, CostBenefit is explicitly set to std::nullopt.