Using compiler reports to diagnose optimization opportunities

You can use the -qlistfmt option to generate a compiler report in XML or HTML format. It provides information about how your program is optimized. You can also use the genhtml utility to convert an existing XML report to HTML format. This information helps you understand your application codes and tune codes for better performance.

The compiler report in XML format can be viewed in a browser that supports XSLT. If you compile with the stylesheet suboption, for example, -qlistfmt=xml=all:stylesheet=xlstyle.xsl, the report contains a link to a stylesheet that renders the XML readable. By reading the report, you can detect opportunities to further optimize your code. You can also create tools to parse this information.

By default, the name of the report is a.xml for XML format, and a.html for HTML format. You can use the -qlistfmt=xml=filename or -qlistfmt=html=filename option to override the default name.

Inline reports

If you compile with -finline-functions and one of -qlistfmt=xml=inlines, -qlistfmt=html=inlines, -qlistfmt=xml, or -qlistfmt=html, the generated compiler report includes a list of inline attempts during compilation. The report also specifies the type of attempt and its outcome.

For each function that the compiler has attempted to inline, there is an indication of whether the inline was successful. The report might contain any number of reasons why a named function has not been successfully inlined. Some examples of these reasons are as follows:
  • FunctionTooBig - The function is too big to be inlined.
  • RecursiveCall - The function is not inlined because it is recursive.
  • ProhibitedByUser - Inlining was not performed because of a user-specified pragma or directive.
  • CallerIsNoopt - No inlining was performed because the caller was compiled without optimization.
  • WeakAndNotExplicitlyInline - The calling function is weak and not marked as inline.

For a complete list of the possible reasons, see the Inline optimization types section of the XML schema help file named XMLContent.html in the /opt/ibm/xlC/13.1.6/listings/ directory. The Japanese and Chinese versions of the help file, XMLContent-Japanese.utf8.html and XMLContent-Chinese.utf8.html, are included in this directory as well.

Loop transformations

If you compile with -qhot and one of -qlistfmt=xml=transforms, -qlistfmt=html=transforms, -qlistfmt=xml or -qlistfmt=html, the generated compiler report includes a list of the transformations performed on all loops in the file during compilation. The report also lists the reasons why transformations were not performed in some cases:
  • Reasons why a loop cannot be automatically parallelized
  • Reasons why a loop cannot be unrolled
  • Reasons why SIMD vectorization failed

For a complete list of the possible transformation problems, see the Loop transformation types section of the XML schema help file named XMLContent.html in the /opt/ibm/xlC/13.1.6/listings/ directory.

Data reorganizations

If you compile with -qhot and one of -qlistfmt=xml=data, -qlistfmt=html=data, -qlistfmt=xml, or -qlistfmt=html, the generated compiler report includes a list of data reorganizations performed on the program during compilation. Here are some examples of data reorganizations:
  • Array splitting
  • Array coalescing
  • Array interleaving
  • Array transposition
  • Memory merge

For each of these reorganizations, the report contains details about the name of the data, file names, line numbers, and the region names.

Profile-directed feedback reports

If you compile with -qpdf2 and one of -qlistfmt=xml=pdf, -qlistfmt=html=pdf, -qlistfmt=xml, or -qlistfmt=html, the generated compiler report includes the following information:
  • Loop iteration counts
  • Block and call counts
  • Cache misses (if compiled with -qpdf1=level=2)


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us