- New register allocation verifier
[libfirm] / ir / be / beverify.h
1 /**
2  * Author:    Matthias Braun
3  * Date:      05.05.2006
4  * Copyright: (c) Universitaet Karlsruhe
5  * License:   This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  * CVS-Id:    $Id$
7  */
8
9 /**
10  * @file beverify.h
11  *
12  * Various verify routines that check a scheduled graph for correctness
13  *
14  * @author Matthias Braun
15  */
16 #ifndef BEVERIFY_H_
17 #define BEVERIFY_H_
18
19 #include "bechordal.h"
20
21 /**
22  * Verifies, that the register pressure for a given register class doesn't exceed the limit
23  * of available registers.
24  *
25  * @param arch_env   An architecture environment
26  * @param cls        The register class to check
27  * @param irg        The irg to check
28  * @return                       1 if the pressure is valid, 0 otherwise
29  */
30 int be_verify_register_pressure(const arch_env_t *arch_env, const arch_register_class_t* cls, ir_graph *irg);
31
32 /**
33  * Does some sanity checks on the schedule.
34  *
35  * @param irg   The irg to check
36  * @return              1 if the schedule is valid, 0 otherwise
37  */
38 int be_verify_schedule(ir_graph *irg);
39
40 /**
41  * Verify spillslots
42  *
43  * @param irg   The irg to check
44  * @return      1 if spillslots are valid, 0 otherwise
45  */
46 int be_verify_spillslots(ir_graph *irg);
47
48 /**
49  * Verify register allocation: Checks that no 2 live nodes have the same
50  * register assigned, also checks that each scheduled node has a register
51  * assigned.
52  *
53  * @param irg  The irg to check
54  * @return     1 if verify succeeded, 0 otherwise
55  */
56 int be_verify_register_allocation(const arch_env_t *arch_env, ir_graph *irg);
57
58 #endif /* BEVERIFY_H_ */