*
* Implementation of the RA-Interface for an external, (non-SSA) register allocator.
*
- * The external register allocator is a program taking 2 arguments:
- * 1) An input file in which the cfg is defined
- * 2) An output file containing the essential actions performed during allocation
+ * The external register allocator is a program:
+ * PROG -i INPUTFILE -o OUTPUTFILE
+ *
+ * 1) Input file defines the interference graph
+ * 2) Output file contains the instructions to perform
*
set_irn_n(irn, pos, cpy);
/* set an out constraint for the copy */
- arch_set_register_req(raenv->aenv, -1, &req);
+ be_set_constr_limited(cpy, -1, &req);
}
}
}
arch_get_register_req(raenv->aenv, &req, irn, pos);
if (arch_register_req_is(&req, should_be_same)) {
- vi2 = get_var_info(req.other);
+ vi2 = get_var_info(req.other_same);
fprintf(raenv->f, "(%d, %d)\n", vi1->var_nr, vi2->var_nr);
}
char cmd_line[1024];
int ret_status;
- snprintf(cmd_line, sizeof(cmd_line), "%s %s %s", prog_to_call, out_file, result_file);
+ snprintf(cmd_line, sizeof(cmd_line), "%s -i %s -o %s", prog_to_call, out_file, result_file);
ret_status = system(cmd_line);
assert(ret_status != -1 && "Invokation of external register allocator failed");
}
/* correct the reload->spill pointers... */
- be_introduce_copies_for_set(raenv->dom_info, spills, reloads);
+ be_ssa_constr_sets(raenv->dom_info, spills, reloads);
/****** correct the variable <--> values mapping: ******
* Read in results and apply them
*
*/
-static void be_ra_extern_main(const be_main_env_t *env, ir_graph *irg) {
+static void be_ra_extern_main(const be_irg_t *bi) {
+ be_main_env_t *env = bi->main_env;
+ ir_graph *irg = bi->irg;
+
be_raext_env_t raenv;
int clsnr, clss;
var_info_t *vi;
#ifdef WITH_LIBCORE
+
static const lc_opt_enum_const_ptr_items_t ssa_destr_items[] = {
- { "simple", ssa_destr_simple },
- { "rastello", ssa_destr_rastello },
+ { "simple", (void*)ssa_destr_simple }, /* TODO make (void*) casts nicer */
+ { "rastello", (void*)ssa_destr_rastello },
{ NULL, NULL }
};