How to get ICC to generate assembly code together with C code for MIC?

How to get ICC to generate assembly code together with C code for MIC?

I need to determine the assembly code correspondence of C code written for MIC.

For GCC, I have found the solution at this link: http://www.delorie.com/djgpp/v2faq/faq8_20.html

 gcc -c -g -Wa,-a,-ad foo.c > foo.c-and-assembly

 

Is there a similar solution for ICC?

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

When not using offload constructs (like #pragma offload or _Cilk_shared/_Cilk_offload) just compile using: -mmic -S -fsource-asm

For your example, compile using:  icc -mmic -S -fsource-asm -c foo.c

The assembly with source code annotations are collected in a <file>.s file named after the source file, so foo.s for the example above.

For source containing offload constructs, use -offload-option to pass the needed options to the offload compilation only.

For example: icc -offload-option,mic,compiler,"-S -c -fsource-asm" bar.c

Here, the assembly with source code annotations are collected in a <file>MIC.s file named after the source file, so barMIC.s for the example above.

These same options apply to Fortran (ifort) and C++ (icpc) also.

Leave a Comment

Please sign in to add a comment. Not a member? Join today