osg*_*sgx 14 compiler-construction debugging llvm clang
我想为clang/LLVM找到一些像gcc一样工作的调试选项-fdump-tree-all-all -fdump-rtl-all-all -fdump-ipa-all-all.
基本上我想有一个LLVM IR之前转储和每个优化通后,也可以是有用的,从铛和AST的所有转储代码生成的各个阶段(后端阶段,选择DAG,ISEL-SDNode,寄存器分配,MCInsts ).
我只能找到铿锵声-ccc-print-phases,但它只会打印高级阶段名称,例如preprocess-compile-assemble-link; 但没有任何IR转储.
还有LLVM文件中的Life指令,可以-cc1-ast-dump选择转储clang AST,但我想要更多,特别是对于codegen.
Eli*_*sky 14
您似乎已经发现了如何在Clang AST级别和LLVM IR级别上执行转储.对于codegen,以下内容非常有用:
-debug对于教学选择和后期阶段的详细文本转储.此外,-view*-dags节目(弹出)DAG:
$ llc -help-hidden|grep dags
-view-dag-combine-lt-dags - Pop up a window to show dags before the post legalize types dag combine pass
-view-dag-combine1-dags - Pop up a window to show dags before the first dag combine pass
-view-dag-combine2-dags - Pop up a window to show dags before the second dag combine pass
-view-isel-dags - Pop up a window to show isel dags as they are selected
-view-legalize-dags - Pop up a window to show dags before legalize
-view-legalize-types-dags - Pop up a window to show dags before legalize types
-view-misched-dags - Pop up a window to show MISched dags after they are processed
-view-sched-dags - Pop up a window to show sched dags as they are processed
-view-sunit-dags - Pop up a window to show SUnit dags after they are processed
Run Code Online (Sandbox Code Playgroud)
如果您尚未使用graphviz支持配置和编译LLVM,则可能不会显示这些内容.
并非完全关于您的问题,但是要查看通过的通行证,您可以执行以下操作:
clang test.c -Ofast -march=core-avx2 -mllvm -debug-pass=Arguments
您将看到类似以下内容:
Pass Arguments: -datalayout -notti -basictti -x86tti -targetlibinfo -jump-instr-table-info -targetpassconfig -no-aa -tbaa -scoped-noalias -basicaa -collector-metadata -machinemoduleinfo -machine-branch-prob -jump-instr-tables -verify -verify-di -domtree -loops -loop-simplify -scalar-evolution -iv-users -loop-reduce -gc-lowering -unreachableblockelim -consthoist -partially-inline-libcalls -codegenprepare -verify-di -stack-protector -verify -domtree -loops -branch-prob -machinedomtree -expand-isel-pseudos -tailduplication -opt-phis -machinedomtree -slotindexes -stack-coloring -localstackalloc -dead-mi-elimination -machinedomtree -machine-loops -machine-trace-metrics -early-ifcvt -machinelicm -machine-cse -machine-sink -peephole-opts -dead-mi-elimination -processimpdefs -unreachable-mbb-elimination -livevars -machinedomtree -machine-loops -phi-node-elimination -twoaddressinstruction -slotindexes -liveintervals -simple-register-coalescing -misched -machine-block-freq -livedebugvars -livestacks -virtregmap -liveregmatrix -edge-bundles -spill-code-placement -virtregrewriter -stack-slot-coloring -machinelicm -edge-bundles -prologepilog -machine-block-freq -branch-folder -tailduplication -machine-cp -postrapseudos -machinedomtree -machine-loops -post-RA-sched -gc-analysis -machine-block-freq -block-placement2 -stackmap-liveness -machinedomtree -machine-loops
| 归档时间: |
|
| 查看次数: |
9276 次 |
| 最近记录: |