This chapter describes KAP for C command switches that allow you to alter KAP defaults.
You will frequently be satisfied with the default switch settings of KAP for C. However, you can alter default settings to customize optimizations for a given application program and machine. These include limiting the search space for loop optimization, adjusting the parameters that describe cache memory, and enabling or disabling classes of transformations.
Command switches are switches requested on the command line when submitting a KAP job, rather than in the source file.
To specify a command switch, you can use the long name or short name. If a command switch appears more than once on the command line, the last value given is used. Multiple occurrences of an input /output file selection switch are not allowed.
Table 4-1 lists the command switches. The first column lists the long name of each switch. This column also lists the functional categories of switches: general optimization, parallel processing, inlining and Interprocedural Analysis, advanced optimization control, input/output files, and listing. The next two columns list the short name and default value of each switch. Switches that have different argument syntax in their regular and negative (no) forms are shown on two lines.
| Long Name | Related Switch | Short Name | Default Value |
|---|---|---|---|
| General Optimization | |||
| [no]interchange | interchange | ||
| namepartitioning= <integer>,<integer> | so | namepart= <integer>,<integer> | nonamepartitioning |
| optimize=<integer> | o=<integer> | optimize=5 | |
| recursion | rc | nrc | |
| roundoff=<integer> | o, so | r=<integer> | roundoff=3 |
| routine= <routine_name>/<limited switches> | See text | rt=<routine_name>/<limited switches> | noroutine |
| scalaropt=<integer> | r | so=<integer> | scalaropt=3 |
| skip | sk | nosk | |
| tune=<architecture> | tune<architecture> | tune=host | |
| Parallel Processing Switches | |||
| [no]concurrentize | [n]conc | noconcurrentize | |
| minconcurrent=<integer> | mc | minconcurrent=1000 | |
| Inlining and IPA | |||
| inline[=<names>] | inl[=<names>] | off | |
| noinline[=<names>] | ninl[=<names>] | ||
| ipa[=<names>] | ipa[=<names>] | off | |
| noipa[=<names>] | nipa[=<names>] | ||
| inline_and_copy=<names> | inlc=<names> | off | |
| inline_create=<file> | incr=<file> | off | |
| ipa_create=<file> | ipacr=<file> | off | |
| inline_depth=<integer> | ind=<integer> | ind=2 | |
| ipa_depth=<integer> | ipad=<integer> | ipad=2 | |
| inline_ from_files=<file>,<file> | inl | inff=<file>,<file> | current source file |
| ipa_ from_files=<file>,<file> | ipa | ipaff=<file>,<file> | current source file |
| inline_from_ libraries=<library>, <library> | inl | infl=<library>, <library> | off |
| ipa_from_ libraries=<library>,<library> | ipa | ipafl=<library>, <library> | off |
| inline_looplevel=<integer> | inll=<integer> | inll=2 | |
| ipa_ looplevel=<integer> | ipall=<integer> | ipall=2 | |
| inline_manual | inm | off | |
| ipa_manual | ipam | off | |
| inline_optimize=<integer> | inline_ optimize=0 | ||
| ipa_ optimize=<integer> | ipa_optimize=0 | ||
| Input- Output | |||
| cmp[=<file>] | cmp[=<file>] | See Section 4.6.1 | |
| nocmp | ncmp | ||
| list[=<file>] | l[=<file>] | nl | |
| nolist | nl | ||
| Listing | |||
| cmpoptions[=<list>] | cp[=<list>] | ncp | |
| nocmpoptions | ncp | ||
| lines=<integer> | ln=<integer> | ln=55 | |
| listingwidth=<integer> | lw=<integer> | lw=132 | |
| listoptions=<list> | lo=<list> | See Section 4.7.4 | |
| Language Switches | |||
| [no]natural | [n]nat | nat | |
| signed | signed | See Section 4.4.2 | |
| Advanced Optimization | |||
| addressresolution=<integer> | so, r | arl=<integer> | arl=1 |
| [no]arclimit=<integer> | so, r | arclm=<integer> | arclm=5000 |
| cacheline=<integer>[,<integer>] | chl=<integer> [,<integer>] | chl=32,32 | |
| cache_prefetch_line_count= <integer> | cplc=<integer> | cplc=0 | |
| cachesize=<integer>[,<integer>] | chs=<integer> [,<integer>] | chs=8,0 | |
| dpregisters=<integer> | dpr=<integer> | dpr=32 | |
| each_invariant_if_ growth=<integer> | so, r, miifg | eiifg=<integer> | eiifg=20 |
| fpregisters=<integer> | fpr=<integer> | fpr=32 | |
| [no]fuse | so,o | fuse | nofuse |
| fuselevel=<integer> | fuse | =<integer> | fuselevel=0 |
| heaplimit=<integer> | heap=<integer> | heaplimit=100 | |
| limit=<integer> | lm=<integer> | lm=50 | |
| machine=<list> | so, r | ma=<list> | ma=s |
| max_invariant_if_ growth=<integer> | so, r, eiifg | miifg=<integer> | miifg=500 |
| setassociativity=<integer> | so, r | sasc=<integer> | sasc=1 |
| stdio | so, r | stdio | off |
| syntax=<list> | sy=<list> | sy=d | |
| unroll=<integer> | so, r | ur=<integer> | ur=4 |
| unroll2=<integer> | so, r | ur2=<integer> | ur2=160 |
| unroll3=<integer> | so, r | ur3=<integer> | ur3=1 |
KAP is run after the standard C preprocessor. The code examples in this chapter show the original code before the preprocessor and the KAP transformed code with some of the C preprocessor additions stripped off for Digital UNIX clarity.