made copy_attrs an ir_op operation
[libfirm] / ir / ir / iropt.h
1 /*
2  * Project:     libFIRM
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
7  * Created:
8  * CVS-ID:      $Id$
9  * Copyright:   (c) 1998-2003 Universität Karlsruhe
10  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
11  */
12
13 /**
14 * @file iropt.h
15 *
16 * Declarations for optimizations of an ir node.
17 *
18 * @author Martin Trapp, Christian Schaefer
19 */
20
21
22 # ifndef _IROPT_H_
23 # define _IROPT_H_
24
25 # include "irnode.h"
26 # include "irgraph.h"
27 # include "irflag.h"
28
29 /** If the expression referenced can be evaluated statically
30  *  computed_value returns a tarval representing the result.
31  *  Else returns tarval_bad. */
32 tarval *computed_value (ir_node *n);
33
34 /** Applies all optimizations to n that are expressible as a pattern
35  *  in Firm, i.e., they need not a walk of the graph.
36  *  Returns a better node for n.  Does not free n -- other nodes could
37  *  reference n.
38  *
39  *  An equivalent optimization is applied in the constructors defined in
40  *  ircons.ch.  There n is freed if a better node could be found.
41  */
42 ir_node *optimize_in_place (ir_node *n);
43
44 # endif /* _IROPT_H_ */