Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

3.4 Options Reference

-!$PRAGMA

SUN_PREFETCH_READ_MANY (name)

-!$PRAGMA

SUN_PREFETCH_WRITE_ONCE (name)

-!$PRAGMA

SUN_PREFETCH_WRITE_MANY (name)

The -xchip setting effects the determination of the assumed latencies and therefore the result of a latx:factor setting.

The latx:factor sub-option is valid only when automatic prefetching (auto) is enabled on SPARC processors.

3.4.168.3 Warnings:

Explicit prefetching should only be used under special circumstances that are supported by measurements.

Because the compiler tunes the prefetch mechanism for optimal performance across a wide range of machines and applications, you should only use -xprefetch=latx:factor when the performance tests indicate there is a clear benefit. The assumed prefetch latencies may change from release to release. Therefore, retesting the effect of the latency factor on performance whenever switching to a different release is highly recommended.

3.4.169 –xprefetch_auto_type=indirect_array_access

Generate indirect prefetches for a data arrays accessed indirectly.

Generates indirect prefetches for the loops indicated by the option -xprefetch_level={1|2|3} in the same fashion the prefetches for direct memory accesses are generated. The prefix no% can be added to negate the declaration.

The default is -xprefetch_auto_type=no%indirect_array_access.

Requires -xprefetch=auto and an optimization level -xO3 or higher.

Options such as -xdepend can affect the aggressiveness of computing the indirect prefetch candidates and therefore the aggressiveness of the automatic indirect prefetch insertion due to better memory alias disambiguation information.

150 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

3.4.170 –xprefetch_level={1|2|3}

Control the automatic generation of prefetch instructions.

This option is only effective when compiling with:

-xprefetch=auto,

with optimization level 3 or greater,

on a platform that supports prefetch.

The default for -xprefetch=auto without specifying -xprefetch_level is level 2.

Prefetch level 2 generates additional opportunities for prefetch instructions than level 1. Prefetch level 3 generates additional prefetch instructions than level 2.

Prefetch levels 2 and 3 may note be effective on older SPARC or x86 platforms.

3.4.171 –xprofile=p

Collects data for a profile or uses a profile to optimize.

p must be collect[:profdir], use[:profdir], or tcov[:profdir].

This option causes execution frequency data to be collected and saved during execution, then the data can be used in subsequent runs to improve performance. Profile collection is safe for multithreaded applications. That is, profiling a program that does its own multitasking ( -mt ) produces accurate results. This option is only valid when you specify -xO2 or greater level of optimization. If compilation and linking are performed in separate steps, the same -xprofile option must appear on the link step as well as the compile step.

collect[:profdir] Collects and saves execution frequency for later use by the optimizer with -xprofile=use. The compiler generates code to measure statement execution-frequency.

-xMerge, -ztext, and -xprofile=collect should not be used together. While -xMerge forces statically initialized data into read-only storage, -ztext prohibits position-dependent symbol relocations in read-only storage, and -xprofile=collect generates statically initialized, positiondependent symbol relocations in writable storage.

Chapter 3 • Fortran Compiler Options

151

3.4 Options Reference

 

The profile directory name profdir, if specified, is the pathname of

 

the directory where profile data are to be stored when a program or

 

shared library containing the profiled object code is executed. If the

 

profdir pathname is not absolute, it is interpreted relative to the current

 

working directory when the program is compiled with the option

 

-xprofile=use:profdir.

 

If no profile directory name is specified with —

 

xprofile=collect:prof_dir or —xprofile=tcov:prof_dir, profile

 

data are stored at run time in a directory named program.profile

 

where program is the basename of the profiled process's main

 

program. In this case, the environment variables SUN_PROFDATA and

 

SUN_PROFDATA_DIR can be used to control where the profile data are

 

stored at run time. If set, the profile data are written to the directory given

 

by $SUN_PROFDATA_DIR/$SUN_PROFDATA. If a profile directory name is

 

specified at compilation time, SUN_PROFDATA_DIR and SUN_PROFDATA

 

have no effect at run time. These environment variables similarly control

 

the path and names of the profile data files written by tcov, as described

 

in the tcov(1) man page.

 

If these environment variables are not set, the profile data is written

 

to the directory profdir.profile in the current directory, where

 

profdir is the name of the executable or the name specified in the

 

-xprofile=collect:profdir flag. -xprofile does not append.

 

profile to profdir if profdir already ends in .profile. If you run the

 

program several times, the execution frequency data accumulates in the

 

profdir.profile directory; that is output from prior executions is not

 

lost.

 

If you are compiling and linking in separate steps, make sure that any

 

object files compiled with -xprofile=collect are also linked with -

 

xprofile=collect.

use[:profdir]

Uses execution frequency data collected from code compiled with —

 

xprofile=collect[:profdir] or —xprofile=tcov[:profdir] to optimize

 

for the work performed when the profiled code was executed. profdir is

 

the pathname of a directory containing profile data collected by running

 

a program that was compiled with —xprofile=collect[:profdir] or —

 

xprofile=tcov[:profdir].

 

To generate data that can be used by both tcov and —

 

xprofile=use[:profdir], a profile directory must be specified at

 

compilation time, using the option —xprofile=tcov[:profdir]. The same

 

profile directory must be specified in both —xprofile=tcov:profdir and

152 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

 

—xprofile=use:profdir. To minimize confusion, specify profdir as an

 

absolute pathname.

 

The profdir pathname is optional. If profdir is not specified, the name

 

of the executable binary is used. a.out is used if -o is not specified.

 

The compiler looks for profdir.profile/feedback, or a.out.profile/

 

feedback when profdir is not specified. For example:

 

demo% f95 -xprofile=collect -o myexe prog.f95

 

demo% f95 -xprofile=use:myexe -xO5 -o myexe prog.f95

 

The program is optimized by using the execution frequency data

 

previously generated and saved in the feedback files written by a

 

previous execution of the program compiled with -xprofile=collect.

 

Except for the -xprofile option, the source files and other compiler

 

options must be exactly the same as those used for the compilation that

 

created the compiled program that generated the feedback file. The same

 

version of the compiler must be used for both the collect build and the

 

use build as well.

 

If compiled with -xprofile=collect:profdir, the same profile

 

directory name profdir must be used in the optimizing compilation: -

 

xprofile=use:profdir.

 

See also -xprofile_ircache for speeding up compilation between

 

collect and use phases.

tcov[:profdir]

Instrument object files for basic block coverage analysis using tcov(1).

 

If the optional profdir argument is specified, the compiler will create a

 

profile directory at the specified location The data stored in the profile

 

directory can be used either by tcov(1) or by the compiler with -

 

xprofile=use:profdir. If the optional profdir pathname is omitted, a

 

profile directory will be created when the profiled program is executed.

 

The data stored in the profile directory can only be used by tcov(1). The

 

location of the profile directory can be controlled using environment

 

variables SUN_PROFDATA and SUN_PROFDATA_DIR.

 

If the location specified by profdir is not an absolute pathname, it is

 

interpreted at compilation time relative to the current working directory

 

at the time of compilation. If profdir is specified for any object file, the

 

same location must be specified for all object files in the same program.

 

The directory whose location is specified by profdir must be accessible

 

from all machines where the profiled program is to be executed. The

 

profile directory should not be deleted until its contents are no longer

Chapter 3 • Fortran Compiler Options

153

Соседние файлы в предмете Информационные и сетевые технологии