Cosmetic Changes
[libfirm] / ir / be / beraextern.c
1 /**
2  * Author:      Daniel Grund
3  * Date:                17.01.2006
4  * Copyright:   (c) Universitaet Karlsruhe
5  * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
6  *
7  * Implementation of the RA-Interface for an external, (non-SSA) register allocator.
8  *
9  * The external register allocator is a program taking 2 arguments:
10  *   1) An input file in which the cfg is defined
11  *   2) An output file containing the essential actions performed during allocation
12  *
13
14
15 The input file format
16 ----------------------
17
18 inputfile       ::= regs cfg .
19
20 regs            ::= 'regs' regcount .                                           // Anzahl der register (0..regcount-1), die zur Verfuegung stehen
21
22 cfg                     ::= 'cfg' ident '{' block* edge* '}' .          // Steuerflussgraph der Prozedur
23
24 block           ::= 'block' block-nr '{' insn* '}' .            // Grundblock im cfg versehen mit einer nummer
25
26 edge            ::= 'cf-edge' block-nr block-nr .                       // Steuerflusskante src-->tgt
27
28 insn            ::= gen-insn                                                            // Befehl in einem block
29                           | copy-insn .
30
31 gen-insn        ::= 'insn' insn-nr '{' uses defs '}' .
32 copy-insn       ::= 'copy' insn-nr '{' uses defs '}' .
33
34 defs            ::= 'def' var-list .                                            // Liste der definierten/verwendeten Variablen
35 uses            ::= 'use' var-list .
36
37 var-list        ::= var-ref
38                           | var-ref var-list .
39
40 var-ref         ::= var-nr
41                           | var-nr '<' reg-nr '>' .                                     // reg-nr gibt register constraint an.
42
43
44 ident           ::= non-whitespace-char* .
45 regcount, block-nr, insn-nr, reg-nr, var-nr ::= integer .
46
47
48 The output file format
49 -----------------------
50
51 outputfile      ::= action* .
52
53 action          ::= 'spill'  loc var-nr                                 // insert a spill    spill(var-nr);
54                           | 'reload' loc var-nr var-nr                  // insert a reload   var-nr[1] := reload(var-nr[2]);
55                           | 'copy'   loc var-nr var-nr                  // insert a copy     var-nr[1] := var-nr[2];
56                           | 'assign' var-nr reg-nr .                    // assign var-nr the register reg-nr
57
58 loc                     ::= 'before' insn-nr
59                           | 'after'  insn-nr .
60
61 TODO
62  *
63  * End of file format docu */
64
65 #ifdef HAVE_CONFIG_H
66 #include "config.h"
67 #endif
68
69 #ifdef WIN32
70 #include <malloc.h>
71 #else
72 #include <alloca.h>
73 #endif
74
75 #include <stdio.h>
76 #include <stdlib.h>
77 #ifdef WITH_LIBCORE
78 #include <libcore/lc_opts.h>
79 #include <libcore/lc_opts_enum.h>
80 #endif
81
82 #include "pmap.h"
83 #include "pset.h"
84 #include "bitset.h"
85
86 #include "irprintf_t.h"
87 #include "irnode_t.h"
88 #include "irgraph_t.h"
89 #include "irgwalk.h"
90 #include "phiclass.h"
91
92 #include "beraextern.h"
93 #include "bearch.h"
94 #include "benode_t.h"
95 #include "besched.h"
96 #include "beutil.h"
97
98 /**
99  * Environment with all the needed stuff
100  */
101 typedef struct _be_raext_env_t {
102         arch_env_t *aenv;
103         const arch_register_class_t *cls;
104         ir_graph *irg;
105
106         FILE *f;                /**< file handle used for out- and input file */
107         pmap *vars;             /**< maps variable numbers (int) to the corresponding SSA-values (pset of irns) */
108         pmap *blocks;   /**< maps block numbers (int) to the block (ir_node*) having that node_nr */
109 } be_raext_env_t;
110
111 /******************************************************************************
112      ____        _   _
113     / __ \      | | (_)
114    | |  | |_ __ | |_ _  ___  _ __  ___
115    | |  | | '_ \| __| |/ _ \| '_ \/ __|
116    | |__| | |_) | |_| | (_) | | | \__ \
117     \____/| .__/ \__|_|\___/|_| |_|___/
118           | |
119           |_|
120  *****************************************************************************/
121
122
123 static void ssa_destr_simple(be_raext_env_t *);
124 static void ssa_destr_rastello(be_raext_env_t *);
125 static void be_ra_extern_main(const be_main_env_t *env, ir_graph *irg);
126
127 static void (*ssa_destr)(be_raext_env_t*) = ssa_destr_simple;
128 static char callee[128] = "echo";
129
130 #ifdef WITH_LIBCORE
131
132 static const lc_opt_enum_const_ptr_items_t ssa_destr_items[] = {
133         { "simple",    ssa_destr_simple },
134         { "rastello",  ssa_destr_rastello },
135         { NULL,      NULL }
136 };
137
138 static lc_opt_enum_const_ptr_var_t ssa_destr_var = {
139         (const void **) &ssa_destr, ssa_destr_items
140 };
141
142 static const lc_opt_table_entry_t be_ra_extern_options[] = {
143         LC_OPT_ENT_ENUM_FUNC_PTR("ssa_destr", "SSA destruction flavor", &ssa_destr_var),
144         LC_OPT_ENT_STR("callee", "The external program to call", callee, sizeof(callee)),
145         { NULL }
146 };
147
148 static void be_ra_extern_register_options(lc_opt_entry_t *root) {
149         lc_opt_entry_t *grp = lc_opt_get_grp(root, "ext");
150
151         lc_opt_add_table(grp, be_ra_extern_options);
152 }
153
154 #endif /* WITH_LIBCORE */
155
156 const be_ra_t be_ra_external_allocator = {
157 #ifdef WITH_LIBCORE
158         be_ra_extern_register_options,
159 #endif
160         be_ra_extern_main
161 };
162
163 /******************************************************************************
164     _    _      _
165    | |  | |    | |
166    | |__| | ___| |_ __   ___ _ __ ___
167    |  __  |/ _ \ | '_ \ / _ \ '__/ __|
168    | |  | |  __/ | |_) |  __/ |  \__ \
169    |_|  |_|\___|_| .__/ \___|_|  |___/
170                  | |
171                  |_|
172  *****************************************************************************/
173
174 /**
175  * Checks if _the_ result of the irn belongs to the
176  * current register class (raenv->cls)
177  * NOTE: Only the first result is checked.
178  */
179 #define is_res_in_reg_class(irn) arch_irn_has_reg_class(raenv->aenv, irn, -1, raenv->cls)
180
181
182 /**
183  * Checks if the irn uses or defines values of the
184  * current register class (raenv->cls)
185  */
186 static INLINE int is_sth_in_reg_class(be_raext_env_t *raenv, const ir_node *irn) {
187         int max, i;
188
189         /* check arguments */
190         for (i=0, max=get_irn_arity(irn); i<max; ++i)
191                 if (arch_irn_has_reg_class(raenv->aenv, get_irn_n(irn, i), -1, raenv->cls))
192                         return 1;
193
194         /* check result(s) */
195         if (get_irn_mode(irn) == mode_T) {
196                 ir_node *proj;
197                 for (proj = sched_next(irn); is_Proj(proj); proj = sched_next(proj))
198                         if (arch_irn_has_reg_class(raenv->aenv, proj, -1, raenv->cls))
199                                 return 1;
200                 return 0;
201         } else {
202                 return arch_irn_has_reg_class(raenv->aenv, irn, -1, raenv->cls);
203         }
204
205         assert(0 && "Where did you come from???");
206 }
207
208 /******************************************************************************
209      _____ _____              _____            _
210     / ____/ ____|  /\        |  __ \          | |
211    | (___| (___   /  \ ______| |  | | ___  ___| |_ _ __
212     \___ \\___ \ / /\ \______| |  | |/ _ \/ __| __| '__|
213     ____) |___) / ____ \     | |__| |  __/\__ \ |_| |
214    |_____/_____/_/    \_\    |_____/ \___||___/\__|_|
215
216  *****************************************************************************/
217
218 #define mark_as_done(irn, pos)                  set_irn_link(irn, INT_TO_PTR(pos+1))
219 #define has_been_done(irn, pos)                 (PTR_TO_INT(get_irn_link(irn)) > pos)
220
221 /**
222  * Insert a copy for the argument of @p start_phi found at position @p pos.
223  * Also searches a phi-loop of arbitrary length to detect and resolve
224  *   the class of phi-swap-problems. To search for a loop recursion is used.
225  *
226  * 1) Simplest case (phi with a non-phi arg):
227  *     A single copy is inserted.
228  *
229  * 2) Phi chain (phi (with phi-arg)* with non=phi arg):
230  *     Several copies are placed, each after returning from recursion.
231  *
232  * 3) Phi-loop:
233  *     On detection a loop breaker is inserted, which is a copy of the start_phi.
234  *     This copy then pretends beeing the argumnent of the last phi.
235  *     Now case 2) can be used.
236  *
237  * The values of @p start_phi and @p pos never change during recursion.
238  *
239  * @p raenv      Environment with all the stuff needed
240  * @p start_phi  Phi node to process
241  * @p pos        Argument position to insert copy/copies for
242  * @p curr_phi   Phi node currently processed during recursion. Equals start_phi on initial call
243  *
244  * @return NULL  If no copy is necessary
245  *         NULL  If the phi has already been processed at this pos
246  *               Link field is used to keep track of processed positions
247  *         In all other cases the ir_node *copy which was placed is returned.
248  */
249 static ir_node *insert_copies(be_raext_env_t *raenv, ir_node *start_phi, int pos, ir_node *curr_phi) {
250         ir_node *arg = get_irn_n(curr_phi, pos);
251         ir_node *arg_blk = get_nodes_block(arg);
252         ir_node *pred_blk = get_Block_cfgpred_block(get_nodes_block(curr_phi), pos);
253         ir_node *curr_cpy, *last_cpy;
254
255         assert(is_Phi(start_phi) && is_Phi(curr_phi));
256
257         if (has_been_done(start_phi, pos))
258                 return NULL;
259
260         /* In case this is a 'normal' phi we insert into
261          * the schedule before the pred_blk irn */
262         last_cpy = pred_blk;
263
264         /* If we detect a loop stop recursion. */
265         if (arg == start_phi) {
266                 ir_node *loop_breaker;
267                 if (start_phi == curr_phi) {
268                         /* Phi directly uses itself. No copy necessary */
269                         return NULL;
270                 }
271
272                 /* At least 2 phis are involved */
273                 /* Insert a loop breaking copy (an additional variable T) */
274                 loop_breaker = be_new_Copy(raenv->cls, raenv->irg, pred_blk, start_phi);
275                 sched_add_before(pred_blk, loop_breaker);
276
277                 arg = loop_breaker;
278         }
279
280         /* If arg is a phi in the same block we have to continue search */
281         if (is_Phi(arg) && arg_blk == get_nodes_block(start_phi))
282                 last_cpy = insert_copies(raenv, start_phi, pos, arg);
283
284         /* Insert copy of argument (may be the loop-breaker) */
285         curr_cpy = be_new_Copy(raenv->cls, raenv->irg, pred_blk, arg);
286         set_irn_n(curr_phi, pos, curr_cpy);
287         mark_as_done(curr_phi, pos);
288         sched_add_before(last_cpy, curr_cpy);
289         return curr_cpy;
290 }
291
292
293 /**
294  * Perform simple SSA-destruction with copies.
295  * The order of processing _must_ be
296  *  for all positions {
297  *    for all phis {
298  *      doit
299  *    }
300  *  }
301  * else the magic to keep track of processed phi-positions will fail in
302  * function 'insert_copies'
303  */
304 static void ssa_destr_simple_walker(ir_node *blk, void *env) {
305         be_raext_env_t *raenv = env;
306         int pos, max;
307         ir_node *phi;
308
309         /* for all argument positions of the phis */
310         for (pos=0, max=get_irn_arity(blk); pos<max; ++pos) {
311
312                 /* for all phi nodes (which are scheduled first) */
313                 sched_foreach(blk, phi) {
314                         if (!is_Phi(phi))
315                                 break;
316
317                         raenv->cls = arch_get_irn_reg_class(raenv->aenv, phi, -1);
318                         insert_copies(raenv, phi, pos, phi);
319                 }
320         }
321 }
322
323
324 static void ssa_destr_simple(be_raext_env_t *raenv) {
325         be_clear_links(raenv->irg);
326         irg_block_walk_graph(raenv->irg, ssa_destr_simple_walker, NULL, raenv);
327 }
328
329
330 static void ssa_destr_rastello(be_raext_env_t *raenv) {
331         phi_class_compute(raenv->irg);
332         //TODO irg_block_walk_graph(irg, ssa_destr_rastello, NULL, &raenv);
333 }
334
335 /******************************************************************************
336    __      __   _       ___   __      __
337    \ \    / /  | |     |__ \  \ \    / /
338     \ \  / /_ _| |___     ) |  \ \  / /_ _ _ __ ___
339      \ \/ / _` | / __|   / /    \ \/ / _` | '__/ __|
340       \  / (_| | \__ \  / /_     \  / (_| | |  \__ \
341        \/ \__,_|_|___/ |____|     \/ \__,_|_|  |___/
342  *****************************************************************************/
343
344 #define pmap_insert_sth(pmap, key, val) pmap_insert(pmap, (void *)key, (void *)val)
345 #define pmap_get_sth(pmap, key)                 pmap_get(pmap, (void *)key)
346 #define set_var_nr(irn, nr)                             set_irn_link(irn, INT_TO_PTR(nr))
347 #define get_var_nr(irn)                                 PTR_TO_INT(get_irn_link(irn))
348
349 /**
350  * Define variables (numbers) for all SSA-values.
351  * All values in a phi class get assigned the same variable name.
352  * The link field maps values to the var-name
353  */
354 static void values_to_vars(ir_node *irn, void *env) {
355         be_raext_env_t *raenv = env;
356         ir_node *n;
357         int nr;
358         pset *vals;
359
360         vals = get_phi_class(irn);
361
362         if (!vals) {
363                 /* not a phi class member, value == var */
364                 vals = pset_new_ptr(1);
365                 pset_insert_ptr(vals, irn);
366         }
367
368         /* value to var mapping */
369         n = pset_first(vals);
370         nr = get_irn_node_nr(n);
371         for (; n; n=pset_next(vals))
372                 set_var_nr(irn, nr);
373
374         /* var to values mapping */
375         pmap_insert_sth(raenv->vars, nr, vals);
376 }
377
378 /******************************************************************************
379     _____
380    |  __ \
381    | |  | |_   _ _ __ ___  _ __   ___ _ __
382    | |  | | | | | '_ ` _ \| '_ \ / _ \ '__|
383    | |__| | |_| | | | | | | |_) |  __/ |
384    |_____/ \__,_|_| |_| |_| .__/ \___|_|
385                           | |
386                           |_|
387  *****************************************************************************/
388
389
390 /**
391  * Check if node irn has a limited-constraint at position pos.
392  * If yes, dump it to FILE raenv->f
393  */
394 static INLINE void dump_constraint(be_raext_env_t *raenv, ir_node *irn, int pos) {
395         bitset_t *bs = bitset_alloca(raenv->cls->n_regs);
396         arch_register_req_t req;
397
398         arch_get_register_req(raenv->aenv, &req, irn, pos);
399         if (arch_register_req_is(&req, limited)) {
400                 int reg_nr;
401                 req.limited(irn, pos, bs);
402                 reg_nr = bitset_next_set(bs, 0);
403                 fprintf(raenv->f, " <%d>", reg_nr);
404                 assert(-1 == bitset_next_set(bs, reg_nr+1) && "Constraints with more than 1 possible register are not supported");
405         }
406 }
407
408
409 /**
410  * Dump all blocks and instructions in that block
411  */
412 static void dump_blocks(ir_node *blk, void *env) {
413         be_raext_env_t *raenv = env;
414         ir_node *irn;
415         FILE *f = raenv->f;
416         int nr = get_irn_node_nr(blk);
417
418         pmap_insert_sth(raenv->blocks, nr, blk);
419
420         /* begin block scope */
421         fprintf(f, "\n");
422         fprintf(f, "  block %d {\n", nr);
423
424         /* for each instruction */
425         for(irn=sched_first(blk); !sched_is_end(irn); irn=sched_next(irn)) {
426                 int max, i;
427                 if (is_Phi(irn) || !is_sth_in_reg_class(raenv, irn))
428                         continue;
429
430                 if (be_is_Copy(irn))
431                         fprintf(f, "    copy");
432                 else
433                         fprintf(f, "    insn");
434
435                 fprintf(f, " %ld {\n", get_irn_node_nr(irn));
436
437                         /*
438                          * print all uses
439                          */
440                         fprintf(f, "      use");
441                         for (i=0, max=get_irn_arity(irn); i<max; ++i) {
442                                 ir_node *arg = get_irn_n(irn, i);
443                                 if (arch_irn_has_reg_class(raenv->aenv, arg, -1, raenv->cls)) {
444                                         fprintf(f, " %d", get_var_nr(arg));
445                                         dump_constraint(raenv, irn, i);
446                                 }
447                         }
448                         fprintf(f,"\n");
449
450                         /*
451                          * print all defs
452                          */
453                         fprintf(f, "      def");
454                         /* special handling of projs */
455                         if (get_irn_mode(irn) == mode_T) {
456                                 for (irn = sched_next(irn); is_Proj(irn); irn = sched_next(irn))
457                                         if (arch_irn_has_reg_class(raenv->aenv, irn, -1, raenv->cls)) {
458                                                 fprintf(f, " %d", get_var_nr(irn));
459                                                 dump_constraint(raenv, irn, -1);
460                                         }
461                                 irn = sched_prev(irn); /* for outer loop */
462                         } else {
463                                 if (arch_irn_has_reg_class(raenv->aenv, irn, -1, raenv->cls)) {
464                                         fprintf(f, " %d", get_var_nr(irn));
465                                         dump_constraint(raenv, irn, -1);
466                                 }
467                         }
468                         fprintf(f,"\n");
469
470                 fprintf(f, "    }\n");
471         }
472
473         /* end the block scope */
474         fprintf(f, "  }\n");
475 }
476
477
478 /**
479  * Dump all control flow edges of this irg
480  */
481 static void dump_edges(ir_node *blk, void *env) {
482         be_raext_env_t *raenv = env;
483         int i, max;
484
485         if (get_irg_start_block(get_irn_irg(blk)) == blk)
486                 return;
487
488         /* dump cf edges in the flow-order "pred succ" */
489         for (i=0, max=get_irn_arity(blk); i<max; ++i) {
490                 ir_node *pred = get_Block_cfgpred_block(blk, i);
491                 fprintf(raenv->f, "  cf_edge %ld %ld\n", get_irn_node_nr(pred), get_irn_node_nr(blk));
492         }
493 }
494
495
496 /**
497  * Dump all information needed by the external
498  * register allocator to a single file.
499  */
500 static void dump_to_file(be_raext_env_t *raenv, char *filename) {
501         FILE *f;
502
503         if (!(f = fopen(filename, "wt"))) {
504                 fprintf(stderr, "Could not open file %s for writing\n", filename);
505                 exit(0xdeadbeef);
506         }
507         raenv->f = f;
508
509         fprintf(f, "regs %d\n", arch_register_class_n_regs(raenv->cls));
510         fprintf(f, "cfg %s {\n", filename);
511
512         irg_block_walk_graph(raenv->irg, NULL, dump_blocks, raenv);
513         irg_block_walk_graph(raenv->irg, NULL, dump_edges, raenv);
514
515         fprintf(f, "}\n");
516
517         fclose(f);
518 }
519
520
521 /******************************************************************************
522     ______                     _
523    |  ____|                   | |
524    | |__  __  _____  ___ _   _| |_ ___
525    |  __| \ \/ / _ \/ __| | | | __/ _ \
526    | |____ >  <  __/ (__| |_| | ||  __/
527    |______/_/\_\___|\___|\__,_|\__\___|
528  *****************************************************************************/
529
530 /**
531  * Execute the external register allocator specified in the
532  * firm-option firm.be.ra.ext.callee
533  */
534 static void execute(char *out_file, char *result_file) {
535         char cmd_line[1024];
536         int ret_status;
537
538         snprintf(cmd_line, sizeof(cmd_line), "%s %s %s", callee, out_file, result_file);
539
540         ret_status = system(cmd_line);
541         assert(ret_status != -1 && "Invokation of external register allocator failed");
542 }
543
544 /******************************************************************************
545                          _         _____                 _ _
546        /\               | |       |  __ \               | | |
547       /  \   _ __  _ __ | |_   _  | |__) |___  ___ _   _| | |_
548      / /\ \ | '_ \| '_ \| | | | | |  _  // _ \/ __| | | | | __|
549     / ____ \| |_) | |_) | | |_| | | | \ \  __/\__ \ |_| | | |_
550    /_/    \_\ .__/| .__/|_|\__, | |_|  \_\___||___/\__,_|_|\__|
551             | |   | |       __/ |
552             |_|   |_|      |___/
553  *****************************************************************************/
554
555 #define pset_foreach(pset, irn)  for(irn=pset_first(pset); irn; irn=pset_next(pset))
556
557 #define INVALID_FILE_FORMAT assert(0 && "Invalid file format.")
558
559 static INLINE int get_location(const char *s, size_t len) {
560         if (!strncmp(s, "before", len))
561                 return 1;
562         if (!strncmp(s, "after", len))
563                 return 0;
564         INVALID_FILE_FORMAT;
565         return -1;
566 }
567
568 /**
569  * Read in the actions performed by the external allocator.
570  * Apply these transformations to the irg.
571  */
572 static void read_and_apply_results(be_raext_env_t *raenv, char *filename) {
573         FILE *f;
574         pmap_entry *pme;
575
576         if (!(f = fopen(filename, "rt"))) {
577                 fprintf(stderr, "Could not open file %s for reading\n", filename);
578                 exit(0xdeadbeef);
579         }
580         raenv->f = f;
581
582         /* parse the file */
583         while (!feof(f)) {
584                 int loc, var_use, var_def, reg_nr;
585                 char where[16];
586
587                 /* assign register */
588                 if (fscanf(f, " assign %d %d ", &var_use, &reg_nr) == 2) {
589                         pset *vals = pmap_get_sth(raenv->vars, var_use);
590                         ir_node *irn;
591
592                         assert(vals && "Variable does not (yet?) exist!");
593                         pset_foreach(vals, irn)
594                                 arch_set_irn_register(raenv->aenv, irn, arch_register_for_index(raenv->cls, var_use));
595                 }
596
597                 /* handle a reload */
598                 else if (fscanf(f, " reload %s %d %d %d ", &where, &loc, &var_def, &var_use) == 4) {
599                         int before = get_location(where, sizeof(where));
600                         /* TODO */
601                 }
602
603                 /* handle a spill */
604                 else if (fscanf(f, " spill %6s %d %d ", &where, &loc, &var_use) == 3) {
605                         int before = get_location(where, sizeof(where));
606                         /* TODO */
607                 }
608
609                 else
610                         INVALID_FILE_FORMAT;
611         }
612
613         fclose(f);
614
615         /* Free the psets holding the variable-equivalence classes */
616         pmap_foreach(raenv->vars, pme)
617                 del_pset(pme->value);
618 }
619
620 /******************************************************************************
621     __  __       _
622    |  \/  |     (_)
623    | \  / | __ _ _ _ __
624    | |\/| |/ _` | | '_ \
625    | |  | | (_| | | | | |
626    |_|  |_|\__,_|_|_| |_|
627  *****************************************************************************/
628
629 /**
630  * Allocate registers with an external program using a text-file interface.
631  *
632  * Do some computations (SSA-destruction and mapping of values--vars)
633  * Write file
634  * Execute external program
635  * Read in results and apply them
636  *
637  */
638 static void be_ra_extern_main(const be_main_env_t *env, ir_graph *irg) {
639         be_raext_env_t raenv;
640         int clsnr, clss;
641
642         raenv.irg = irg;
643         raenv.aenv = env->arch_env;
644         raenv.vars = pmap_create();
645         raenv.blocks = pmap_create();
646
647         /* SSA destruction */
648         ssa_destr(&raenv);
649
650         be_clear_links(irg);
651         phi_class_compute(irg);
652         irg_walk_graph(irg, values_to_vars, NULL, &raenv);
653
654         dump_ir_block_graph_sched(irg, "-extern-ssadestr");
655
656         /* For all register classes */
657         for(clsnr = 0, clss = arch_isa_get_n_reg_class(raenv.aenv->isa); clsnr < clss; ++clsnr) {
658                 char out[256], in[256];
659
660                 raenv.cls = arch_isa_get_reg_class(raenv.aenv->isa, clsnr);
661                 ir_snprintf(out, sizeof(out), "%F-%s.ra", irg, raenv.cls->name);
662                 ir_snprintf(in, sizeof(in), "%F-%s.ra.res", irg, raenv.cls->name);
663
664                 dump_to_file(&raenv, out);
665
666                 execute(out, in);
667
668                 read_and_apply_results(&raenv, in);
669         }
670
671         /* Clean up */
672         pmap_destroy(raenv.blocks);
673         pmap_destroy(raenv.vars);
674 }