As of Intel C/C++ compiler version 126.96.36.199, is it possible to make optimization report print out information on dead code elimination decisions? I have a case where I suspect that dead code elimination occurs. I have scrutinized the compiler output with "-opt-report=3", but could not find any hints on dead code elimination.
The interprocedural phase should optimize for dead code if any in the application. The option "-opt-report-phase=ipo -opt-report=2" should ouput the routines that were dead and eliminated.
If you meant just a piece of code within a routine, we have never reported this in the opt report, and don’t have any plans at the moment to do that in future releases.
But if you meant dead function elimination, then you can just use -opt-report
static int foo()
extern int main()
%icc t.c -opt-report
<;-1:-1;IPO ROUTINE ATTRIBUTES PROPAGATION;;0>
ROUTINE ATTRIBUTE PROPAGATION TOTALS:
RDECL: NSE(0->0) AR(0->0) NORET(0->0) DR(0->0) NT(0->0)
RDECL: MF(0->0) OMPPAR(0->0)
<t.c;-1:-1;IPO DEAD STATIC FUNCTION ELIMINATION;foo;0>
DEAD STATIC FUNCTION ELIMINATION:
Routine was called explicity
2 FUNCTIONS HAD VALID STATIC PROFILES
IPO CURRENT QUALITY METRIC: 50.0%
IPO POSSIBLE QUALITY METRIC: 50.0%
IPO QUALITY METRIC RATIO: 100.0%
Hope the above answers your question