gcdm Decision Maker Option


The gcdm option invokes the gcdm960 global optimization decision maker during the link process. The decision maker then invokes the compiler and linker as necessary to perform program-wide optimizations.

The gcdm option has the following syntax:

{ - | / } gcdm,argument[,argument]...

As with other options, you can use the / delimiter only on DOS. The gcdm option arguments and the sections that describe them are described below. There are several classes of gcdm option arguments, called controls in this hypertext.

Substitution Controls (subst,arg[,arg]... and nosubst,module-set)

where arg is {module-set}{option-list}

module-set is
[ archive ] : module
option-list is
{+O5} | {+fprof | +O0 | +O1 | +O2 | +O3 | +O4} [+g | +asm_pp+prog | +clist+arg | +fstring]
+O5
specifies program-wide optimization.
+fprof
identifies a profile.
+O0 | +O1 | +O2 | +O3 | +O4
specify module-local optimization.
+g
specifies debug information.
+asm_pp+prog
identifies a program.
+clist+arg
specifies a listing.
+fstring
specifies an optimization.

External Reference Controls ([no]ref=module-set)

Inlining Control (inline=n)

Profile Control (iprof=file)

Memory Controls (sram=start,end[,start,end]... and m=start,len[,start,len]...)

Dryrun Control (dryrun)

Report Controls (dec=file, rdecisions, rcall-graph, rprofile, rreverse, rsummary, rvariables)


As shown above, gcdm option arguments are a mixture of keywords and user-supplied identifiers. In this hypertext node, gcdm option arguments are called controls unless this causes ambiguity.

Substitution Controls

The substitution controls allow you to substitute optimized modules in your application (subst), and to suppress unintended substitutions (nosubst). The complete substitution specification and substitution suppression syntax is:

subst,arg[,arg]... and nosubst,module-set

where arg is {module-set}{option-list}

module-set is
[ archive ] : module
option-list is
{+O5} | {+fprof | +O0 | +O1 | +O2 | +O3 | +O4} [+g | +asm_pp+prog | +clist+arg | +fstring]
+O5
specifies program-level optimization.
+fprof
identifies a profile.
+O0 | +O1 | +O2 | +O3 | +O4
specify module-local optimization.
+g
specifies debug information.
+asm_pp+prog
identifies a program.
+clist+arg
specifies a listing.
+fstring
specifies an optimization.

This syntax is discussed in the following paragraphs.

If a given object module is named in multiple subst or nosubst options, the last subst or nosubst which names that module applies. In addition to providing for control over which modules are affected, the substitution controls allow fine control of how affected modules are optimized. The following subsections describe substitution and substitution suppression. Detailed information on controlling optimizations is presented in the discussion of option-list in the immediately following subsection.

Substitution Specifications

subst={module-set}{option-list}

In the linked program, gcdm,subst={module-set}{option-list} causes substitution of modules optimized according to the option-list for all of the modules in module-set.

Note that no space is allowed between module-set and option-list.

A module-set specification is a string supplied by the user that names the modules to be operated on by the gcdm option. For a description of how to specify a module-set, see the Module-Set Specification section.

An option-list consists of a single +, meaning to perform no substitution, or it consists of one or more of the substitution options discussed in three categories:

  1. Whole-program optimization option
  2. Module-local optimization options
  3. Miscellaneous optimization options

Note that the first two categories are mutually exclusive; but you can use substitution options from the third category with those from either of the first two categories.

Whole-program optimization option (Category 1)

+O5

This whole-program optimization substitution option selects program-wide optimizations, including global function inlining, superblock formation, and global alias analysis. The whole-program optimization option is not allowed in an option-list with module-local (Category 2) options.

Module-local optimization options (Category 2)

+fprof | +O0 | +O1 | +O2 | +O3 | +O4

These module-local substitution options correspond to the gcc960 and ic960 drivers' -fprof (Instrument) and -On (Optimize) options. The module-local substitution options are not allowed in an option-list with the whole-program optimization (Category 1) option.

+fprof
causes generation of profile counting code, as described for the -fprof compiler option. When the +fprof substitution option is used (instead of the -fprof compiler driver option), only the substitution modules in the PDB contain the actual extra counting code. This is useful in some cases. For example, a library compiled with -fdb but without -fprof is suitable both for users who do not want to use program-wide optimizations, and for those who do, as follows:
All program database information required to support program-wide optimizations is present in the library, since it is compiled with -fdb.
To collect a full program profile (including the library) for use with program-wide optimizations, a substitution such as -gcdm,subst=*:*+fprof will generate a program which is appropriately instrumented.
If you do not use program-wide optimizations (that is, you do not use gcdm,subst options), there is no extra runtime overhead, and the program can be optimized to any module-local optimization level higher than -O0.
+O0 +O1 +O2 +O3 +O4
allow substitutions of modules with various levels of module-local optimization. These are typically used for the following purposes:
Miscellaneous substitution options (Category 3)

+g | +asm_pp+prog | +clist+arg | +fstring

These can be used with either the whole-program or module-local substitution options in Categories 2 and 3, above.

+g
enables debug information generation for substitution modules.
+asm_pp+prog
causes prog to be invoked after the assembly code for a substitution module is generated, with the name of the file containing the substitution assembly code as its argument. This allows the post-processing of substitution assembly code by user-supplied tools.
+clist+arg
generates an assembly code listing of each module selected by the substitution into a file named name.L in the current working directory, where name is the base file name of the object module being substituted for. arg is a string consisting of one of more of the following characters: s, i, o, m, c. These characters control the content and format of the listing, as described for gcc960's clist (Listing) option and ic960's z (Listing) options in Chapters 2 and 3 of your compiler manual.
+fstring
The +fstring substitution options listed below apply the corresponding individual -fstring optimizations. The no form of these options (e.g., +fno-unroll-loops) is also accepted.
+fbbr, +fcoalesce, +fcondfrm, +fconstprop, +fcopyprop, +fcse-follow-jumps, +fcse-skip-blocks, +fdead-elim, +fexpensive-optimizations, +ffunction-cse, +fmarry_mem, +fpeephole, +frerun-cse-after-loop, +fsblock, +fsched-sblock, +fschedule-insns, +fschedule-insns2, +fshadow-globals, +fshadow-mem, +fspace-opt, +fsplit_mem, +fstrength-reduce, +fthread-jumps, +funroll-all-loops, +funroll-loops.
These options automatically default appropriately based on the selected optimization level.

Substitution Suppression

nosubst=module-set

The nosubst=module-set argument suppresses substitution for the named modules. This is equivalent to subst=module-set+ (the option-list consists of only a + character). nosubst is typically used to exclude a subset of modules from a previous subst.


External Reference Controls

ref=module-set

noref=module-set

These reference controls cause gcdm960 to assume/not assume that functions or data defined in the objects named by module-set are referenced outside the set of object files presented to the linker.

ref would normally be used to keep the global decision making and optimization step from discarding modules that appear to be unused.

noref is typically used to exclude a subset of modules from a previous ref.

The last ref or noref to name a given module applies.


Inlining Control

inline=n

This gcdm option argument controls how aggressively global inlining decisions are made.

n defaults to 3, and n must be >= 0 and less than 5.


Profile Control

iprof=file

This control causes the profile information in file to be incorporated into program-wide optimization decisions.

file is a raw profile or a self-contained profile.


Memory Controls

sram=hexstart,hexend[,hexstart,hexend]...

m=hexstart,hexlen[,hexstart,hexlen]...

These gcdm option arguments cause global variables to be automatically allocated to the indicated SRAM area available in some 80960 processor models, but could be any fast memory region reserved for this purpose.


Dryrun Control

dryrun

The dryrun argument echoes the commands which would be executed to implement all specified subst options into the report file, without actually doing the optimization work.


Report Controls

The gcdm option arguments listed here allow for creation of various optimization reports and naming the report file.

dec=file

Causes the optimization decisions report file to be file, instead of stdout.

dryrun

Echoes the commands which would be executed to implement all specified subst options into the report file, without actually doing the optimization work.

rsummary

Prints a summary of program-wide optimization decisions to the report file.

rdecisions

Prints information about program-wide optimization decisions to the report file.

rcall-graph

Prints a call graph to the report file.

rreverse

Prints a reversed call graph to the report file.

rprofile

Prints the profile counts for the basic blocks which were hit to the report file.

rvariables

Lists the variables allocated to fast memory with -m or -sram to the report file.


Module-Set Specification

A module-set selects a subset of zero or more modules from the set consisting of all eligible modules in the program. A module-set specification has the format:

[ archive ] : module

The following rules govern module-set selection.

  1. The set of eligible modules are those linked into the program that were compiled with the -fdb compiler driver option.
  2. If either of the characters : or + appears twice in succession, that character is quoted and the meaning is a single : or + character.
  3. If a module-set contains an unquoted : character, it is interpreted as a pair of regular expression strings in the style of the UNIX Bourne shell, with the string to the left of the : matching object file archives and the string to the right of the : matching individual object files. For example:
    *:* matches all eligible modules
    :* matches only eligible modules not linked in from libraries
    a:b.o matches b.o from library a, provided the module is eligible.
  4. If a module-set contains no unquoted : characters, it is assumed to be the name of a function or variable in the program. In this case, the module-set refers to the object file that contains the definition of the variable or the body of the function, provided the module containing the variable definition or function body is eligible.
  5. If a module-set is empty (that is, no characters occur between the option and the = character) the module-set defaults to :*, which refers to all eligible modules in the program not linked in from libraries.

Return to the top of this page.

Go to the gcc960 compiler driver page.

Go to the ic960 compiler driver page.