bechordal_main.c 13 KB
Newer Older
Christian Würdig's avatar
Christian Würdig committed
1
/*
Michael Beck's avatar
Michael Beck committed
2
 * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
Christian Würdig's avatar
Christian Würdig committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *
 * This file is part of libFirm.
 *
 * This file may be distributed and/or modified under the terms of the
 * GNU General Public License version 2 as published by the Free Software
 * Foundation and appearing in the file LICENSE.GPL included in the
 * packaging of this file.
 *
 * Licensees holding valid libFirm Professional Edition licenses may use
 * this file in accordance with the libFirm Commercial License.
 * Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
 */

Sebastian Hack's avatar
Sebastian Hack committed
20
/**
Christian Würdig's avatar
Christian Würdig committed
21
22
23
24
25
 * @file
 * @brief       Driver for the chordal register allocator.
 * @author      Sebastian Hack
 * @date        29.11.2005
 * @version     $Id$
Sebastian Hack's avatar
Sebastian Hack committed
26
 */
27
#include "config.h"
Sebastian Hack's avatar
Sebastian Hack committed
28

Christian Würdig's avatar
Christian Würdig committed
29
#include <stdlib.h>
30
31
#include <time.h>

Sebastian Hack's avatar
Sebastian Hack committed
32
33
34
35
36
37
#include "obst.h"
#include "pset.h"
#include "list.h"
#include "bitset.h"
#include "iterator.h"

Matthias Braun's avatar
Matthias Braun committed
38
39
#include "lc_opts.h"
#include "lc_opts_enum.h"
40

Michael Beck's avatar
Michael Beck committed
41
#include "ircons_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
42
43
44
45
#include "irmode_t.h"
#include "irgraph_t.h"
#include "irprintf_t.h"
#include "irgwalk.h"
Sebastian Hack's avatar
Sebastian Hack committed
46
#include "ircons.h"
Sebastian Hack's avatar
Sebastian Hack committed
47
48
#include "irdump.h"
#include "irdom.h"
Christian Würdig's avatar
Christian Würdig committed
49
#include "ircons.h"
Sebastian Hack's avatar
Sebastian Hack committed
50
#include "irbitset.h"
51
52
#include "irnode.h"
#include "ircons.h"
Sebastian Hack's avatar
Sebastian Hack committed
53
#include "debug.h"
Sebastian Hack's avatar
Sebastian Hack committed
54
#include "execfreq.h"
Christian Würdig's avatar
Christian Würdig committed
55
#include "iredges_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
56
57

#include "bechordal_t.h"
58
#include "beabi.h"
Sebastian Hack's avatar
Sebastian Hack committed
59
60
61
62
#include "beutil.h"
#include "besched.h"
#include "besched_t.h"
#include "belive_t.h"
63
#include "bearch_t.h"
64
#include "beifg_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
65
#include "beifg_impl.h"
Christian Würdig's avatar
Christian Würdig committed
66
#include "benode_t.h"
67
#include "bestatevent.h"
68
#include "bestat.h"
69
#include "bemodule.h"
70
#include "be_t.h"
Christian Würdig's avatar
Christian Würdig committed
71
72
#include "bera.h"
#include "beirg_t.h"
Sebastian Hack's avatar
Sebastian Hack committed
73

Matthias Braun's avatar
Matthias Braun committed
74
#include "bespillslots.h"
75
#include "bespilloptions.h"
76
77
#include "belower.h"

Daniel Grund's avatar
Daniel Grund committed
78
#include "becopystat.h"
Daniel Grund's avatar
Daniel Grund committed
79
#include "becopyopt.h"
Christian Würdig's avatar
Christian Würdig committed
80
#include "bessadestr.h"
81
#include "beverify.h"
82
#include "benode_t.h"
Christian Würdig's avatar
Christian Würdig committed
83

Sebastian Hack's avatar
Sebastian Hack committed
84
static be_ra_chordal_opts_t options = {
Sebastian Hack's avatar
Sebastian Hack committed
85
	BE_CH_DUMP_NONE,
Christian Würdig's avatar
Christian Würdig committed
86
	BE_CH_LOWER_PERM_SWAP,
Christian Würdig's avatar
Christian Würdig committed
87
	BE_CH_VRFY_WARN,
88
89
	"",
	""
Sebastian Hack's avatar
Sebastian Hack committed
90
91
};

92
typedef struct _post_spill_env_t {
93
94
95
96
	be_chordal_env_t            cenv;
	be_irg_t                    *birg;
	const arch_register_class_t *cls;
	double                      pre_spill_cost;
97
98
} post_spill_env_t;

99
100
static const lc_opt_enum_int_items_t lower_perm_items[] = {
	{ "copy", BE_CH_LOWER_PERM_COPY },
101
102
103
104
105
	{ "swap", BE_CH_LOWER_PERM_SWAP },
	{ NULL, 0 }
};

static const lc_opt_enum_int_items_t lower_perm_stat_items[] = {
106
107
108
	{ NULL, 0 }
};

Sebastian Hack's avatar
Sebastian Hack committed
109
static const lc_opt_enum_int_items_t dump_items[] = {
110
	{ "none",       BE_CH_DUMP_NONE       },
Matthias Braun's avatar
Matthias Braun committed
111
112
113
114
115
116
117
118
119
120
121
	{ "spill",      BE_CH_DUMP_SPILL      },
	{ "live",       BE_CH_DUMP_LIVE       },
	{ "color",      BE_CH_DUMP_COLOR      },
	{ "copymin",    BE_CH_DUMP_COPYMIN    },
	{ "ssadestr",   BE_CH_DUMP_SSADESTR   },
	{ "tree",       BE_CH_DUMP_TREE_INTV  },
	{ "constr",     BE_CH_DUMP_CONSTR     },
	{ "lower",      BE_CH_DUMP_LOWER      },
	{ "spillslots", BE_CH_DUMP_SPILLSLOTS },
	{ "appel",      BE_CH_DUMP_APPEL      },
	{ "all",        BE_CH_DUMP_ALL        },
Christian Würdig's avatar
Christian Würdig committed
122
123
124
125
126
127
128
	{ NULL, 0 }
};

static const lc_opt_enum_int_items_t be_ch_vrfy_items[] = {
	{ "off",    BE_CH_VRFY_OFF    },
	{ "warn",   BE_CH_VRFY_WARN   },
	{ "assert", BE_CH_VRFY_ASSERT },
Sebastian Hack's avatar
Sebastian Hack committed
129
130
131
	{ NULL, 0 }
};

132
static lc_opt_enum_int_var_t lower_perm_var = {
133
	&options.lower_perm_opt, lower_perm_items
134
135
};

Sebastian Hack's avatar
Sebastian Hack committed
136
137
138
139
static lc_opt_enum_int_var_t dump_var = {
	&options.dump_flags, dump_items
};

Christian Würdig's avatar
Christian Würdig committed
140
141
142
143
static lc_opt_enum_int_var_t be_ch_vrfy_var = {
	&options.vrfy_option, be_ch_vrfy_items
};

144
static const lc_opt_table_entry_t be_chordal_options[] = {
145
	LC_OPT_ENT_ENUM_PTR ("perm",          "perm lowering options", &lower_perm_var),
Sebastian Hack's avatar
Sebastian Hack committed
146
	LC_OPT_ENT_ENUM_MASK("dump",          "select dump phases", &dump_var),
147
	LC_OPT_ENT_ENUM_PTR ("verify",        "verify options", &be_ch_vrfy_var),
148
	LC_OPT_LAST
149
150
};

Sebastian Hack's avatar
Sebastian Hack committed
151
static void dump(unsigned mask, ir_graph *irg,
152
153
154
				 const arch_register_class_t *cls,
				 const char *suffix,
				 void (*dump_func)(ir_graph *, const char *))
Sebastian Hack's avatar
Sebastian Hack committed
155
{
Christian Würdig's avatar
Christian Würdig committed
156
157
	if((options.dump_flags & mask) == mask) {
		if (cls) {
158
159
			char buf[256];
			snprintf(buf, sizeof(buf), "-%s%s", cls->name, suffix);
Christian Würdig's avatar
Christian Würdig committed
160
			be_dump(irg, buf, dump_func);
161
162
		}
		else
Christian Würdig's avatar
Christian Würdig committed
163
			be_dump(irg, suffix, dump_func);
164
	}
Sebastian Hack's avatar
Sebastian Hack committed
165
166
}

Christian Würdig's avatar
Christian Würdig committed
167
/**
168
 * Checks for every reload if its user can perform the load on itself.
Christian Würdig's avatar
Christian Würdig committed
169
 */
170
171
static void memory_operand_walker(ir_node *irn, void *env)
{
Christian Würdig's avatar
Christian Würdig committed
172
173
	const ir_edge_t  *edge, *ne;
	ir_node          *block;
174
	ir_node          *spill;
Christian Würdig's avatar
Christian Würdig committed
175

176
177
	(void)env;

Christian Würdig's avatar
Christian Würdig committed
178
179
180
	if (! be_is_Reload(irn))
		return;

181
	/* only use memory operands, if the reload is only used by 1 node */
182
183
184
185
	if(get_irn_n_edges(irn) > 1)
		return;

	spill = be_get_Reload_mem(irn);
Christian Würdig's avatar
Christian Würdig committed
186
187
188
189
190
191
	block = get_nodes_block(irn);

	foreach_out_edge_safe(irn, edge, ne) {
		ir_node *src = get_edge_src_irn(edge);
		int     pos  = get_edge_src_pos(edge);

192
		assert(src && "outedges broken!");
Christian Würdig's avatar
Christian Würdig committed
193

194
		if (get_nodes_block(src) == block && arch_possible_memory_operand(src, pos)) {
195
			arch_perform_memory_operand(src, spill, pos);
Christian Würdig's avatar
Christian Würdig committed
196
197
198
199
200
201
		}
	}

	/* kill the Reload */
	if (get_irn_n_edges(irn) == 0) {
		sched_remove(irn);
202
		set_irn_n(irn, be_pos_Reload_mem, new_Bad());
203
		set_irn_n(irn, be_pos_Reload_frame, new_Bad());
Christian Würdig's avatar
Christian Würdig committed
204
205
206
207
208
209
	}
}

/**
 * Starts a walk for memory operands if supported by the backend.
 */
Matthias Braun's avatar
Matthias Braun committed
210
void check_for_memory_operands(ir_graph *irg)
211
212
{
	irg_walk_graph(irg, NULL, memory_operand_walker, NULL);
Christian Würdig's avatar
Christian Würdig committed
213
214
}

215

Matthias Braun's avatar
Matthias Braun committed
216
static be_node_stats_t last_node_stats;
217

218
/**
219
 * Perform things which need to be done per register class before spilling.
220
 */
221
222
static void pre_spill(post_spill_env_t *pse, const arch_register_class_t *cls)
{
Matthias Braun's avatar
Matthias Braun committed
223
224
225
	be_chordal_env_t    *chordal_env = &pse->cenv;
	be_irg_t            *birg        = pse->birg;
	ir_graph            *irg         = be_get_birg_irg(birg);
226

227
228
	pse->cls                   = cls;
	chordal_env->cls           = cls;
229
230
	chordal_env->border_heads  = pmap_create();
	chordal_env->ignore_colors = bitset_malloc(chordal_env->cls->n_regs);
231

Sebastian Hack's avatar
Sebastian Hack committed
232
233
	be_assure_liveness(birg);
	be_liveness_assure_chk(be_get_birg_liveness(birg));
234

235
	stat_ev_do(pse->pre_spill_cost = be_estimate_irg_costs(irg, birg->exec_freq));
Sebastian Hack's avatar
Sebastian Hack committed
236

237
	/* put all ignore registers into the ignore register set. */
238
	be_put_ignore_regs(birg, pse->cls, chordal_env->ignore_colors);
Sebastian Hack's avatar
Sebastian Hack committed
239

Matthias Braun's avatar
Matthias Braun committed
240
	BE_TIMER_PUSH(t_ra_constr);
241
	be_pre_spill_prepare_constr(chordal_env->birg, chordal_env->cls);
Matthias Braun's avatar
Matthias Braun committed
242
243
	BE_TIMER_POP(t_ra_constr);

244
	dump(BE_CH_DUMP_CONSTR, birg->irg, pse->cls, "-constr-pre", dump_ir_block_graph_sched);
245
}
246

247
248
249
/**
 * Perform things which need to be done per register class after spilling.
 */
250
static void post_spill(post_spill_env_t *pse, int iteration) {
251
	be_chordal_env_t    *chordal_env = &pse->cenv;
252
253
	be_irg_t            *birg        = pse->birg;
	ir_graph            *irg         = birg->irg;
254
	int                  colors_n    = arch_register_class_n_regs(chordal_env->cls);
255
256
257
	int             allocatable_regs = colors_n - be_put_ignore_regs(birg, chordal_env->cls, NULL);

	/* some special classes contain only ignore regs, no work to be done */
258
	if (allocatable_regs > 0) {
259
		stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, birg->exec_freq) - pse->pre_spill_cost);
Adam Szalkowski's avatar
Adam Szalkowski committed
260

261
262
263
264
265
		/*
			If we have a backend provided spiller, post spill is
			called in a loop after spilling for each register class.
			But we only need to fix stack nodes once in this case.
		*/
266
		BE_TIMER_PUSH(t_ra_spill_apply);
267
		check_for_memory_operands(irg);
268
269
270
		if (iteration == 0) {
			be_abi_fix_stack_nodes(birg->abi);
		}
271
		BE_TIMER_POP(t_ra_spill_apply);
Sebastian Hack's avatar
Sebastian Hack committed
272

Sebastian Hack's avatar
Sebastian Hack committed
273

274
		/* verify schedule and register pressure */
275
		BE_TIMER_PUSH(t_verify);
276
277
278
		if (chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN) {
			be_verify_schedule(birg);
			be_verify_register_pressure(birg, pse->cls, irg);
Matthias Braun's avatar
Matthias Braun committed
279
		} else if (chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT) {
280
281
282
283
			assert(be_verify_schedule(birg) && "Schedule verification failed");
			assert(be_verify_register_pressure(birg, pse->cls, irg)
				&& "Register pressure verification failed");
		}
Matthias Braun's avatar
Matthias Braun committed
284
		BE_TIMER_POP(t_verify);
285

286
		/* Color the graph. */
Matthias Braun's avatar
Matthias Braun committed
287
		BE_TIMER_PUSH(t_ra_color);
288
		be_ra_chordal_color(chordal_env);
Matthias Braun's avatar
Matthias Braun committed
289
		BE_TIMER_POP(t_ra_color);
290

291
		dump(BE_CH_DUMP_CONSTR, irg, pse->cls, "-color", dump_ir_block_graph_sched);
292

293
		/* Create the ifg with the selected flavor */
Matthias Braun's avatar
Matthias Braun committed
294
		BE_TIMER_PUSH(t_ra_ifg);
295
		chordal_env->ifg = be_create_ifg(chordal_env);
Matthias Braun's avatar
Matthias Braun committed
296
		BE_TIMER_POP(t_ra_ifg);
Christian Würdig's avatar
Christian Würdig committed
297

298
		stat_ev_if {
Matthias Braun's avatar
Matthias Braun committed
299
300
			be_ifg_stat_t   stat;
			be_node_stats_t node_stats;
301

302
			be_ifg_stat(birg, chordal_env->ifg, &stat);
303
304
305
			stat_ev_dbl("bechordal_ifg_nodes", stat.n_nodes);
			stat_ev_dbl("bechordal_ifg_edges", stat.n_edges);
			stat_ev_dbl("bechordal_ifg_comps", stat.n_comps);
306

Matthias Braun's avatar
Matthias Braun committed
307
308
309
			be_collect_node_stats(&node_stats, birg);
			be_subtract_node_stats(&node_stats, &last_node_stats);

310
			stat_ev_dbl("bechordal_perms_before_coal",
Matthias Braun's avatar
Matthias Braun committed
311
					node_stats[BE_STAT_PERMS]);
312
			stat_ev_dbl("bechordal_copies_before_coal",
Matthias Braun's avatar
Matthias Braun committed
313
					node_stats[BE_STAT_COPIES]);
314
		}
Christian Würdig's avatar
Christian Würdig committed
315

316
		/* copy minimization */
Matthias Braun's avatar
Matthias Braun committed
317
		BE_TIMER_PUSH(t_ra_copymin);
318
		co_driver(chordal_env);
Matthias Braun's avatar
Matthias Braun committed
319
		BE_TIMER_POP(t_ra_copymin);
320
321
322

		dump(BE_CH_DUMP_COPYMIN, irg, pse->cls, "-copymin", dump_ir_block_graph_sched);

323

324
		/* ssa destruction */
Matthias Braun's avatar
Matthias Braun committed
325
		BE_TIMER_PUSH(t_ra_ssa);
326
		be_ssa_destruction(chordal_env);
Matthias Braun's avatar
Matthias Braun committed
327
		BE_TIMER_POP(t_ra_ssa);
328

329
		dump(BE_CH_DUMP_SSADESTR, irg, pse->cls, "-ssadestr", dump_ir_block_graph_sched);
330

331
		if (chordal_env->opts->vrfy_option != BE_CH_VRFY_OFF) {
Matthias Braun's avatar
Matthias Braun committed
332
			BE_TIMER_PUSH(t_verify);
333
			be_ssa_destruction_check(chordal_env);
Matthias Braun's avatar
Matthias Braun committed
334
			BE_TIMER_POP(t_verify);
335
		}
336

337
338
		/* the ifg exists only if there are allocatable regs */
		be_ifg_free(chordal_env->ifg);
339
	}
Sebastian Hack's avatar
Sebastian Hack committed
340

341
	/* free some always allocated data structures */
342
343
344
	pmap_destroy(chordal_env->border_heads);
	bitset_free(chordal_env->ignore_colors);
}
345

346
347
348
349
350
351
/**
 * Performs chordal register allocation for each register class on given irg.
 *
 * @param birg  Backend irg object
 * @return Structure containing timer for the single phases or NULL if no timing requested.
 */
352
static void be_ra_chordal_main(be_irg_t *birg)
353
{
354
355
356
357
358
359
	const arch_env_t *arch_env = birg->main_env->arch_env;
	ir_graph         *irg      = birg->irg;
	int               j;
	int               m;
	be_chordal_env_t  chordal_env;
	struct obstack    obst;
Matthias Braun's avatar
Matthias Braun committed
360

Matthias Braun's avatar
Matthias Braun committed
361
362
363
	BE_TIMER_PUSH(t_ra_other);

	BE_TIMER_PUSH(t_ra_prolog);
Sebastian Hack's avatar
Sebastian Hack committed
364

365
	be_assure_liveness(birg);
366

Michael Beck's avatar
Michael Beck committed
367
	chordal_env.obst          = &obst;
368
369
370
371
372
373
	chordal_env.opts          = &options;
	chordal_env.irg           = irg;
	chordal_env.birg          = birg;
	chordal_env.border_heads  = NULL;
	chordal_env.ifg           = NULL;
	chordal_env.ignore_colors = NULL;
374

Michael Beck's avatar
Michael Beck committed
375
	obstack_init(&obst);
376

Matthias Braun's avatar
Matthias Braun committed
377
	BE_TIMER_POP(t_ra_prolog);
Matthias Braun's avatar
Matthias Braun committed
378

Matthias Braun's avatar
Matthias Braun committed
379
	stat_ev_if {
Matthias Braun's avatar
Matthias Braun committed
380
		be_collect_node_stats(&last_node_stats, birg);
Matthias Braun's avatar
Matthias Braun committed
381
	}
Matthias Braun's avatar
Matthias Braun committed
382

383
384
	if (! arch_code_generator_has_spiller(birg->cg)) {
		/* use one of the generic spiller */
Christian Würdig's avatar
Christian Würdig committed
385

386
		/* Perform the following for each register class. */
387
		for (j = 0, m = arch_env_get_n_reg_class(arch_env); j < m; ++j) {
388
			post_spill_env_t pse;
389
			const arch_register_class_t *cls
390
				= arch_env_get_reg_class(arch_env, j);
391
392
393
394

			if(arch_register_class_flags(cls) & arch_register_class_flag_manual_ra)
				continue;

Christian Würdig's avatar
Christian Würdig committed
395

396
397
			stat_ev_ctx_push_str("bechordal_cls", cls->name);

398
399
400
401
			stat_ev_if {
				be_do_stat_reg_pressure(birg, cls);
			}

402
			memcpy(&pse.cenv, &chordal_env, sizeof(chordal_env));
403
			pse.birg = birg;
404
			pre_spill(&pse, cls);
405

Matthias Braun's avatar
Matthias Braun committed
406
			BE_TIMER_PUSH(t_ra_spill);
407
			be_do_spill(birg, cls);
Matthias Braun's avatar
Matthias Braun committed
408
			BE_TIMER_POP(t_ra_spill);
Sebastian Hack's avatar
Sebastian Hack committed
409

410
411
			dump(BE_CH_DUMP_SPILL, irg, pse.cls, "-spill",
			     dump_ir_block_graph_sched);
Christian Würdig's avatar
Christian Würdig committed
412

413
			post_spill(&pse, 0);
414
415

			stat_ev_if {
Matthias Braun's avatar
Matthias Braun committed
416
417
418
419
420
421
422
				be_node_stats_t node_stats;

				be_collect_node_stats(&node_stats, birg);
				be_subtract_node_stats(&node_stats, &last_node_stats);
				be_emit_node_stats(&node_stats, "bechordal_");

				be_copy_node_stats(&last_node_stats, &node_stats);
423
424
				stat_ev_ctx_pop("bechordal_cls");
			}
425
		}
426
	} else {
427
		post_spill_env_t *pse;
Christian Würdig's avatar
Christian Würdig committed
428

Christoph Mallon's avatar
Christoph Mallon committed
429
		/* the backend has its own spiller */
430
		m = arch_env_get_n_reg_class(arch_env);
Christian Würdig's avatar
Christian Würdig committed
431

432
		pse = ALLOCAN(post_spill_env_t, m);
433
434
435

		for (j = 0; j < m; ++j) {
			memcpy(&pse[j].cenv, &chordal_env, sizeof(chordal_env));
436
			pse[j].birg = birg;
437
			pre_spill(&pse[j], pse[j].cls);
438
		}
Sebastian Hack's avatar
Sebastian Hack committed
439

Matthias Braun's avatar
Matthias Braun committed
440
		BE_TIMER_PUSH(t_ra_spill);
441
		arch_code_generator_spill(birg->cg, birg);
Matthias Braun's avatar
Matthias Braun committed
442
		BE_TIMER_POP(t_ra_spill);
443
		dump(BE_CH_DUMP_SPILL, irg, NULL, "-spill", dump_ir_block_graph_sched);
444

445
		for (j = 0; j < m; ++j) {
446
			post_spill(&pse[j], j);
Sebastian Hack's avatar
Sebastian Hack committed
447
		}
Sebastian Hack's avatar
Sebastian Hack committed
448
449
	}

Matthias Braun's avatar
Matthias Braun committed
450
	BE_TIMER_PUSH(t_verify);
451
452
453
454
455
456
	if (chordal_env.opts->vrfy_option == BE_CH_VRFY_WARN) {
		be_verify_register_allocation(birg);
	} else if(chordal_env.opts->vrfy_option == BE_CH_VRFY_ASSERT) {
		assert(be_verify_register_allocation(birg)
				&& "Register allocation invalid");
	}
Matthias Braun's avatar
Matthias Braun committed
457
	BE_TIMER_POP(t_verify);
Sebastian Hack's avatar
Sebastian Hack committed
458

Matthias Braun's avatar
Matthias Braun committed
459
	BE_TIMER_PUSH(t_ra_epilog);
460
	lower_nodes_after_ra(birg, options.lower_perm_opt & BE_CH_LOWER_PERM_COPY ? 1 : 0);
461
	dump(BE_CH_DUMP_LOWER, irg, NULL, "-belower-after-ra", dump_ir_block_graph_sched);
462

Michael Beck's avatar
Michael Beck committed
463
	obstack_free(&obst, NULL);
Sebastian Hack's avatar
Sebastian Hack committed
464
	be_liveness_invalidate(be_get_birg_liveness(birg));
Matthias Braun's avatar
Matthias Braun committed
465
	BE_TIMER_POP(t_ra_epilog);
466

Matthias Braun's avatar
Matthias Braun committed
467
	BE_TIMER_POP(t_ra_other);
Sebastian Hack's avatar
Sebastian Hack committed
468
469
}

470
void be_init_chordal_main(void)
471
{
472
473
474
475
	static be_ra_t be_ra_chordal_allocator = {
		be_ra_chordal_main,
	};

476
477
478
479
480
	lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
	lc_opt_entry_t *ra_grp = lc_opt_get_grp(be_grp, "ra");
	lc_opt_entry_t *chordal_grp = lc_opt_get_grp(ra_grp, "chordal");

	lc_opt_add_table(chordal_grp, be_chordal_options);
481

482
483
484
	be_register_allocator("chordal", &be_ra_chordal_allocator);
}

485
BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal_main);