3 * File name: ir/ir/iropt.h
4 * Purpose: iropt --- optimizations of an ir node.
5 * Author: Martin Trapp, Christian Schaefer
6 * Modified by: Goetz Lindenmaier, Michael Beck
9 * Copyright: (c) 1998-2003 Universität Karlsruhe
10 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
16 * Declarations for optimizations of an ir node.
18 * @author Martin Trapp, Christian Schaefer
20 #ifndef _FIRM_IR_IROPT_H_
21 #define _FIRM_IR_IROPT_H_
23 #include "firm_types.h"
25 /** If the expression referenced can be evaluated statically
26 * computed_value returns a tarval representing the result.
27 * Else returns tarval_bad. */
28 tarval *computed_value(ir_node *n);
30 /** Applies all optimizations to n that are expressible as a pattern
31 * in Firm, i.e., they need not a walk of the graph.
32 * Returns a better node for n. Does not free n -- other nodes could
35 * An equivalent optimization is applied in the constructors defined in
36 * ircons.ch. There n is freed if a better node could be found.
38 ir_node *optimize_in_place(ir_node *n);
40 #endif /* _FIRM_IR_IROPT_H_ */