- Split bearch.h correctly into bearch.h and bearch_t.h
[libfirm] / ir / be / beloopana.h
1 /**
2  * Analyse register pressure in loops.
3  * @author Christian Wuerdig
4  * @date 2006/02/20
5  * @cvsid $Id$
6  */
7
8 #ifndef _BELOOPANA_H_
9 #define _BELOOPANA_H_
10
11 #include "irloop.h"
12
13 #include "bearch_t.h"
14 #include "beirg.h"
15
16 typedef struct _be_loopana_t be_loopana_t;
17
18 /**
19  * Compute the register pressure for a class of all loops in the birg.
20  * @param birg  The backend irg object
21  * @param cls   The register class to compute the pressure for
22  * @return The loop analysis object.
23  */
24 be_loopana_t *be_new_loop_pressure_cls(be_irg_t *birg, const arch_register_class_t *cls);
25
26 /**
27  * Compute the register pressure for all classes of all loops in the birg.
28  * @param birg  The backend irg object
29  * @return The loop analysis object.
30  */
31 be_loopana_t *be_new_loop_pressure(be_irg_t *birg);
32
33 /**
34  * Returns the computed register pressure for the given class and loop.
35  * @return The pressure or INT_MAX if not found
36  */
37 unsigned be_get_loop_pressure(be_loopana_t *loop_ana, const arch_register_class_t *cls, ir_loop *loop);
38
39 /**
40  * Frees loop analysis object.
41  */
42 void be_free_loop_pressure(be_loopana_t *loop_ana);
43
44 #endif /* _BELOOPANA_H_ */