beverify.h 1.68 KB
Newer Older
Christian Würdig's avatar
Christian Würdig committed
1
2
/*
 * This file is part of libFirm.
3
 * Copyright (C) 2012 University of Karlsruhe.
Christian Würdig's avatar
Christian Würdig committed
4
5
 */

6
/**
Christian Würdig's avatar
Christian Würdig committed
7
8
9
10
 * @file
 * @brief       Various verify routines that check a scheduled graph for correctness.
 * @author      Matthias Braun
 * @date        05.05.2006
11
 */
Christian Würdig's avatar
Christian Würdig committed
12
13
#ifndef FIRM_BE_BEVERIFY_H
#define FIRM_BE_BEVERIFY_H
14

15
#include <stdbool.h>
Christian Würdig's avatar
Christian Würdig committed
16
17

#include "bearch.h"
18
#include "firm_types.h"
19
20

/**
21
22
 * Verifies, that the register pressure for a given register class doesn't
 * exceed the limit of available registers.
Christian Würdig's avatar
Christian Würdig committed
23
 *
Sebastian Hack's avatar
Sebastian Hack committed
24
 * @param irg        The irg to check.
25
 * @param cls        The register class to check.
26
 * @return           true if the pressure is valid, false otherwise.
27
 */
28
29
bool be_verify_register_pressure(ir_graph *irg,
                                 const arch_register_class_t* cls);
30
31

/**
Christian Würdig's avatar
Christian Würdig committed
32
33
 * Does some sanity checks on the schedule.
 *
34
 * @param irg   The irg to check
35
 * @return      true if the schedule is valid, false otherwise
36
 */
37
bool be_verify_schedule(ir_graph *irg);
38

39
40
41
/**
 * Verify spillslots
 */
42
43
bool be_verify_spillslots(ir_graph *irg,
                          get_frame_entity_func get_frame_entity);
44

45
46
47
48
49
/**
 * Verify register allocation: Checks that no 2 live nodes have the same
 * register assigned, also checks that each scheduled node has a register
 * assigned.
 *
50
 * @param irg   The graph to check
51
52
 * @param ignore_sp_problems  if true do not report problems involving values
 *                            with arch_register_req_type_produces_sp
53
 * @return      true if verify succeeded, false otherwise
54
 */
55
bool be_verify_register_allocation(ir_graph *irg, bool ignore_sp_problems);
56

57
58
59
60
61
/**
 * Check the given liveness information against a freshly computed one.
 */
void be_liveness_check(be_lv_t *lv);

62
#endif