Commit f08557a2 authored by Matthias Braun's avatar Matthias Braun
Browse files

ia32: Move check whether x87 sim is necessary to bearch_ia32

parent 2ffc9aec
......@@ -1138,7 +1138,9 @@ static void ia32_emit(ir_graph *irg)
be_dump(DUMP_RA, irg, "2addr");
/* we might have to rewrite x87 virtual registers */
x86_x87_simulate_graph(irg, &ia32_reg_classes[CLASS_ia32_fp]);
ia32_irg_data_t const *const irg_data = ia32_get_irg_data(irg);
if (irg_data->do_x87_sim)
x86_x87_simulate_graph(irg, &ia32_reg_classes[CLASS_ia32_fp]);
be_dump(DUMP_RA, irg, "x87");
/* do peephole optimizations */
......
......@@ -51,12 +51,6 @@ static bool is_x87_req(arch_register_req_t const *const req)
return req->cls == x87_regclass;
}
static bool requested_x87_sim(ir_graph const *const irg)
{
ia32_irg_data_t const *const irg_data = ia32_get_irg_data(irg);
return irg_data->do_x87_sim;
}
/** the debug handle */
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
......@@ -235,7 +229,6 @@ static unsigned is_at_pos(x87_state const *const state, ir_node const *const val
*/
static void x87_push(x87_state *const state, ir_node *const node)
{
assert(requested_x87_sim(get_irn_irg(node)));
assert(x87_on_stack(state, node) == (unsigned)-1 && "double push");
assert(state->depth < N_X87_REGS && "stack overrun");
......@@ -1505,10 +1498,6 @@ static void update_liveness_walker(ir_node *block, void *data)
*/
void x86_x87_simulate_graph(ir_graph *irg, const arch_register_class_t *cls)
{
#ifndef DEBUG_libfirm
if (!requested_x87_sim(irg))
return;
#endif
/* Must have N_X87_REGS registers and optionally an additional "NoReg" */
assert(cls->n_regs == N_X87_REGS ||
(cls->n_regs == N_X87_REGS+1 && cls->regs[N_X87_REGS].is_virtual));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment