如何找出在使用gcc时实际应用哪些优化? [英] How to find out which optimizations are actually applied when using gcc?
问题描述
对于IBM的XL编译器系列,可以提供两个选项( -qreport
和 -qlist
)来生成
是否可以获取每个源文件的报告,其中包括应用了哪些优化,哪些部分的代码无法优化(以及为什么)类似的报告GNU的g ++ - 如果是的话,怎么做?
-fdump-tree-all
获取负载信息。 $ c> -fopt-info- [options] 将给你访问更高级的优化信息,例如当应用特定优化时,错过等。
-fopt-info-inline-optimized-missed
打印所有成功和错过的内联优化(在本例中为 stderr
)。
在早期版本中,它们有 -ftree-vectorizer-
所有这些选项都列在此处 http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html 虽然可以有点棘手的挑选出有用的。
With IBM's XL compiler family it is possible to supply two options (-qreport
and -qlist
) to generate reports for each source file that include information on which optimizations were applied, or which parts of the code could not be optimized (and why).
Is it possible to get a similar reporting for GNU's g++ - and if yes, how to do it?
Have a look at the -fdump-tree-[switch]
flags. You can use -fdump-tree-all
to get loads of information.
Also in trunk gcc -fopt-info-[options]
will give you access higher level optimization information e.g. when particular optimizations were applied, missed etc e.g.
-fopt-info-inline-optimized-missed
Prints all successful and missed inlining optimizations (to stderr
in this case). This is obviously pretty new functionality so I'm not sure how well supported it is yet.
In earlier releases they had -ftree-vectorizer-verbose=n
which is now being deprecated in favor of opt-info.
All these options are listed here http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html though it can be a bit tricky to pick out the useful ones.
这篇关于如何找出在使用gcc时实际应用哪些优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!