diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -1758,9 +1758,9 @@ // While Threshold depends on commandline options that can take negative // values, we want to enforce the invariant that the computed threshold and // bonuses are non-negative. - assert(Threshold >= 0); - assert(SingleBBBonus >= 0); - assert(VectorBonus >= 0); + assert(ComputeFullInlineCost || Threshold >= 0); + assert(ComputeFullInlineCost || SingleBBBonus >= 0); + assert(ComputeFullInlineCost || VectorBonus >= 0); // Speculatively apply all possible bonuses to Threshold. If cost exceeds // this Threshold any time, and cost cannot decrease, we can stop processing