Dump LLVM IR output


#1

How do I dump the LLVM IR output into a string or a .txt file for python?

Can someone provide a code snippet ?

Thanks!


#2

https://docs.tvm.ai/tutorials/tensor_expr_get_started.html

Look for the snippet that does func.get_source() . As long as your target is set to llvm before you build the “function” , the output would be llvm ir.


#3

Hi,
does this work only on single functions or can I apply get_source() to a whole model?
I am interested in the LLVM IR of a model imported from ONNX, so I don’t think I can reach each node in the model “from the outside”