98a1d72bcc627851ba71eb374f2f7c88ac2933e5
[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, Michael Beck
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 #ifndef _FIRM_IR_IROPT_H_
21 #define _FIRM_IR_IROPT_H_
22
23 #include "firm_types.h"
24
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);
29
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
33  *  reference n.
34  *
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.
37  */
38 ir_node *optimize_in_place(ir_node *n);
39
40 #endif /* _FIRM_IR_IROPT_H_ */