LLVM执行哪种优化?

Ant*_*uve 11 optimization llvm

我想具体了解LLVM的各种优化级别对应的内容.

也就是说,我想知道哪些优化传递是完全执行的(在前端之外)以及当我使用llvm(或clang或opt)的"-0x"选项时的顺序.相应工具的"人"没有提供关于此事的大量信息(对于gcc的对话).

我知道这个有用的页面:http://llvm.org/docs/Passes.html,但它没有提供有关"-Ox"选项的任何信息.我正在寻找一些调试或冗长的选项(尤其是使用"opt --help"中的信息),但我找不到任何有用的选项.

作为补充,我注意到通过解析代码,所有各种LLVM工具以及clang使用不同的驱动程序,这些驱动程序以自己的方式解析选项.所有这些驱动程序是否与"-Ox"选项相似?

编辑:我为"opt"工具找到了"-debug-pass = Arguments"选项,它为选项"O1"提供了以下输出:

Pass Arguments:  -targetdata -no-aa -tbaa -targetlibinfo -basicaa -simplifycfg -domtree -scalarrepl -early-cse -lower-expect
Pass Arguments:  -targetlibinfo -targetdata -no-aa -tbaa -basicaa -globalopt -ipsccp -deadargelim -instcombine -simplifycfg -basiccg -prune-eh -always-inline -functionattrs -scalarrepl-ssa -domtree -early-cse -simplify-libcalls -lazy-value-info -jump-threading -correlated-propagation -simplifycfg -instcombine -tailcallelim -simplifycfg -reassociate -domtree -loops -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-idiom -loop-deletion -loop-unroll -memdep -memcpyopt -sccp -instcombine -lazy-value-info -jump-threading -correlated-propagation -domtree -memdep -dse -adce -simplifycfg -instcombine -strip-dead-prototypes -preverify -domtree -verify
Run Code Online (Sandbox Code Playgroud)

这与我想要的完全不同,但仍有两个问题:

  • 为什么有两个名单?

  • 其他工具有什么类似的选择,尤其是"铿锵"?(根据我的测试,"-debug-pass = Arguments"不适用于clang)

编辑:工具"opt"的选项"-debug-pass = Structure"提供更多用户友好的数据(来自http://llvm.org/docs/WritingAnLLVMPass.html)

ech*_*sto 11

为什么有两个名单?

函数和模块传递有自己的传递管理器,因此单独打印.

是否有其他工具的类似选项,尤其是"铿锵"

使用clang,您可以使用-mllvm -debug-pass = Arguments.