2 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
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.
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.
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
22 * @brief Compute register pressure in loops.
23 * @author Christian Wuerdig
27 #ifndef FIRM_BE_BELOOPANA_H
28 #define FIRM_BE_BELOOPANA_H
35 typedef struct _be_loopana_t be_loopana_t;
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.
43 be_loopana_t *be_new_loop_pressure_cls(be_irg_t *birg, const arch_register_class_t *cls);
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.
50 be_loopana_t *be_new_loop_pressure(be_irg_t *birg);
53 * Returns the computed register pressure for the given class and loop.
54 * @return The pressure or INT_MAX if not found
56 unsigned be_get_loop_pressure(be_loopana_t *loop_ana, const arch_register_class_t *cls, ir_loop *loop);
59 * Frees loop analysis object.
61 void be_free_loop_pressure(be_loopana_t *loop_ana);
63 #endif /* FIRM_BE_BELOOPANA_H */