[llvm-dev] Improve LLVM IR dumps

Damian Bodnar via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 2 17:02:06 PDT 2018


Hi all,

I have been thinking about an improvement to -print-(before/after)-all 
feature. In some situations you want to check how code changes between 
different passes. This is already available in GCC using 
-fdump-tree-cfg. It would be great to have a similar way of dumping code 
in LLVM, possibly with Godbolt integration that makes it able to watch 
the differences.

The way how it is available now is nice, but quite inconvenient, so the 
idea is to:

1) Dump IR from each pass to separate file.
2) Make dumps complete. For now, dumps from some passes are partial, e. 
g. they contain only loop body.
3) Integrate with Godbolt.

Why to do this?
It helps to debug optimizations and other passes that change IR. It also 
makes compiler easier to be understood.

Your comments are greatly appreciated. What do you think about utility 
of the improvement?

Cheers,
Damian


More information about the llvm-dev mailing list