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.
.-:---------------------. V | >>- -q--cache--=----+-assoc--=--+-0---+-+-+-------------------->< | +-1---+ | | '-n>1-' | +-auto--------------+ +-cost--=--cycles---+ +-level--=--+-1-+---+ | +-2-+ | | '-3-' | +-line--=--bytes----+ +-size--=--Kbytes---+ '-type--=--+-C-+----' +-c-+ +-D-+ +-d-+ +-I-+ '-i-'
where available cache options are:
assoc=number | Specifies the set associativity of the cache, where number is one of:
|
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, where level is one of:
|
line=bytes | Specifies the line size of the cache. |
size=Kbytes | Specifies the total size of the cache. |
type=cache_type | The settings apply to the specified type of cache, where cache_type is one of:
|
The -qtune setting determines the optimal default -qcache settings for most typical compilations. You can use the -qcache to override these default settings. However, 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, -O5, or -qipa with the -qcache option.
Use the following guidelines when specifying -qcache suboptions:
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
Related information