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
26 #ifndef FIRM_BE_BELOOPANA_H
27 #define FIRM_BE_BELOOPANA_H
34 typedef struct be_loopana_t be_loopana_t;
37 * Compute the register pressure for a class of all loops in the irg.
38 * @param irg The graph
39 * @param cls The register class to compute the pressure for
40 * @return The loop analysis object.
42 be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
43 const arch_register_class_t *cls);
46 * Compute the register pressure of all loops in the irg.
47 * @param irg The graph
48 * @param cls register class to compute loop pressure for,
49 * if NULL computes for all classes
50 * @return The loop analysis object.
52 be_loopana_t *be_new_loop_pressure(ir_graph *irg,
53 const arch_register_class_t *cls);
56 * Returns the computed register pressure for the given class and loop.
57 * @return The pressure or INT_MAX if not found
59 unsigned be_get_loop_pressure(be_loopana_t *loop_ana,
60 const arch_register_class_t *cls, ir_loop *loop);
63 * Frees loop analysis object.
65 void be_free_loop_pressure(be_loopana_t *loop_ana);