2 * This file is part of libFirm.
3 * Copyright (C) 2012 University of Karlsruhe.
8 * @brief Compute register pressure in loops.
9 * @author Christian Wuerdig
12 #ifndef FIRM_BE_BELOOPANA_H
13 #define FIRM_BE_BELOOPANA_H
19 typedef struct be_loopana_t be_loopana_t;
22 * Compute the register pressure for a class of all loops in the irg.
23 * @param irg The graph
24 * @param cls The register class to compute the pressure for
25 * @return The loop analysis object.
27 be_loopana_t *be_new_loop_pressure_cls(ir_graph *irg,
28 const arch_register_class_t *cls);
31 * Compute the register pressure of all loops in the irg.
32 * @param irg The graph
33 * @param cls register class to compute loop pressure for,
34 * if NULL computes for all classes
35 * @return The loop analysis object.
37 be_loopana_t *be_new_loop_pressure(ir_graph *irg,
38 const arch_register_class_t *cls);
41 * Returns the computed register pressure for the given class and loop.
42 * @return The pressure or INT_MAX if not found
44 unsigned be_get_loop_pressure(be_loopana_t *loop_ana,
45 const arch_register_class_t *cls, ir_loop *loop);
48 * Frees loop analysis object.
50 void be_free_loop_pressure(be_loopana_t *loop_ana);