Generating Control Flow Graphs using opt

I am trying to generate the dot files to view control flow graphs with the following command : $ opt -dot-cfg -disable-output foo.ll but no files are generated (I have looked through the hidden files too). Kindly guide me on how to generate and view CFGs.

Thanks in anticipation.

That’s odd, you should get dot file outputs for all the functions present in foo.ll, with the output:
Writing ‘.function1.dot’…
Writing ‘.function2.dot’…

Are you able to invoke any other pass with opt, also share the content of foo.ll

1 Like

I think optnone (link) will prevent -dot-cfg from running

1 Like