Riyaz Puthiyapurayil via llvm-dev
2021-Dec-10 02:30 UTC
[llvm-dev] InlineCost.cpp -- Use addCost instead of Cost += ...?
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<https://llvm.org/doxygen/MD5_8cpp.html#a96d73bbd7af15cb1fc38c3f4a3bd82e9>.getCallingConv() == CallingConv::Cold<https://llvm.org/doxygen/namespacellvm_1_1CallingConv.html#ae2dfe07f8d22cb91b60f72aae89c228fa94ec9273479164e4aec1d5d91b71dc85>) 980 Cost += InlineConstants::ColdccPenalty<https://llvm.org/doxygen/namespacellvm_1_1InlineConstants.html#a169b2b8289fb0aefc607ae29c8b95cc6>; be changed to: 977 // If this function uses the coldcc calling convention, prefer not to inline 978 // it. 979 if (F<https://llvm.org/doxygen/MD5_8cpp.html#a96d73bbd7af15cb1fc38c3f4a3bd82e9>.getCallingConv() == CallingConv::Cold<https://llvm.org/doxygen/namespacellvm_1_1CallingConv.html#ae2dfe07f8d22cb91b60f72aae89c228fa94ec9273479164e4aec1d5d91b71dc85>) 980 addCost(InlineConstants::ColdccPenalty<https://llvm.org/doxygen/namespacellvm_1_1InlineConstants.html#a169b2b8289fb0aefc607ae29c8b95cc6>); 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211210/e66028f5/attachment.html>
chuanqi.xcq via llvm-dev
2021-Dec-10 03:33 UTC
[llvm-dev] InlineCost.cpp -- Use addCost instead of Cost += ...?
Hi Riyaz, Personally, I think this is a good fix. I think you could try to contribute this. Here is the contribute doc: https://llvm.org/docs/Contributing.html Thanks, Chuanqi ------------------------------------------------------------------ From:llvm-dev <llvm-dev at lists.llvm.org> Send Time:2021年12月10日(星期五) 10:30 To:llvm-dev <llvm-dev at lists.llvm.org> Subject:[llvm-dev] InlineCost.cpp -- Use addCost instead of Cost += ...? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211210/755609fa/attachment.html>