Intel icc: how to dump optimized code as a C file

Option

Gcc -fdump-tree-optimized resets the optimized version of your C code as a C file. Is there a way I can do the same with the Intel icc compiler?

I have a matrix multiplication code that I compiled as icc -O3 -ipo mult.c I want to see how the compiler performed the optimization. If nothing works, I will create assembly code for the program.

+6
source share
1 answer

Technically, -fdump-tree-optimized does not reset the C representation, but a textual partial representation of the Gimple code used inside GCC (Gimple is an internal representation of mid-level instruction instructions that most GCC independent optimization optimizations work on).

But icc is a proprietary compiler (black box), so from the point of view of its provider it is not interesting (for Intel) to show how icc works.

GCC has the ability to show its internal submissions, because it is free software. Native compilers do not want to show how they work.

If this is a class, you can try LLVM. (But I do not know how to derive internal representations inside).

And more importantly, if this is a class, you can invite your student to use GCC 4.6 to develop a plug-in or the GCC MELT extension to study and optimize experiments. MELT is a high-level domain language for the GCC extension, and it provides many features to facilitate such tasks.

+2
source

Source: https://habr.com/ru/post/900090/


All Articles