cache

Option Type Default Value #pragma options C C++
-qoption     x x

Syntax

-qcache=
{
        assoc=number |
        auto |
        cost=cycles | 
        level=level | 
        line=bytes | 
        size=Kbytes | 
        type=cache_type 
}[: ...| 

Purpose
The -qcache option specifies the cache configuration for a specific execution machine. If you know the type of execution system for a program, and that system has its instruction or data cache configured differently from the default case, use this option to specify the exact cache characteristics.  The compiler uses this information to calculate the benefits of cache-related optimizations.

Notes
Allowable values for suboption are:

assoc=number Specifies the set associativity of the cache.
0
Direct-mapped cache
1
Fully associate cache
N>1
n-way set associative cache
auto Automatically detects the specific cache configuration of the compiling machine. This assumes that the execution environment will be the same as the compilation environment.
cost=cycles Specifies the performance penalty resulting from a cache miss.
level=level Specifies the level of cache affected.
1
Basic cache
2
Level-2 cache or, if there is no level-2 cache, the table lookaside buffer (TLB)
3
TLB

If a machine has more than one level of cache, use a separate -qcache option.

line=bytes Specifies the line size of the cache.
size=Kbytes Specifies the total size of the cache.
type=C|c|D|d|I|i The settings apply to the specified type of cache.
C or c
Combined data and instruction cache
D or d
Data cache
I or i
Instruction cache

If you specify the wrong values for the cache configuration or run the program on a machine with a different configuration, the program will work correctly but may be slightly slower.

You must specify -O4 or -qipa with the -qcache option.

Use the following guidelines when specifying -qcache suboptions:

Example
To tune performance for a system with a combined instruction and data level-1 cache, where cache is 2-way associative, 8 KB in size and has  64-byte cache lines, enter:

xlC -O4 -qcache=type=c:level=1:size=8;line=64;assoc=2 file.C


List of Batch Compiler Options and Their Defaults
Options that Specify Compiler Output
Equivalent Batch Compile-Link and Incremental Build Options