Discussion on #1944 made me think about some extra improvement for information dump and I'd like to get your opinion on this.
How about dumps before lowering, that is on each of the stages (input graph, high-level, low-level)? Have you considered that? I think this would also be helpful to have it I couldn't find anything in sources. In long run it could even be expanded to LLVM/GCC level, where you can dump each optimization. That would be cool to see how optimizations are working. I fond it very useful working on compilers.
@sebap123 one of the thing, you could simply instrument code manually, compile and run.
The matter of dumping something at any point is a one-line change. Adding more options might make loader options messy, but no strong opinion on this.
@rdzhabarov yes, I agree that code change can be done at any point. I'm not claiming it is ground breaking change :) But this will just make things so much easier, without the need for recompiling code.
This can be especially helpful for any problem reports. I'd find it much easier to just create a dump for my use case rather than need to made hand changes in code and recompile it.
As for making messy, that would also be a question for further development plans and vision for adding new options. Also, deciding how those options should be formatted. I especially like how GCC have it resolved where pattern is -fdump-\
@sebap123 I think that this is something to consider. Can you implement this feature in a clean/readable way? Let's take a look at the implementation and see what's possible.
@nadavrot ok, I'll try to implement something and let's go with further discussion from there.
I think this is also tied to refactoring our optimization pipeline to make it more regular: #1659
@qcolombet yes, I agree with you. I was't aware of this PR. Having it merged it would be much easier to extend the whole thing with optimization info dumping.