Commit 64a5a685 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

ia32: Remove the block schedule from struct ia32_irg_data_t.

parent 60b26bf3
......@@ -10,7 +10,6 @@
*/
#include "bearch_ia32_t.h"
#include "beblocksched.h"
#include "beflags.h"
#include "begnuas.h"
#include "be.h"
......@@ -1115,7 +1114,6 @@ static void ia32_emit(ir_graph *irg)
* virtual with real x87 instructions, creating a block schedule and
* peephole optimizations.
*/
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
be_stack_layout_t *stack_layout = be_get_irg_stack_layout(irg);
bool at_begin = stack_layout->sp_relative;
be_fec_env_t *fec_env = be_new_frame_entity_coalescer(irg);
......@@ -1139,6 +1137,7 @@ static void ia32_emit(ir_graph *irg)
be_dump(DUMP_RA, irg, "2addr");
/* we might have to rewrite x87 virtual registers */
ia32_irg_data_t const *const irg_data = ia32_get_irg_data(irg);
if (irg_data->do_x87_sim) {
ia32_x87_simulate_graph(irg);
be_dump(DUMP_RA, irg, "x87");
......@@ -1149,16 +1148,7 @@ static void ia32_emit(ir_graph *irg)
be_remove_dead_nodes_from_schedule(irg);
/* create block schedule, this also removes empty blocks which might
* produce critical edges */
irg_data->blk_sched = be_create_block_schedule(irg);
/* emit the code */
if (ia32_cg_config.emit_machcode) {
ia32_emit_function_binary(irg);
} else {
ia32_emit_function(irg);
}
ia32_emit_function(irg);
}
/**
......
......@@ -28,7 +28,6 @@ typedef struct ia32_isa_t ia32_isa_t;
typedef struct ia32_intrinsic_env_t ia32_intrinsic_env_t;
typedef struct ia32_irg_data_t {
ir_node **blk_sched; /**< an array containing the scheduled blocks */
unsigned do_x87_sim:1; /**< set to 1 if x87 simulation should be enforced */
ir_node *noreg_gp; /**< unique NoReg_GP node */
ir_node *noreg_fp; /**< unique NoReg_FP node */
......
......@@ -29,6 +29,7 @@
#include <limits.h>
#include <inttypes.h>
#include "beblocksched.h"
#include "util.h"
#include "xmalloc.h"
#include "tv.h"
......@@ -1467,13 +1468,11 @@ static parameter_dbg_info_t *construct_parameter_infos(ir_graph *irg)
/**
* Main driver. Emits the code for one routine.
*/
void ia32_emit_function(ir_graph *irg)
static void ia32_emit_function_text(ir_graph *const irg, ir_node **const blk_sched)
{
ir_entity *entity = get_irg_entity(irg);
exc_entry *exc_list = NEW_ARR_F(exc_entry, 0);
const arch_env_t *arch_env = be_get_irg_arch_env(irg);
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
ir_node **blk_sched = irg_data->blk_sched;
be_stack_layout_t *layout = be_get_irg_stack_layout(irg);
isa = (ia32_isa_t*) arch_env;
......@@ -3057,12 +3056,10 @@ static void gen_binary_block(ir_node *block)
}
}
void ia32_emit_function_binary(ir_graph *irg)
static void ia32_emit_function_binary(ir_graph *const irg, ir_node **const blk_sched)
{
ir_entity *entity = get_irg_entity(irg);
const arch_env_t *arch_env = be_get_irg_arch_env(irg);
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
ir_node **blk_sched = irg_data->blk_sched;
isa = (ia32_isa_t*) arch_env;
......@@ -3095,6 +3092,17 @@ void ia32_emit_function_binary(ir_graph *irg)
ir_free_resources(irg, IR_RESOURCE_IRN_LINK);
}
void ia32_emit_function(ir_graph *const irg)
{
ir_node **const blk_sched = be_create_block_schedule(irg);
/* emit the code */
if (ia32_cg_config.emit_machcode) {
ia32_emit_function_binary(irg, blk_sched);
} else {
ia32_emit_function_text(irg, blk_sched);
}
}
void ia32_init_emitter(void)
{
......
......@@ -51,7 +51,6 @@
void ia32_emitf(ir_node const *node, char const *fmt, ...);
void ia32_emit_function(ir_graph *irg);
void ia32_emit_function_binary(ir_graph *irg);
/** Initializes the Emitter. */
void ia32_init_emitter(void);
......
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