3 * File name: ir/opt/opt_osr.h
4 * Purpose: Operator Strength Reduction,
5 * Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick
10 * Copyright: (c) 2006 Universität Karlsruhe
11 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 #include "firm_types.h"
19 osr_flag_none = 0, /**< no additional flags */
20 osr_flag_lftr_with_ov_check = 1, /**< do only linear function test replacement
21 if no overflow occurs. */
22 /** default setting */
23 osr_flag_default = osr_flag_lftr_with_ov_check
27 * Do the Operator Scalar Replacement optimization and linear
28 * function test replacement for loop control.
30 * @param irg the graph which should be optimized
31 * @param flags one of osr_flags
33 * The linear function replacement test is controlled by the flags.
34 * If the osr_flag_lftr_with_ov_check is set, the replacement is only
35 * done if do overflow can occur.
36 * Otherwise it is ALWAYS done which might be unsure.
40 * for (i = 0; i < 100; ++i)
42 * might be replaced by
44 * for (i = 0; i < 400; i += 4)
48 * for (i = 0; i < 0x7FFFFFFF; ++i)
50 * will not be replaced by
52 * for (i = 0; i < 0xFFFFFFFC; i += 4)
54 * because of overflow.
56 * Note that i < a + 400 is also not possible with the current implementation
57 * although this might be allowed by other compilers...
59 void opt_osr(ir_graph *irg, unsigned flags);
61 #endif /* _OPT_OSR_H_ */