什么优化传递为-04在are? [英] what optimization passes are done for -O4 in clang?

查看:195
本文介绍了什么优化传递为-04在are?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正试图实现一个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:

  • 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:


您可以

You can produce bitcode files from clang using -emit-llvm or -flto, or the -O4 flag which is synonymous with -O3 -flto.

使用-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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆