我想具体了解一下LLVM的各个优化级别分别对应什么。
也就是说,我想知道当我使用 llvm (或 clang 或 opt)的“-0x”选项时,哪些优化过程是准确执行的(在前端之外)以及按什么顺序执行。
相应工具的“man”没有提供关于此事的太多信息(与 gcc 的相反)。
我知道这个有用的页面:http://llvm.org/docs/Passes.html http://llvm.org/docs/Passes.html,但它不提供有关“-Ox”选项的任何信息。
我正在寻找一些调试或详细选项(特别是使用“opt --help”中的信息),但我找不到任何有用的选项。
作为补充,通过解析代码,我注意到所有各种 LLVM 工具以及 clang 使用不同的驱动程序,以自己的方式解析选项。所有这些驱动程序都与“-Ox”选项相似吗?
Edit:我找到了“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
这与我想要的很接近,但仍然有两个问题:
Edit:工具“opt”的选项“-debug-pass=Structure”提供了更多用户友好的数据(来自http://llvm.org/docs/WritingAnLLVMPass.html http://llvm.org/docs/WritingAnLLVMPass.html)
为什么有两个列表?
功能和模块通道有自己的通道管理器,因此单独打印。
其他工具有类似的选项吗,尤其是“clang”
使用 clang,您可以使用 -mllvm -debug-pass=Arguments。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)