Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

llc has no debug or -view-dag-combine1-dags option

Tags:

llvm

llc

I have llc program installed on my computer via package manager (of course I have LLVM installed, 6.0.0 version). Also, I have it built from sources. What I want is to view DAGs, generated by llvm. But, unfortunately, I don't have any of options like -debug, -view-dag-combine1-dags and etc on both versions of llc. This drives me crazy since it is written everywhere, that this flags should help me, but it is not mentioned what to do if I don't have them. In help and man, there are no such options. I have graphviz, dot and gv installed, it should not be the problem.

Version of compiled llc.

./llc -version
LLVM (http://llvm.org/):
LLVM version 7.0.0svn
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: broadwell

Registered Targets:
   and targets...

I've built it with RelWithDebugInfo flag, maybe I should've built it with Debug flag? Or is there any flag in cmake, that I should enable? I believe that I've googled enough and I couldn't find any information.

like image 548
Nikita Vorobyev Avatar asked Oct 16 '25 09:10

Nikita Vorobyev


1 Answers

Executing llc --help-hidden | grep view-dag using my debug build results in:

-filter-view-dags= - Only display the basic block whose name matches this for all view-*-dags options
-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

If you look into llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp, that command-line option is between #ifndef NDEBUG preprocessor statements, so those options are only exposed when you have a debug build.

Changing the CMAKE_BUILD_TYPE to Debug and recompiling should be enough.

like image 165
compor Avatar answered Oct 18 '25 02:10

compor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!