Dot file not genearting for -view-isel-dags option

浪尽此生 提交于 2020-05-14 09:12:09

问题


While trying to see the SelectionDag nodes generated during the instruction selection phase using LLVM (built from sources with debug mode enabled), I am using the below command which is not creating Graphviz DOT file.

llc -view-isel-dags sum.bc

Instead it is creating sum.s file. Is there something I'm missing here?

sum.c

int sum(int x, int y) {
  return x+y;
}

sum.bc

$ clang -emit-llvm sum.c -c -o sum.bc

LLVM information

$ llc -help-hidden | grep 'view-isel' -view-isel-dags - Pop up a window to show isel dags as they are selected

$ llvm-config --build-mode
Debug

回答1:


Guess the problem is with fast instruction selection which is enabled by default.

$ llc -debug sum.ll

Skipping pass 'X86 DAG->DAG Instruction Selection' on function sum

Changing optimization level for Function sum Before: -O2 ; After: -O0

FastISel is enabled

Disabling fastIsel resolved this problem.

$ llc -fast-isel=false -view-dag-combine1-dags sum.ll



来源:https://stackoverflow.com/questions/52055437/dot-file-not-genearting-for-view-isel-dags-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!