Can I dump SelectionDAG as texts?

Hello everyone. I am new to most of LLVM.

I am trying to extract information in the IR form of the program. To my best knowledge, the graph form of IR suits my need, and SelectionDAG before any lowering is the closest. Is there a form of dump that can be easily parsed by another program?

Unfortunately SelectionDAG doesn’t have any deserializable format but if you’re only looking for a textual format, I think SelectionDAG::dump would fit your need

Great! Can I pass a shell option to the compiler to enable this?

opt -debug-only=isel will dump the SelectionDAG after each stage (e.g. legalization). Note that -debug-only is disabled in release build of LLVM.

1 Like