The -hoist_loop_invariants
switch controls code
hoisting of loop-invariant expressions from loops. This switch is
independent of the switches, -each_invariant_if_growth
and -max_invariant_if_growth
, that control the
floating of invariant-IFs out of loops. The possible settings for
-hoist_loop_invariants
are the following:
0
- Turns off the hoisting of invariant code
from loops.
1
- Floats all loop invariant expressions not
under the control of an IF-structure within the given loop nest.
This is the default setting.
2
- Functions like the 1
setting, except that a zero trip IF statement is not created to
guard the loop to protect array references that are potentially
out of bounds when floated outside the loop. This setting can
give a slight performance increase at the expense of a possible
runtime error.
3
- Floats all loop-invariant expressions
from the loop structure.
If there is invariant code that is protected by an IF-structure and the hoisting value is less than 3, then KAP generates the following message in the output listing:
An invariant expression not hoisted because -hoist_loop_invariants < 3
Copyright © Digital Equipment Corporation. 1997. All Rights Reserved.