Commit 2cbdc12a authored by Matthias Braun's avatar Matthias Braun
Browse files

- Fixed bugs in schedule verifier

- Fixed bug in memperm scheduling
parent d1a3dc4e
...@@ -474,7 +474,6 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader) ...@@ -474,7 +474,6 @@ static ir_node *do_remat(spill_env_t *env, ir_node *spilled, ir_node *reloader)
copy_node_attr(spilled, res); copy_node_attr(spilled, res);
DBG((env->dbg, LEVEL_1, "Insert remat %+F before reloader %+F\n", res, reloader)); DBG((env->dbg, LEVEL_1, "Insert remat %+F before reloader %+F\n", res, reloader));
ir_printf("Insert remat %+F for %+F before reloader %+F(%s)\n", res, spilled, reloader, get_irg_dump_name(get_irn_irg(reloader)));
/* insert in schedule */ /* insert in schedule */
assert(!is_Block(reloader)); assert(!is_Block(reloader));
......
...@@ -678,7 +678,7 @@ static void create_memperms(ss_env_t *env) { ...@@ -678,7 +678,7 @@ static void create_memperms(ss_env_t *env) {
// insert node into schedule // insert node into schedule
blockend = get_end_of_block_insertion_point(memperm->block); blockend = get_end_of_block_insertion_point(memperm->block);
sched_add_after(blockend, mempermnode); sched_add_before(blockend, mempermnode);
for(entry = memperm->entries, i = 0; entry != NULL; entry = entry->next, ++i) { for(entry = memperm->entries, i = 0; entry != NULL; entry = entry->next, ++i) {
ir_node *proj; ir_node *proj;
...@@ -688,7 +688,7 @@ static void create_memperms(ss_env_t *env) { ...@@ -688,7 +688,7 @@ static void create_memperms(ss_env_t *env) {
be_set_MemPerm_out_entity(mempermnode, i, entry->out); be_set_MemPerm_out_entity(mempermnode, i, entry->out);
set_irg_current_block(env->chordal_env->irg, memperm->block); set_irg_current_block(env->chordal_env->irg, memperm->block);
proj = new_Proj(mempermnode, get_irn_mode(arg), i); proj = new_Proj(mempermnode, get_irn_mode(arg), i);
sched_add_after(blockend, proj); sched_add_before(blockend, proj);
set_irn_n(entry->node, entry->pos, proj); set_irn_n(entry->node, entry->pos, proj);
} }
......
...@@ -191,15 +191,29 @@ static void verify_schedule_walker(ir_node *block, void *data) ...@@ -191,15 +191,29 @@ static void verify_schedule_walker(ir_node *block, void *data)
} }
static int should_be_scheduled(ir_node *node) { static int should_be_scheduled(ir_node *node) {
if(is_Block(node))
return -1;
if(get_irn_mode(node) == mode_M) { if(get_irn_mode(node) == mode_M) {
if(is_Phi(node) || is_Proj(node) || is_Sync(node)) if(is_Proj(node))
return -1;
if(is_Phi(node) || is_Sync(node) || get_irn_opcode(node) == iro_Pin)
return 0; return 0;
} }
if(is_Proj(node) && get_irn_mode(node) == mode_X) if(is_Proj(node) && get_irn_mode(node) == mode_X)
return 0; return 0;
if(get_irn_opcode(node) == iro_End || get_irn_opcode(node) == iro_NoMem) if(be_is_Keep(node) && get_irn_opcode(get_nodes_block(node)) == iro_Bad)
return 0; return 0;
switch(get_irn_opcode(node)) {
case iro_End:
case iro_NoMem:
case iro_Bad:
return 0;
default:
break;
}
return 1; return 1;
} }
...@@ -207,14 +221,13 @@ static void check_schedule(ir_node *node, void *data) { ...@@ -207,14 +221,13 @@ static void check_schedule(ir_node *node, void *data) {
be_verify_schedule_env_t *env = data; be_verify_schedule_env_t *env = data;
int should_be; int should_be;
if(is_Block(node))
return;
should_be = should_be_scheduled(node); should_be = should_be_scheduled(node);
if(should_be == -1)
return;
if(should_be ? !sched_is_scheduled(node) : sched_is_scheduled(node)) { if(should_be ? !sched_is_scheduled(node) : sched_is_scheduled(node)) {
ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) should%s be scheduled\n", ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) should%s be scheduled\n",
node, get_nodes_block(node), get_irg_dump_name(env->irg), should_be ? "" : "not "); node, get_nodes_block(node), get_irg_dump_name(env->irg), should_be ? "" : " not");
env->problem_found = 1; env->problem_found = 1;
} }
} }
......
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