- new spillslots dump phase
[libfirm] / ir / be / bejavacoal.h
1
2 #ifndef _BEJAVACOAL_H
3 #define _BEJAVACOAL_H
4
5 struct _be_java_coal_t;
6 typedef struct _be_java_coal_t be_java_coal_t;
7
8
9 #ifdef WITH_LIBCORE
10
11 #include <libcore/lc_opts.h>
12 #include <libcore/lc_opts_enum.h>
13 #include "firm_config.h"
14
15 /**
16  * Register libcore options.
17  */
18 void be_java_coal_register_options(lc_opt_entry_t *grp);
19
20 #endif /* WITH_LIBCORE */
21
22 /**
23  * Add an interference edge
24  * @param n first node id.
25  * @param m second node id.
26  */
27 void be_java_coal_add_int_edge(be_java_coal_t *c, int n, int m);
28
29 /**
30  * Add an affinity edge.
31  * @param n first node id.
32  * @param m second node id.
33  * @param costs Costs for the edge.
34  */
35 void be_java_coal_add_aff_edge(be_java_coal_t *c, int n, int m, int costs);
36
37 /**
38  * Set the color of a node.
39  * @param n The node.
40  * @param col The color.
41  */
42 void be_java_coal_set_color(be_java_coal_t *c, int n, int col);
43
44 /**
45  * Forbid a color for a node.
46  * Afterwards, the node may not be assigned that color.
47  * @param n The node.
48  * @param col The color.
49  */
50 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
51
52 /**
53  * Start the coalescing.
54  */
55 void be_java_coal_coalesce(be_java_coal_t *c);
56
57 /**
58  * Dump the graph into a dot file.
59  * @param fn Filename to dump to.
60  */
61 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
62
63 /**
64  * Get the color of a node.
65  * @param n The node.
66  * @return The color of the node.
67  */
68 int be_java_coal_get_color(be_java_coal_t *c, int n);
69
70 /**
71  * Init the JAVA coalescer.
72  * @param graph_name The name of the graph to coalesce.
73  * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
74  * @param n_regs  The number of colors available.
75  * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
76  * @return The coalescing object.
77  */
78 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
79
80 /**
81  * Destroy the coalescing object.
82  */
83 void be_java_coal_destroy(be_java_coal_t *c);
84
85 #endif