Using compiler reports to diagnose optimization opportunities

You can use the -qlistfmt option to generate a compiler report in XML or HTML format that indicates some of the details of how your program was optimized. You can also use the genhtml tool to convert an existing XML report to HTML format. This information can be used to understand your application code and to tune your code 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, -qlistfmt=xml=all:stylesheet=xlstyle.xsl, the report contains a link to a stylesheet that renders the XML readable and provides you with opportunities to improve the optimization of your code. You can also create tools to parse this information.

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

Inline reports

If compiled with -qinline and one of -qlistfmt=xml=inlines, -qlistfmt=html=inlines, -qlistfmt=xml or -qlistfmt=html, the compiler report that is generated includes a list of inline attempts during the 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 explanations for a named function that has not been successfully inlined. Some examples of these explanations are:
  • 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 explanations, see the Inline optimization types section of the XML schema help file called XMLContent.html in the /opt/IBM/xlf/15.1.0/listings/ directory, which also includes its Japanese and Chinese version, XMLContent-Japanese.utf8.html and XMLContent-Chinese.utf8.html.

Loop transformations

If compiled with -qhot and one of -qlistfmt=xml=transforms, -qlistfmt=html=transforms, -qlistfmt=xml or -qlistfmt=html, the compiler report that is generated includes a list of the transformations performed on all loops in the file during the compilation. It also lists reasons why some transformations were not performed.
  • 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 called XMLContent.html in the /opt/IBM/xlf/15.1.0/listings/ directory, which also includes its Japanese and Chinese version, XMLContent-Japanese.utf8.html and XMLContent-Chinese.utf8.html.

Data reorganizations

If compiled with -qhot and one of -qlistfmt=xml=data, -qlistfmt=html=data, -qlistfmt=xml or -qlistfmt=html, the compiler report that is generated 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
  • Common block splitting
  • 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 compiled with -qpdf2 and one of -qlistfmt=xml=pdf, -qlistfmt=html=pdf, -qlistfmt=xml or -qlistfmt=html, the compiler report that is generated includes the following information:
  • Loop iteration counts
  • Block and call counts
  • Cache misses (if compiled with -qpdf1=level=2)