问题描述
我们正试图实现一个jit编译器,它的性能应该和clang -o4一样。是否有一个地方,我可以很容易地得到clang调用的优化通路列表,指定-o4?
We are trying to implement a jit compiler whose performance is supposed to be same as doing it with clang -o4. Is there a place where I could easily get the list of optimization passes invoked by clang with -o4 is specified?
推荐答案
我知道-O4的意思与-O3 +启用LTO(链接时间优化)相同。
查看下面的代码片段:
As far as I know -O4 means same thing as -O3 + enabled LTO (Link Time Optimization).See the folloing code fragments:
-
//手动将-O转换为-O2,将-O4转换为-O3;
-
//检查-O4。
- Tools.cpp
// Manually translate -O to -O2 and -O4 to -O3;
- Driver.cpp
// Check for -O4.
a href =http://llvm.org/docs/GoldPlugin.html>此处:
Also see here:
使用-emit-llvm或-flto从clang中获取bitcode文件,有关-O3标志的优化,请参见 PassManagerBuilder.cpp a>文件(查找OptLevel变量 - 它的值为3)。
For optimizations used with -O3 flag see this PassManagerBuilder.cpp file (look for OptLevel variable - it will have value 3).
这篇关于什么优化传递为-04在are?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!