Next | Prev | Up | Top | Contents | Index

KAP's Optimization Flags (-o, -r, -so)

Kap accepts three important optimization flags, -o, -r, and -so. They are described in this section.


The -o Flag

-o=integer
Long name: -optimize=integer
The -optimize option sets the optimization level. Each optimization level is cumulative (that is, each level performs everything up to and including its level). The meaning of each of the different optimization levels is:

0

No optimization is done.

1

Only simple optimizations are done. Induction variable recognition is enabled.

2

Performs lifetime analysis to determine when last-value assignment of scalars is necessary.

3

Triangular loops are recognized and loop interchanging is attempted to improve memory referencing. Special case data dependence tests are used. Special index sets, called wraparound variables, are also recognized.

4

Two versions of a loop are generated, if necessary, to break a data dependence arc.

5

Array expansion and loop fusion are enabled.

The -r Flag

-r=integer
Long name: -roundoff=integer
The -roundoff option allows you to specify the tolerable change from serial roundoff error. If an arithmetic reduction is accumulated in a different order than in the scalar program, the roundoff error is accumulated differently and the final result may differ from that of the original program's output. Although the difference is usually insignificant, certain restructuring transformations performed by the KAP must be disabled to obtain exactly the same answers as those of the scalar program.

KAP classifies its transformations by the amount of difference in roundoff error that can accumulate, so you can decide what level of roundoff error difference is allowable.

The meanings of the switch values are as follows:

0

Allow no roundoff-changing transformations.

1

Enable expression simplification that might generate overflow or underflow errors differently. Enable simplification of expressions with operands between binary and unary operators. Perform expression simplification that is exposed due to forward substitution. Enable code floating if the -scalaropt option is greater than or equal to 1.

2

Allow loop interchanging around arithmetic reductions to be recognized.

3

Recognize real (float) induction variables. Enable sum reductions. Enable memory management optimizations if scalaropt=3.

The -so Flag

-so=integer
Long name: -scalaropt=integer
The -scalaropt option sets the level of dusty-deck and other serial transformations performed.

The following are possible values for integer:

0

No scalar optimizations are performed.

1

Only simple scalar optimizations are performed �- dead code elimination, global forward substitution and dusty-deck IF transformations.

2

Full range of scalar optimizations are performed - invariant IF's are floated out of loops, loop rerolling/unrolling, array expansion, loop fusion, loop peeling and induction variable recognition.

3

Memory management optimizations are enabled if roundoff=3.

Next | Prev | Up | Top | Contents | Index