we don't need no stinking selfs
[libfirm] / ir / be / beloopana.h
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Compute register pressure in loops.
23  * @author      Christian Wuerdig
24  * @date        20.02.2007
25  * @version     $Id$
26  */
27 #ifndef FIRM_BE_BELOOPANA_H
28 #define FIRM_BE_BELOOPANA_H
29
30 #include "irloop.h"
31
32 #include "bearch.h"
33 #include "beirg.h"
34
35 typedef struct _be_loopana_t be_loopana_t;
36
37 /**
38  * Compute the register pressure for a class of all loops in the birg.
39  * @param birg  The backend irg object
40  * @param cls   The register class to compute the pressure for
41  * @return The loop analysis object.
42  */
43 be_loopana_t *be_new_loop_pressure_cls(be_irg_t *birg, const arch_register_class_t *cls);
44
45 /**
46  * Compute the register pressure for all classes of all loops in the birg.
47  * @param birg  The backend irg object
48  * @return The loop analysis object.
49  */
50 be_loopana_t *be_new_loop_pressure(be_irg_t *birg);
51
52 /**
53  * Returns the computed register pressure for the given class and loop.
54  * @return The pressure or INT_MAX if not found
55  */
56 unsigned be_get_loop_pressure(be_loopana_t *loop_ana, const arch_register_class_t *cls, ir_loop *loop);
57
58 /**
59  * Frees loop analysis object.
60  */
61 void be_free_loop_pressure(be_loopana_t *loop_ana);
62
63 #endif /* FIRM_BE_BELOOPANA_H */