Shouldn’t this:
https://llvm.org/doxygen/InlineCost_8cpp_source.html
977 // If this function uses the coldcc calling convention, prefer not to inline
978 // it.
979 if (F.getCallingConv() == CallingConv::Cold)
980 Cost += InlineConstants::ColdccPenalty;
be changed to:
977 // If this function uses the coldcc calling convention, prefer not to inline
978 // it.
979 if (F.getCallingConv() == CallingConv::Cold)
980 addCost(InlineConstants::ColdccPenalty);
Maybe, it is unlikely for Cost to overflow that early in the cost computation but for consistency’s sake, it should perhaps use addCost.
/Riyaz