2.23. -r list_opt

The -r list_opt option generates a listing. The list_opt argument produces listings with commonly needed information.

If one or more input files are specified on the compiler command line, the listing is placed in file.lst .

If the -C option is specified with the -r list_opt option, the -C option is overridden and a warning message is generated. If both the -r list_opt option and the -Wr"lister_opt" options are specified, the listing options specified by all the -r list_opt options are placed on the ftnlx command line before those specified by the -Wr"lister_opt" option.

The arguments for list_opt are shown below.

Note: Options a, c, l, m, o, s, w, and x invoke the ftnlx command. Option g provides an assembly listing and is not CIF based. Option T retains the CIF.

list_opt 

Listing type

a 

Includes all reports in the listing (including source, cross references, lint, loopmarks, common block, and options used during compilation). For more information about loopmarks, refer to Optimizing Applications on the Cray X1 System.

b 

Adds page breaks and headers to the listing report.

c 

Listing includes a report of all COMMON blocks and all members of each common block. It also shows the program units that use the COMMON blocks.

d 

Decompiles (translates) the intermediate representation of the compiler into listings that resemble the format of the source code. This is performed twice, resulting in two output files, at different points during the optimization process. You can use these files to examine the restructuring and optimization changes made by the compiler, which can lead to insights about changes you can make to your Fortran source to improve its performance.

The compiler produces two decompilation listing files, with these extensions, per source file specified on the command line: .opt and .cg. The compiler generates the .opt file after applying most high level loop nest transformations to the code. The code structure of this listing most resembles your Fortran code and is readable by most users. In some cases, because of optimizations, the structure of the loops and conditionals will be significantly different than the structure in your source file.

The .cg file contains a much lower level of decompilation. It is still displayed in a Fortran-like format, but is quite close to what will be produced as assembly output. This version displays the intermediate text after all multistreaming translation, vector translation, and other optimizations have been performed. An intimate knowledge of the hardware architecture of the system is helpful to understanding this listing.

Note: The column of numbers in the left-hand side of the .opt and .cg files refer to the line number in the Fortran source file.

The .opt and .cg files are intended as a tool for performance analysis, and are not valid Fortran functions. The format and contents of the files can be expected to change from release to release.

The following examples show the listings generated when the -rd is applied to this example:

!Source code, in file example.f:

subroutine example( a, b, c )
   real a(64), b(64), c(64)
   do i = 1,64
      if ( a(i) > 0.0 ) then
         b(i) = c(i)
      endif
   enddo
end

This is the listing of the example.opt file after loop optimizations are performed:

1.       subroutine example( a, b, c )
3.       @Induc01_N0 = 0
3. !dir$ ivdep
3.       do
4.          if ( A(1 + @Induc01_N0) > 0.0 ) then
5.             B(1 + @Induc01_N0) = C(1 + @Induc01_N0)
5.          endif
7.          @Induc01_N0 = 1 + @Induc01_N0
6.          if ( @Induc01_N0 < 64 ) cycle
6.       enddo
8.       return
8.       end

This is the listing of the example.opt file after other optimizations are performed:

1.       subroutine example( a, b, c )
3.       vinfo( Begin_Short_Loop )
4.       $VMT_2 = _vm_gt( 0[loc( A ):64:1], 0.0 )
5.       0[loc( B ):64:1#$VMT_2] = 0[loc( C ):64:1#$VMT_2]
3.       vinfo( End_Short_Loop )
8.       return
8.       end

e 

Expands included files in the source listing.

This option is off by default.

l 

Lists source code and includes lint style checking. The listing includes the COMMON block report (see the -r c option for more information about the COMMON block report).

m 

Produces a source listing with loopmark information. To provide a more complete report, this option automatically enables the -O negmsg option to show why loops were not optimized. If you do not require this information, use the -O nonegmsg option on the same command line.

Loopmark information will not be displayed if the -d B option has been specified.

o 

Show in the list file all options used by the compiler at compile time.

s 

Lists source code and messages. Error and warning messages are interspersed with the source lines. Optimization messages appear after each program unit. Produces 80-column output by default.

T 

Retains file.T after processing rather than deleting it. This option may be specified in addition to any of the other options. For more information on file.T, see the -C option.

w 

Produces 132-column output, which, when specified in conjunction with -r s or -r x, overrides the 80-column output that those options produce by default.

You can specify -r w in conjunction with either the -r s option or the -r x option. Specifying -r w in conjunction with any other -r listing option generates a warning message.

x 

Generates a cross-reference listing. Produces 80-column output by default.