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
33 typedef struct be_loopana_t be_loopana_t;
36 * Compute the register pressure for a class of all loops in the irg.
37 * @param irg The graph
38 * @param cls The register class to compute the pressure for
39 * @return The loop analysis object.
41 be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
42 const arch_register_class_t *cls);
45 * Compute the register pressure of all loops in the irg.
46 * @param irg The graph
47 * @param cls register class to compute loop pressure for,
48 * if NULL computes for all classes
49 * @return The loop analysis object.
51 be_loopana_t *be_new_loop_pressure(ir_graph *irg,
52 const arch_register_class_t *cls);
55 * Returns the computed register pressure for the given class and loop.
56 * @return The pressure or INT_MAX if not found
58 unsigned be_get_loop_pressure(be_loopana_t *loop_ana,
59 const arch_register_class_t *cls, ir_loop *loop);
62 * Frees loop analysis object.
64 void be_free_loop_pressure(be_loopana_t *loop_ana);