Commit 09eee9b1 authored by Matthias Braun's avatar Matthias Braun
Browse files

more robust detection of start nodes in listsched; add debug info to be_Start node constructor

[r26720]
parent a96b763e
......@@ -1971,7 +1971,7 @@ static void modify_irg(be_abi_irg_t *env)
pmap_insert(env->regs, (void *) sp, NULL);
pmap_insert(env->regs, (void *) arch_env->bp, NULL);
start_bl = get_irg_start_block(irg);
env->start = be_new_Start(start_bl, pmap_count(env->regs) + 1);
env->start = be_new_Start(NULL, start_bl, pmap_count(env->regs) + 1);
/*
* make proj nodes for the callee save registers.
......
......@@ -282,7 +282,8 @@ static void make_users_ready(block_sched_env_t *env, ir_node *irn)
/**
* Returns the number of not yet schedules users.
*/
static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n)
{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
......@@ -292,7 +293,8 @@ static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
/**
* Sets the number of not yet schedules users.
*/
static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
......@@ -302,7 +304,8 @@ static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, in
/**
* Add @p num to the number of not yet schedules users and returns the result.
*/
static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
......@@ -313,7 +316,8 @@ static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int
/**
* Returns the number of users of a node having mode datab.
*/
static int get_num_successors(ir_node *irn) {
static int get_num_successors(ir_node *irn)
{
int sum = 0;
const ir_edge_t *edge;
......@@ -345,7 +349,8 @@ static int get_num_successors(ir_node *irn) {
* Adds irn to @p live, updates all inputs that this user is scheduled
* and counts all of its non scheduled users.
*/
static void update_sched_liveness(block_sched_env_t *env, ir_node *irn) {
static void update_sched_liveness(block_sched_env_t *env, ir_node *irn)
{
int i;
/* ignore Projs */
......@@ -423,7 +428,6 @@ static void list_sched_block(ir_node *block, void *env_ptr)
{
sched_env_t *env = env_ptr;
const list_sched_selector_t *selector = env->selector;
ir_node *start_node = get_irg_start(get_irn_irg(block));
block_sched_env_t be;
const ir_edge_t *edge;
......@@ -478,12 +482,10 @@ static void list_sched_block(ir_node *block, void *env_ptr)
transfer data flow from the predecessors to this block.
*/
add_to_sched(&be, irn);
}
else if (irn == start_node) {
} else if (be_is_Start(irn)) {
/* The start block will be scheduled as the first node */
add_to_sched(&be, irn);
}
else {
} else {
/* Other nodes must have all operands in other blocks to be made
* ready */
int ready = 1;
......@@ -663,8 +665,9 @@ void list_sched_single_block(const be_irg_t *birg, ir_node *block,
/**
* Register list scheduler options.
*/
void be_init_listsched(void) {
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
void be_init_listsched(void)
{
lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched");
lc_opt_add_table(sched_grp, list_sched_option_table);
......
......@@ -713,13 +713,13 @@ ir_node *be_new_SubSP(const arch_register_t *sp, ir_node *bl, ir_node *old_sp, i
return irn;
}
ir_node *be_new_Start(ir_node *bl, int n_outs)
ir_node *be_new_Start(dbg_info *dbgi, ir_node *bl, int n_outs)
{
ir_node *res;
int i;
ir_graph *irg = get_Block_irg(bl);
res = new_ir_node(NULL, irg, bl, op_be_Start, mode_T, 0, NULL);
res = new_ir_node(dbgi, irg, bl, op_be_Start, mode_T, 0, NULL);
init_node_attr(res, 0, -1);
for (i = 0; i < n_outs; ++i) {
add_register_req_out(res);
......
......@@ -344,7 +344,7 @@ void be_Return_set_emit_pop(ir_node *ret, int emit_pop);
/** appends a node to the return node, returns the position of the node */
int be_Return_append_node(ir_node *ret, ir_node *node);
ir_node *be_new_Start(ir_node *block, int n_out);
ir_node *be_new_Start(dbg_info *dbgi, ir_node *block, int n_out);
ir_node *be_new_Barrier(ir_node *bl, int n, ir_node *in[]);
......
Supports Markdown
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