开发者

Recommended clang optimization level?

开发者 https://www.devze.com 2023-04-07 00:30 出处:网络
What\'s the \"standard\" op开发者_StackOverflow中文版timization level used for clang? I believe that \"O2\" is a good choice for gcc - does that hold for clang also, or is there a generally better alt

What's the "standard" op开发者_StackOverflow中文版timization level used for clang? I believe that "O2" is a good choice for gcc - does that hold for clang also, or is there a generally better alternative?


-O2 and -Os are both good choices for general use with clang.


-O3 will usually give you both the smallest and fastest code, but does tend to expose non obvious bugs in your code.

In general, you should make sure your code runs fine with all possible optimizations.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号