Some functions moved to bechordal_common.c
[libfirm] / ir / be / bechordal.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Chordal register allocation.
23  * @author      Sebastian Hack
24  * @date        08.12.2004
25  * @version     $Id$
26  */
27 #include "config.h"
28
29 #include <ctype.h>
30
31 #include "obst.h"
32 #include "pset.h"
33 #include "list.h"
34 #include "bitset.h"
35 #include "raw_bitset.h"
36 #include "iterator.h"
37 #include "bipartite.h"
38 #include "hungarian.h"
39
40 #include "irmode_t.h"
41 #include "irgraph_t.h"
42 #include "irprintf_t.h"
43 #include "irgwalk.h"
44 #include "irdump.h"
45 #include "irdom.h"
46 #include "irtools.h"
47 #include "irbitset.h"
48 #include "debug.h"
49 #include "iredges.h"
50
51 #include "beutil.h"
52 #include "besched.h"
53 #include "besched.h"
54 #include "belive_t.h"
55 #include "benode.h"
56 #include "bearch.h"
57 #include "beirgmod.h"
58 #include "beifg.h"
59 #include "beinsn_t.h"
60 #include "bestatevent.h"
61 #include "beirg.h"
62 #include "beintlive_t.h"
63 #include "bera.h"
64 #include "bechordal_t.h"
65 #include "bechordal_draw.h"
66 #include "bemodule.h"
67 #include "bearch.h"
68 #include "bechordal_common.h"
69
70 DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
71
72 #define NO_COLOR (-1)
73
74 #define DUMP_INTERVALS
75
76 typedef struct _be_chordal_alloc_env_t {
77         be_chordal_env_t *chordal_env;
78
79         pset *pre_colored;     /**< Set of precolored nodes. */
80         bitset_t *live;            /**< A liveness bitset. */
81         bitset_t *tmp_colors;  /**< An auxiliary bitset which is as long as the number of colors in the class. */
82         bitset_t *colors;          /**< The color mask. */
83         bitset_t *in_colors;   /**< Colors used by live in values. */
84         int colors_n;          /**< The number of colors. */
85 } be_chordal_alloc_env_t;
86
87 #if 0
88 static void check_border_list(struct list_head *head)
89 {
90         border_t *x;
91         list_for_each_entry(border_t, x, head, list) {
92                 assert(x->magic == BORDER_FOURCC);
93         }
94 }
95
96 static void check_heads(be_chordal_env_t *env)
97 {
98         pmap_entry *ent;
99         for (ent = pmap_first(env->border_heads); ent; ent = pmap_next(env->border_heads)) {
100                 /* ir_printf("checking border list of block %+F\n", ent->key); */
101                 check_border_list(ent->value);
102         }
103 }
104 #endif
105
106 ///**
107 // * Add an interval border to the list of a block's list
108 // * of interval border.
109 // * @note You always have to create the use before the def.
110 // * @param env The environment.
111 // * @param head The list head to enqueue the borders.
112 // * @param irn The node (value) the border belongs to.
113 // * @param pressure The pressure at this point in time.
114 // * @param step A time step for the border.
115 // * @param is_def Is the border a use or a def.
116 // * @return The created border.
117 // */
118 //static inline border_t *border_add(be_chordal_env_t *env, struct list_head *head,
119 //                      ir_node *irn, unsigned step, unsigned pressure,
120 //                      unsigned is_def, unsigned is_real)
121 //{
122 //      border_t *b;
123 //
124 //      if (!is_def) {
125 //              border_t *def;
126 //
127 //              b = OALLOC(env->obst, border_t);
128 //
129 //              /* also allocate the def and tie it to the use. */
130 //              def = OALLOCZ(env->obst, border_t);
131 //              b->other_end = def;
132 //              def->other_end = b;
133 //
134 //              /*
135 //               * Set the link field of the irn to the def.
136 //               * This strongly relies on the fact, that the use is always
137 //               * made before the def.
138 //               */
139 //              set_irn_link(irn, def);
140 //
141 //              DEBUG_ONLY(b->magic = BORDER_FOURCC);
142 //              DEBUG_ONLY(def->magic = BORDER_FOURCC);
143 //      } else {
144 //              /*
145 //               * If the def is encountered, the use was made and so was the
146 //               * the def node (see the code above). It was placed into the
147 //               * link field of the irn, so we can get it there.
148 //               */
149 //              b = get_irn_link(irn);
150 //
151 //              DEBUG_ONLY(assert(b && b->magic == BORDER_FOURCC && "Illegal border encountered"));
152 //      }
153 //
154 //      b->pressure = pressure;
155 //      b->is_def = is_def;
156 //      b->is_real = is_real;
157 //      b->irn = irn;
158 //      b->step = step;
159 //      list_add_tail(&b->list, head);
160 //      DBG((dbg, LEVEL_5, "\t\t%s adding %+F, step: %d\n", is_def ? "def" : "use", irn, step));
161 //
162 //
163 //      return b;
164 //}
165
166 ///**
167 // * Check, if an irn is of the register class currently under processing.
168 // * @param env The chordal environment.
169 // * @param irn The node.
170 // * @return 1, if the node is of that register class, 0 if not.
171 // */
172 //static inline int has_reg_class(const be_chordal_env_t *env, const ir_node *irn)
173 //{
174 //      return arch_irn_consider_in_reg_alloc(env->cls, irn);
175 //}
176
177 static int get_next_free_reg(const be_chordal_alloc_env_t *alloc_env, bitset_t *colors)
178 {
179         bitset_t *tmp = alloc_env->tmp_colors;
180         bitset_copy(tmp, colors);
181         bitset_or(tmp, alloc_env->chordal_env->ignore_colors);
182         return bitset_next_clear(tmp, 0);
183 }
184
185 static bitset_t *get_decisive_partner_regs(bitset_t *bs, const be_operand_t *o1, const be_operand_t *o2)
186 {
187         bitset_t *res = bs;
188
189         if (!o1) {
190                 bitset_copy(bs, o2->regs);
191                 return bs;
192         }
193
194         if (!o2) {
195                 bitset_copy(bs, o1->regs);
196                 return bs;
197         }
198
199         assert(o1->req->cls == o2->req->cls || ! o1->req->cls || ! o2->req->cls);
200
201         if (bitset_contains(o1->regs, o2->regs)) {
202                 bitset_copy(bs, o1->regs);
203         } else if (bitset_contains(o2->regs, o1->regs)) {
204                 bitset_copy(bs, o2->regs);
205         } else {
206                 res = NULL;
207         }
208
209         return res;
210 }
211
212 static void pair_up_operands(const be_chordal_alloc_env_t *alloc_env, be_insn_t *insn)
213 {
214         const be_chordal_env_t *env = alloc_env->chordal_env;
215         bitset_t               *bs  = bitset_alloca(env->cls->n_regs);
216         int                     i;
217         int                     j;
218
219         /*
220          * For each out operand, try to find an in operand which can be assigned the
221          * same register as the out operand.
222         */
223         for (j = 0; j < insn->use_start; ++j) {
224                 int smallest         = -1;
225                 int smallest_n_regs  = 2 * env->cls->n_regs + 1;
226                 be_operand_t *out_op = &insn->ops[j];
227
228                 /* Try to find an in operand which has ... */
229                 for (i = insn->use_start; i < insn->n_ops; ++i) {
230                         int n_total;
231                         const be_operand_t *op = &insn->ops[i];
232
233                         if (op->partner != NULL)
234                                 continue;
235                         if (be_values_interfere(env->birg->lv, op->irn, op->carrier))
236                                 continue;
237
238                         bitset_clear_all(bs);
239                         bitset_copy(bs, op->regs);
240                         bitset_and(bs, out_op->regs);
241                         n_total = bitset_popcnt(op->regs) + bitset_popcnt(out_op->regs);
242
243                         if (!bitset_is_empty(bs) && n_total < smallest_n_regs) {
244                                 smallest = i;
245                                 smallest_n_regs = n_total;
246                         }
247                 }
248
249                 if (smallest >= 0) {
250                         be_operand_t *partner = &insn->ops[smallest];
251                         for (i = insn->use_start; i < insn->n_ops; ++i) {
252                                 if (insn->ops[i].carrier == partner->carrier)
253                                         insn->ops[i].partner = out_op;
254                         }
255
256                         out_op->partner  = partner;
257                         partner->partner = out_op;
258                 }
259         }
260 }
261
262 static ir_node *handle_constraints(be_chordal_alloc_env_t *alloc_env,
263                                    ir_node *irn, int *silent)
264 {
265         int n_regs;
266         bitset_t *bs;
267         ir_node **alloc_nodes;
268         //hungarian_problem_t *bp;
269         int *assignment;
270         pmap *partners;
271         int i, n_alloc;
272         bitset_pos_t col;
273         const ir_edge_t *edge;
274         ir_node *perm = NULL;
275         //int match_res, cost;
276         be_chordal_env_t *env  = alloc_env->chordal_env;
277         void *base             = obstack_base(env->obst);
278         be_insn_t *insn        = chordal_scan_insn(env, irn);
279         ir_node *res           = insn->next_insn;
280         int be_silent          = *silent;
281         bipartite_t *bp;
282
283         if (insn->pre_colored) {
284                 int i;
285                 for (i = 0; i < insn->use_start; ++i)
286                         pset_insert_ptr(alloc_env->pre_colored, insn->ops[i].carrier);
287         }
288
289         /*
290          * If the current node is a barrier toggle the silent flag.
291          * If we are in the start block, we are ought to be silent at the beginning,
292          * so the toggling activates the constraint handling but skips the barrier.
293          * If we are in the end block we handle the in requirements of the barrier
294          * and set the rest to silent.
295          */
296         if (be_is_Barrier(irn))
297                 *silent = !*silent;
298
299         if (be_silent)
300                 goto end;
301
302         /*
303          * Perms inserted before the constraint handling phase are considered to be
304          * correctly precolored. These Perms arise during the ABI handling phase.
305          */
306         if (!insn->has_constraints)
307                 goto end;
308
309         n_regs      = env->cls->n_regs;
310         bs          = bitset_alloca(n_regs);
311         alloc_nodes = ALLOCAN(ir_node*, n_regs);
312         //bp          = hungarian_new(n_regs, n_regs, 2, HUNGARIAN_MATCH_PERFECT);
313         bp          = bipartite_new(n_regs, n_regs);
314         assignment  = ALLOCAN(int, n_regs);
315         partners    = pmap_create();
316
317         /*
318          * prepare the constraint handling of this node.
319          * Perms are constructed and Copies are created for constrained values
320          * interfering with the instruction.
321          */
322         perm = pre_process_constraints(alloc_env->chordal_env, &insn);
323
324         /* find suitable in operands to the out operands of the node. */
325         pair_up_operands(alloc_env, insn);
326
327         /*
328          * look at the in/out operands and add each operand (and its possible partner)
329          * to a bipartite graph (left: nodes with partners, right: admissible colors).
330          */
331         for (i = 0, n_alloc = 0; i < insn->n_ops; ++i) {
332                 be_operand_t *op = &insn->ops[i];
333
334                 /*
335                  * If the operand has no partner or the partner has not been marked
336                  * for allocation, determine the admissible registers and mark it
337                  * for allocation by associating the node and its partner with the
338                  * set of admissible registers via a bipartite graph.
339                  */
340                 if (!op->partner || !pmap_contains(partners, op->partner->carrier)) {
341                         ir_node *partner = op->partner ? op->partner->carrier : NULL;
342                         int i;
343
344                         pmap_insert(partners, op->carrier, partner);
345                         if (partner != NULL)
346                                 pmap_insert(partners, partner, op->carrier);
347
348                         /* don't insert a node twice */
349                         for (i = 0; i < n_alloc; ++i) {
350                                 if (alloc_nodes[i] == op->carrier) {
351                                         break;
352                                 }
353                         }
354                         if (i < n_alloc)
355                                 continue;
356
357                         alloc_nodes[n_alloc] = op->carrier;
358
359                         DBG((dbg, LEVEL_2, "\tassociating %+F and %+F\n", op->carrier,
360                              partner));
361
362                         bitset_clear_all(bs);
363                         get_decisive_partner_regs(bs, op, op->partner);
364
365                         DBG((dbg, LEVEL_2, "\tallowed registers for %+F: %B\n", op->carrier,
366                              bs));
367
368                         bitset_foreach(bs, col) {
369                                 //hungarian_add(bp, n_alloc, col, 1);
370                                 bipartite_add(bp, n_alloc, col);
371                         }
372
373                         n_alloc++;
374                 }
375         }
376
377         /*
378          * Put all nodes which live through the constrained instruction also to the
379          * allocation bipartite graph. They are considered unconstrained.
380          */
381         if (perm != NULL) {
382                 foreach_out_edge(perm, edge) {
383                         int i;
384                         ir_node *proj = get_edge_src_irn(edge);
385
386                         assert(is_Proj(proj));
387
388                         if (!be_values_interfere(env->birg->lv, proj, irn)
389                                         || pmap_contains(partners, proj))
390                                 continue;
391
392                         /* don't insert a node twice */
393                         for (i = 0; i < n_alloc; ++i) {
394                                 if (alloc_nodes[i] == proj) {
395                                         break;
396                                 }
397                         }
398                         if (i < n_alloc)
399                                 continue;
400
401
402                         assert(n_alloc < n_regs);
403
404                         alloc_nodes[n_alloc] = proj;
405                         pmap_insert(partners, proj, NULL);
406
407                         bitset_clear_all(bs);
408                         arch_put_non_ignore_regs(env->cls, bs);
409                         bitset_andnot(bs, env->ignore_colors);
410                         bitset_foreach(bs, col) {
411                                 //hungarian_add(bp, n_alloc, col, 1);
412                                 bipartite_add(bp, n_alloc, col);
413                         }
414
415                         n_alloc++;
416                 }
417         }
418
419         /* Compute a valid register allocation. */
420 #if 0
421         hungarian_prepare_cost_matrix(bp, HUNGARIAN_MODE_MAXIMIZE_UTIL);
422         match_res = hungarian_solve(bp, assignment, &cost, 1);
423         assert(match_res == 0 && "matching failed");
424 #else
425         bipartite_matching(bp, assignment);
426 #endif
427
428         /* Assign colors obtained from the matching. */
429         for (i = 0; i < n_alloc; ++i) {
430                 const arch_register_t *reg;
431                 ir_node *irn;
432
433                 assert(assignment[i] >= 0 && "there must have been a register assigned");
434                 reg = arch_register_for_index(env->cls, assignment[i]);
435                 assert(! (reg->type & arch_register_type_ignore));
436
437                 irn = alloc_nodes[i];
438                 if (irn != NULL) {
439                         arch_set_irn_register(irn, reg);
440                         (void) pset_hinsert_ptr(alloc_env->pre_colored, irn);
441                         DBG((dbg, LEVEL_2, "\tsetting %+F to register %s\n", irn, reg->name));
442                 }
443
444                 irn = pmap_get(partners, alloc_nodes[i]);
445                 if (irn != NULL) {
446                         arch_set_irn_register(irn, reg);
447                         (void) pset_hinsert_ptr(alloc_env->pre_colored, irn);
448                         DBG((dbg, LEVEL_2, "\tsetting %+F to register %s\n", irn, reg->name));
449                 }
450         }
451
452         /* Allocate the non-constrained Projs of the Perm. */
453         if (perm != NULL) {
454                 bitset_clear_all(bs);
455
456                 /* Put the colors of all Projs in a bitset. */
457                 foreach_out_edge(perm, edge) {
458                         ir_node *proj              = get_edge_src_irn(edge);
459                         const arch_register_t *reg = arch_get_irn_register(proj);
460
461                         if (reg != NULL)
462                                 bitset_set(bs, reg->index);
463                 }
464
465                 /* Assign the not yet assigned Projs of the Perm a suitable color. */
466                 foreach_out_edge(perm, edge) {
467                         ir_node *proj              = get_edge_src_irn(edge);
468                         const arch_register_t *reg = arch_get_irn_register(proj);
469
470                         DBG((dbg, LEVEL_2, "\tchecking reg of %+F: %s\n", proj, reg ? reg->name : "<none>"));
471
472                         if (reg == NULL) {
473                                 col = get_next_free_reg(alloc_env, bs);
474                                 reg = arch_register_for_index(env->cls, col);
475                                 bitset_set(bs, reg->index);
476                                 arch_set_irn_register(proj, reg);
477                                 pset_insert_ptr(alloc_env->pre_colored, proj);
478                                 DBG((dbg, LEVEL_2, "\tsetting %+F to register %s\n", proj, reg->name));
479                         }
480                 }
481         }
482
483         bipartite_free(bp);
484         //hungarian_free(bp);
485         pmap_destroy(partners);
486
487 end:
488         obstack_free(env->obst, base);
489         return res;
490 }
491
492 /**
493  * Handle constraint nodes in each basic block.
494  * handle_constraints() inserts Perm nodes which perm
495  * over all values live at the constrained node right in front
496  * of the constrained node. These Perms signal a constrained node.
497  * For further comments, refer to handle_constraints().
498  */
499 static void constraints(ir_node *bl, void *data)
500 {
501         /*
502          * Start silent in the start block.
503          * The silence remains until the first barrier is seen.
504          * Each other block is begun loud.
505          */
506         int                     silent = bl == get_irg_start_block(get_irn_irg(bl));
507         be_chordal_alloc_env_t *env    = data;
508         ir_node                *irn;
509
510         /*
511          * If the block is the start block search the barrier and
512          * start handling constraints from there.
513          */
514         for (irn = sched_first(bl); !sched_is_end(irn);) {
515                 irn = handle_constraints(env, irn, &silent);
516         }
517 }
518
519 static void assign(ir_node *block, void *env_ptr)
520 {
521         be_chordal_alloc_env_t *alloc_env = env_ptr;
522         be_chordal_env_t *env       = alloc_env->chordal_env;
523         bitset_t *live              = alloc_env->live;
524         bitset_t *colors            = alloc_env->colors;
525         bitset_t *in_colors         = alloc_env->in_colors;
526         struct list_head *head      = get_block_border_head(env, block);
527         be_lv_t *lv                 = env->birg->lv;
528
529         const ir_node *irn;
530         border_t *b;
531         int idx;
532
533         bitset_clear_all(colors);
534         bitset_clear_all(live);
535         bitset_clear_all(in_colors);
536
537         DBG((dbg, LEVEL_4, "Assigning colors for block %+F\n", block));
538         DBG((dbg, LEVEL_4, "\tusedef chain for block\n"));
539         list_for_each_entry(border_t, b, head, list) {
540                 DBG((dbg, LEVEL_4, "\t%s %+F/%d\n", b->is_def ? "def" : "use",
541                                         b->irn, get_irn_idx(b->irn)));
542         }
543
544         /*
545          * Add initial defs for all values live in.
546          * Since their colors have already been assigned (The dominators were
547          * allocated before), we have to mark their colors as used also.
548          */
549         be_lv_foreach(lv, block, be_lv_state_in, idx) {
550                 irn = be_lv_get_irn(lv, block, idx);
551                 if (has_reg_class(env, irn)) {
552                         const arch_register_t *reg = arch_get_irn_register(irn);
553                         int col;
554
555                         assert(reg && "Node must have been assigned a register");
556                         col = arch_register_get_index(reg);
557
558                         DBG((dbg, LEVEL_4, "%+F has reg %s\n", irn, reg->name));
559
560                         /* Mark the color of the live in value as used. */
561                         bitset_set(colors, col);
562                         bitset_set(in_colors, col);
563
564                         /* Mark the value live in. */
565                         bitset_set(live, get_irn_idx(irn));
566                 }
567         }
568
569         /*
570          * Mind that the sequence of defs from back to front defines a perfect
571          * elimination order. So, coloring the definitions from first to last
572          * will work.
573          */
574         list_for_each_entry_reverse(border_t, b, head, list) {
575                 ir_node *irn = b->irn;
576                 int nr       = get_irn_idx(irn);
577                 int ignore   = arch_irn_is_ignore(irn);
578
579                 /*
580                  * Assign a color, if it is a local def. Global defs already have a
581                  * color.
582                  */
583                 if (b->is_def && !be_is_live_in(lv, block, irn)) {
584                         const arch_register_t *reg;
585                         int col = NO_COLOR;
586
587                         if (ignore || pset_find_ptr(alloc_env->pre_colored, irn)) {
588                                 reg = arch_get_irn_register(irn);
589                                 col = reg->index;
590                                 assert(!bitset_is_set(colors, col) && "pre-colored register must be free");
591                         } else {
592                                 col = get_next_free_reg(alloc_env, colors);
593                                 reg = arch_register_for_index(env->cls, col);
594                                 assert(arch_get_irn_register(irn) == NULL && "This node must not have been assigned a register yet");
595                                 assert(!arch_register_type_is(reg, ignore) && "Must not assign ignore register");
596                         }
597
598                         bitset_set(colors, col);
599                         arch_set_irn_register(irn, reg);
600
601                         DBG((dbg, LEVEL_1, "\tassigning register %s(%d) to %+F\n", arch_register_get_name(reg), col, irn));
602
603                         assert(!bitset_is_set(live, nr) && "Value's definition must not have been encountered");
604                         bitset_set(live, nr);
605                 } else if (!b->is_def) {
606                         /* Clear the color upon a use. */
607                         const arch_register_t *reg = arch_get_irn_register(irn);
608                         int col;
609
610                         assert(reg && "Register must have been assigned");
611
612                         col = arch_register_get_index(reg);
613 #ifndef NDEBUG
614                         if (!arch_register_type_is(reg, ignore)) {
615                                 assert(bitset_is_set(live, nr) && "Cannot have a non live use");
616                         }
617 #endif
618
619                         bitset_clear(colors, col);
620                         bitset_clear(live, nr);
621                 }
622         }
623 }
624
625 void be_ra_chordal_color(be_chordal_env_t *chordal_env)
626 {
627         be_chordal_alloc_env_t env;
628         char buf[256];
629         be_lv_t *lv;
630         be_irg_t *birg = chordal_env->birg;
631         const arch_register_class_t *cls = chordal_env->cls;
632
633         int colors_n          = arch_register_class_n_regs(cls);
634         ir_graph *irg         = chordal_env->irg;
635
636         lv = be_assure_liveness(birg);
637         be_liveness_assure_sets(lv);
638         be_liveness_assure_chk(lv);
639
640         assure_doms(irg);
641
642         env.chordal_env   = chordal_env;
643         env.colors_n      = colors_n;
644         env.colors        = bitset_alloca(colors_n);
645         env.tmp_colors    = bitset_alloca(colors_n);
646         env.in_colors     = bitset_alloca(colors_n);
647         env.pre_colored   = pset_new_ptr_default();
648
649         BE_TIMER_PUSH(t_constr);
650
651         /* Handle register targeting constraints */
652         dom_tree_walk_irg(irg, constraints, NULL, &env);
653
654         if (chordal_env->opts->dump_flags & BE_CH_DUMP_CONSTR) {
655                 snprintf(buf, sizeof(buf), "-%s-constr", chordal_env->cls->name);
656                 be_dump(chordal_env->irg, buf, dump_ir_block_graph_sched);
657         }
658
659         BE_TIMER_POP(t_constr);
660
661         env.live = bitset_malloc(get_irg_last_idx(chordal_env->irg));
662
663         /* First, determine the pressure */
664         dom_tree_walk_irg(irg, pressure, NULL, env.chordal_env);
665
666         /* Assign the colors */
667         dom_tree_walk_irg(irg, assign, NULL, &env);
668
669         if (chordal_env->opts->dump_flags & BE_CH_DUMP_TREE_INTV) {
670                 plotter_t *plotter;
671                 ir_snprintf(buf, sizeof(buf), "ifg_%s_%F.eps", chordal_env->cls->name, irg);
672                 plotter = new_plotter_ps(buf);
673                 draw_interval_tree(&draw_chordal_def_opts, chordal_env, plotter);
674                 plotter_free(plotter);
675         }
676
677         bitset_free(env.live);
678         del_pset(env.pre_colored);
679 }
680
681 void be_init_chordal(void)
682 {
683         FIRM_DBG_REGISTER(dbg, "firm.be.chordal");
684
685         static be_ra_chordal_coloring_t coloring = {
686                 be_ra_chordal_color
687         };
688
689         be_register_chordal_coloring("default", &coloring);
690 }
691
692 BE_REGISTER_MODULE_CONSTRUCTOR(be_init_chordal);