Chapter 1. Alphabetical Listing of Directives

#pragma directives are used within the source program to request certain kinds of special processing. #pragma directives are part of the C and C++ languages, but the meaning of any #pragma directive is defined by the implementation.

#pragma directives are expressed in the following form:

#pragma identifier [arguments]

Compiler directives can also be specified in the following form, which has the advantage in that it can appear inside macro definitions:

_Pragma("identifier");

This form has the same effect as using the #pragma form, except that everything that appeared on the line following the #pragma must now appear inside the double quotation marks and parentheses. The expression inside the parentheses must be a single string literal, but it cannot be a macro that expands into a string literal. _Pragma is a SGI extension to the C and C++ standards.

Example 1-1. #pragma form

The following is an example using the #pragma form:

#pragma ivdep
#pragma parallel local(i, j, k) \
                 shared(a, b, c)


Example 1-2. _Pragma form

The following is the same example using the alternative form:

_Pragma("ivdep")
_Pragma("parallel local(i, j, k) \
                  shared(a, b, c)")

Macro expansion occurs on the directive line after the directive name. (That is, macro expansion is applied only to arguments.) For example, if NUM_CHUNKS is a macro defined as the value 8, the original code is as follows:

#define NUM_CHUNKS 8
_Pragma("parallel numchunks(NUM_CHUNKS)")

Table 1-1, is an alphabetical list of SGI supported #pragma directives, with a short description of each and a link to the chapter where the directive is discussed.

Table 1-1. SGI #pragma Directives

#pragma

Short Description

Functional Group

aggressive inner loop fission

Fission inner loops into as many loops as possible.

Chapter 8, “Loop Nest Optimization #pragma Directives”

align_symbol

Specifies alignment of user variables, typically at cache-line or page boundaries.

Chapter 4, “Data Layout #pragma Directives”

blocking size

Sets the blocksize of the specified loop that is involved in a blocking for the primary (secondary) cache.

Chapter 8, “Loop Nest Optimization #pragma Directives”

can_instantiate

Indicates that the specified declaration can be instantiated in the current compilation, but need not be.

Chapter 3, “C++ Instantiation #pragma Directives”

concurrent

Tells the compiler to ignore assumed dependences in the following loop.

Chapter 2, “Automatic Parallelization #pragma Directives”

concurrent call

Tells the compiler that the function calls in the following loop are safe to execute in parallel.

Chapter 2, “Automatic Parallelization #pragma Directives”

concurrentize

Tells the compiler to parallelize the next loop, overriding any #pragma no concurrentize directive that may apply to that loop.

Chapter 2, “Automatic Parallelization #pragma Directives”

copyin

Copies the value from the master thread's version of an -Xlocal-linked global variable into the slave thread's version.

Chapter 9, “Multiprocessing #pragma Directives”

critical

Protects access to critical statements.

Chapter 9, “Multiprocessing #pragma Directives”

distribute

Specifies data distribution.

Chapter 5, “DSM Optimization #pragma Directives”

distribute_reshape

Specifies data distribution with reshaping.

Chapter 5, “DSM Optimization #pragma Directives”

do_not_instantiate

Prevents instantiation of the specific declaration in this compilation unit, even if that instance is used in the code.

Chapter 3, “C++ Instantiation #pragma Directives”

dynamic

Tells the compiler that the specified array may be redistributed in the program.

Chapter 5, “DSM Optimization #pragma Directives”

enter gate

Indicates the point that all threads must clear before any threads are allowed to pass the corresponding #pragma exit gate.

Chapter 9, “Multiprocessing #pragma Directives”

exit gate

Stops threads from passing this point until all threads have cleared the corresponding #pragma enter gate .

Chapter 9, “Multiprocessing #pragma Directives”

fill_symbol

Tells the compiler to insert any necessary padding to ensure that the user variable does not share a cache-line with any other symbol.

Chapter 4, “Data Layout #pragma Directives”

fission

Fission the enclosing specified levels of loops after this directive.

Chapter 8, “Loop Nest Optimization #pragma Directives”

fissionable

Disables validity testing.

Chapter 8, “Loop Nest Optimization #pragma Directives”

fusable

Disables validity testing.

Chapter 8, “Loop Nest Optimization #pragma Directives”

fuse

Fuse the following specified number of loops, which must be immediately adjacent.

Chapter 8, “Loop Nest Optimization #pragma Directives”

hdrstop

Indicates the point at which the precompiled header mechanism snapshots the headers. If -pch is off, #pragma hdrstop is ignored.

Chapter 11, “Precompiled Header #pragma Directives”

hidden

Tells the compiler that the specified symbols are invisible to all executables or DSOs except the current one.

Chapter 7, “Loader Information #pragma Directives”

ident

Adds a .comment section in the object file and puts the revision string inside the .comment section.

Chapter 14, “Miscellaneous #pragma Directives”

independent

Tells the compiler to run an independent code section in parallel with the rest of the code in the parallel region.

Chapter 9, “Multiprocessing #pragma Directives”

inline {here|routine|global}]

Tells the compiler to inline the named functions. Keywords: here (next statement only), routine (rest of routine or until corresponding noinline is found), and global (entire file, or until corresponding noinline is found).

Chapter 6, “Inlining #pragma Directives”

instantiate

Causes a specified instance of a template declaration to be immediately instantiated at that spot.

Chapter 3, “C++ Instantiation #pragma Directives”

int_to_unsigned

Identifies the specified function name as a function whose type was int in a previous release of the compilation system, but whose type is unsigned int in the MIPSpro compiler release.

Chapter 14, “Miscellaneous #pragma Directives”

internal

Tells the compiler that the specified symbols are not referenced outside the current executable or DSO.

Chapter 7, “Loader Information #pragma Directives”

intrinsic

Allows certain preselected functions from math.h, stdio.h, and string.h to be inlined at a callsite for execution efficiency.

Chapter 14, “Miscellaneous #pragma Directives”

ivdep

Liberalizes dependence analysis. This applies only to inner loops. Given two memory references, where at least one is loop variant, ignore any loop-carried dependences between the two references.

Chapter 8, “Loop Nest Optimization #pragma Directives”

local

Tells the compiler the names of all the variables that must be local to each thread.

Chapter 9, “Multiprocessing #pragma Directives”

mips_frequency_hint {NEVER|INIT}

Specifies the expected frequency of execution so the compiler can move exception code and initialization code into separate pages to minimize working set size.

Chapter 12, “Scalar Optimization #pragma Directives”

no blocking

Prevents the compiler from involving this loop in cache blocking.

Chapter 8, “Loop Nest Optimization #pragma Directives”

no concurrentize

Varies with placement. Tells the compiler to not parallelize any loops in a subroutine or file.

Chapter 2, “Automatic Parallelization #pragma Directives”

no_delete

Inhibits deletion of functions that are never referenced.

Chapter 8, “Loop Nest Optimization #pragma Directives”

no fission

Keeps the following loop from being fissioned. Its innermost loops, however, are allowed to be fissioned.

Chapter 8, “Loop Nest Optimization #pragma Directives”

no fusion

Keeps the following loop from being fused with other loops.

Chapter 8, “Loop Nest Optimization #pragma Directives”

no interchange

Prevents the compiler from involving the loop directly following this directive (or any loop nested within this loop) in an interchange.

Chapter 8, “Loop Nest Optimization #pragma Directives”

no side effects

Tells the compiler to assume that all of the named functions are safe to execute concurrently.

Chapter 9, “Multiprocessing #pragma Directives”

no_pch

Disables the precompiled header mechanism.

Chapter 11, “Precompiled Header #pragma Directives”

noinline {here|routine|global}

Tells the compiler not to inline the named functions. Keywords: here (next statement only), routine (rest of routine or until corresponding inline is found), and global (entire file, or until corresponding inline is found).

Chapter 6, “Inlining #pragma Directives”

once

Ensures (in -n32 and -64 mode) that each include file is included at most one time in each compilation unit.

Chapter 11, “Precompiled Header #pragma Directives”

one processor

Causes next statement to be executed on only one processor.

Chapter 9, “Multiprocessing #pragma Directives”

optional

Tells the linker that the specified symbols are optional. This is the basic mechanism used for adding extensions to a library that can then be queried.

Chapter 7, “Loader Information #pragma Directives”

pack

Controls the layout of structure offsets, such that the strictest alignment for any structure member will be n bytes, where n is 0, 1, 2, 4, 8, or 16. When n is 0, the compiler returns to default alignment for any subsequent struct definitions.

Chapter 4, “Data Layout #pragma Directives”

page_place

Controls the placement of data on a DSM (distributed shared memory) machine.

Chapter 5, “DSM Optimization #pragma Directives”

permutation

The specified array is a permutation array.

Chapter 2, “Automatic Parallelization #pragma Directives”

parallel

Starts a parallel region.

Chapter 9, “Multiprocessing #pragma Directives”

pfor

Marks a for loop to run in parallel.

Chapter 9, “Multiprocessing #pragma Directives”

prefer concurrent

Tells the compiler to parallelize the following loop if it is safe.

Chapter 2, “Automatic Parallelization #pragma Directives”

prefer serial

Tells the compiler not to parallelize the following loop.

Chapter 2, “Automatic Parallelization #pragma Directives”

prefetch

Controls prefetching for each level of the cache.

Chapter 8, “Loop Nest Optimization #pragma Directives”

prefetch_manual

Specifies whether manual prefetches (through #pragma directives) should be respected or ignored.

Chapter 8, “Loop Nest Optimization #pragma Directives”

prefetch_ref

Generates a prefetch and connects it to the specified reference (if possible).

Chapter 8, “Loop Nest Optimization #pragma Directives”

prefetch_ref_disable

Explicitly disables prefetching for the specified reference.

Chapter 8, “Loop Nest Optimization #pragma Directives”

protected

Tells the compiler that the specified symbols are not preemptible.

Chapter 7, “Loader Information #pragma Directives”

pure

Tells the compiler that a call to named functions has no side effects and its return value depends on the values of its arguments.

Chapter 9, “Multiprocessing #pragma Directives”

redistribute

Specifies dynamic data redistribution.

Chapter 5, “DSM Optimization #pragma Directives”

reset woff

Resets listed warnings to the state specified in the command line.

Chapter 13, “Warning Suppression Control #pragma Directives”

section_gp

Causes an object to be placed in a gp_relative section.

Chapter 7, “Loader Information #pragma Directives”

section_non_gp

Keeps an object from being placed in a gp_relative section.

Chapter 7, “Loader Information #pragma Directives”

serial

Forces the loop immediately following it to be serial, and restricts optimization by forcing all enclosing loops to be serial also.

Chapter 2, “Automatic Parallelization #pragma Directives”

set chunksize

Tells the compiler which values to use for chunksize.

Chapter 9, “Multiprocessing #pragma Directives”

set numthreads

Tells the compiler which values to use for numthreads.

Chapter 9, “Multiprocessing #pragma Directives”

set schedtype

Tells the compiler which values to use for schedtype.

Chapter 9, “Multiprocessing #pragma Directives”

set woff

Suppresses listed compiler warnings.

Chapter 13, “Warning Suppression Control #pragma Directives”

shared

Tells the compiler the names of all the variables that the threads must share.

Chapter 9, “Multiprocessing #pragma Directives”

synchronize

Stops threads until all threads reach this point. This directive is a classic barrier construct.

Chapter 9, “Multiprocessing #pragma Directives”

unknown_control_flow

Indicates which procedures have a nonstandard control flow behavior.

Chapter 14, “Miscellaneous #pragma Directives”

unroll

Suggests to the compiler that n-1 copies of the loop body be added to the inner loop. If the loop following this directive is an inner loop, then it indicates standard unrolling (version 7.2 and later). If the loop following this directive is not innermost, then outer loop unrolling (unroll and jam) is performed (version 7.0 and later).

Chapter 8, “Loop Nest Optimization #pragma Directives”

weak weak_symbol = strong_symbol

Sets weak_symbol to be an alias for the function or data object denoted by strong_symbol , unless a defining declaration for weak_symbol is encountered at static link time. If encountered, the defining declaration preempts the weak denotation.

Chapter 7, “Loader Information #pragma Directives”

weak weak_symbol

Tells the link editor not to issue a warning if it does not find a defining declaration of weak_symbol . Also allows the overriding of a current definition by a non-weak definition.

Chapter 7, “Loader Information #pragma Directives”