- Added 2 new blockschedulers, a greedy algorithm and an "optimal" ILP that
[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  * Set debug information for a node.
46  * @param n The node.
47  * @param dbg Some string copied to Java.
48  */
49 void be_java_coal_set_debug(be_java_coal_t *c, int n, const char *dbg);
50
51 /**
52  * Forbid a color for a node.
53  * Afterwards, the node may not be assigned that color.
54  * @param n The node.
55  * @param col The color.
56  */
57 void be_java_coal_forbid_color(be_java_coal_t *c, int n, int col);
58
59 /**
60  * Start the coalescing.
61  */
62 void be_java_coal_coalesce(be_java_coal_t *c);
63
64 /**
65  * Dump the graph into a dot file.
66  * @param fn Filename to dump to.
67  */
68 void be_java_coal_dump(be_java_coal_t *c, const char *fn);
69
70 /**
71  * Get the color of a node.
72  * @param n The node.
73  * @return The color of the node.
74  */
75 int be_java_coal_get_color(be_java_coal_t *c, int n);
76
77 /**
78  * Init the JAVA coalescer.
79  * @param graph_name The name of the graph to coalesce.
80  * @param n_nodes The number of nodes in the graph. Each node has an ID which ranges from 0 to n_nodes - 1.
81  * @param n_regs  The number of colors available.
82  * @param dbg_level Te debug level for the coalescer. 0 means quiet. >0 more verbose.
83  * @return The coalescing object.
84  */
85 be_java_coal_t *be_java_coal_init(const char *graph_name, int n_nodes, int n_regs, int dbg_level);
86
87 /**
88  * Start the JVM.
89  * This is also done lazily by be_java_coal_init() but as that is called by
90  * the coalescing driver, it might tamper the runtime measurements. So here is
91  * an extra call.
92  */
93 void be_java_coal_start_jvm(void);
94
95 /**
96  * Destroy the coalescing object.
97  */
98 void be_java_coal_destroy(be_java_coal_t *c);
99
100 #endif