AOCC Optimization Report (AOR) - AOCC Optimization Report (AOR) - 57222

AOCC User Guide

Document_ID
57222
Release_Date
2026-05-12
Revision
5.2 English

The AOR tool generates an optimization report for any C, C++, and Fortran application project compiled with AOCC. The optimization report can be investigated by the application developer for a list of optimizations performed/not performed on the compiled application with a hint of the course of action. Currently, AOR contains the report of messages related to loop-vectorize optimization pass information and can be generated with the following commands.

Table 1. Commands to Generate AOR
Command Description
-fgen-aor
To generate compile-time AOR (CFLAGS, CXXFLAGS, and FCFLAG).
-fgen-aor -flto -fuse-ld=lld
To generate link-time AOR (CFLAGS, CXXFLAGS, and FCFLAG).
-fgen-aor-screen-listing
To screen list compile and link-time AOR (CFLAGS, CXXFLAGS, and FCFLAG). It displays the AOR reports when used with the flag -fgen-aor.

Example

$ git clone https://github.com/UoB-HPC/TSVC_2
$ cd TSVC_2/src
$ clang -O3 -march=znver2 -fgen-aor -flto -fuse-ld=lld *.c -I. -o tsvc -lm

The above commands will generate a compile-time report optimization_report.aor and a link-time report optimization_ld_report.aor, respectively in the application project build directory.

The following commands will generate a compile-time report optimization_report.aor and a link-time report optimization_ld_report.aor, respectively in the application project build directory and display the AOR reports.

$ git clone https://github.com/UoB-HPC/TSVC_2
$ cd TSVC_2/src
$ clang -O3 -march=znver2 -fgen-aor -fgen-aor-screen-listing -flto -fuse-ld=lld *.c -I. -o tsvc -lm

Sample AOR Artifact Content

**************************************************************************************
**************************************************************************************
Source location : sv.c:470:5
Optimizer Passname : loop-vectorize
Function Name : Perl_reg_temp_copy
loop-vectorize Optimization Status : Failed
Reason for loop-vectorize Optimization Failure : the cost-model indicates that interleaving is
not beneficial
**************************************************************************************
**************************************************************************************
Source location : mg.c:396:2
Optimizer Passname : loop-vectorize
Function Name : Perl_regexec_flags
loop-vectorize Optimization Status : Failed
Reason for loop-vectorize Optimization Failure : value that could not be identified as
reduction is used outside the loop
**************************************************************************************
**************************************************************************************

Prerequisites

For more information on prerequisites, refer to AOR Prerequisites (Table 2).

AOCC compiler must be installed and environment variables set. For more information, refer to Installation.

Alternatively, you can also export the AOCC compiler and the AOR tool (opt-viewer.py) paths to ensure that the correct compiler and associated tool are used to generate the AOR artifact.