[技术问答] KEIL编译器优化等级介绍

[复制链接]
 楼主| Bruing 发表于 2019-3-29 11:31 | 显示全部楼层 |阅读模式
0    Minimum optimization. Turns off most optimizations.It gives the best possible debug view and the lowest level of optimization.            近乎不优化,用于调试代码。出现代码行不能设置断点可如此设置试试。
1          Restrictedoptimization. Removes unused inline functions and unused static functions.Turns off optimizations that seriously degrade the debug view. Ifused with --debug, this option gives a satisfactorydebug view with good code density.部分优化。移除未调用的内联函数和静态函数,关闭debug窗口优化,此状态也能用于调试
2          Highoptimization. If used with--debug, the debug viewmight be less satisfactory because the mapping of object code tosource code is not always clear.

This is the default optimization level.

            默认优化等级。如果处于debug状态,部分代码行将不能被调试,具体做了什么优化好像没说
3    Maximumoptimization.-O3 performs the same optimizationsas-O2 however the balance between space and timeoptimizations in the generated code is more heavily weighted towardsspace or time compared with-O2. That is:

-O3 -Otime aims to produce fastercode than-O2 -Otime, at the risk of increasingyour image size

-O3 -Ospace aims to produce smallercode than-O2 -Ospace, but performance might bedegraded.

In addition, -O3 performs extra optimizationsthat are more aggressive, such as:

High-levelscalar optimizations, including loop unrolling, for-O3-Otime. Thiscan give significant performance benefits at a small code size cost,but at the risk of a longer build time.

More aggressive inlining and automatic inliningfor-O3 -Otime.

零三翟邢止胃 发表于 2019-4-1 09:51 | 显示全部楼层
真是可以的啊! 感谢分享啊! 真是不错啊!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

71

主题

308

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部

71

主题

308

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部