From: Daniel Grund Date: Tue, 21 Mar 2006 16:05:23 +0000 (+0000) Subject: Removed arch_irn_is_ignore with generic macro X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=48bb3d05a2605481bf32b4fb20dbb41c4898e24e;p=libfirm Removed arch_irn_is_ignore with generic macro --- diff --git a/ir/be/bearch.h b/ir/be/bearch.h index da5a5a552..011b5cb62 100644 --- a/ir/be/bearch.h +++ b/ir/be/bearch.h @@ -384,13 +384,13 @@ extern arch_irn_class_t arch_irn_classify(const arch_env_t *env, const ir_node * */ extern arch_irn_flags_t arch_irn_get_flags(const arch_env_t *env, const ir_node *irn); -#define arch_irn_is_ignore(env, irn) ((arch_irn_get_flags(env, irn) & arch_irn_flags_ignore) != 0) +#define arch_irn_is(env, irn, flag) ((arch_irn_get_flags(env, irn) & arch_irn_flags_ ## flag) != 0) #define arch_irn_has_reg_class(env, irn, pos, cls) \ ((cls) == arch_get_irn_reg_class(env, irn, pos)) #define arch_irn_consider_in_reg_alloc(env, cls, irn) \ - (arch_irn_has_reg_class(env, irn, -1, cls) && !arch_irn_is_ignore(env, irn)) + (arch_irn_has_reg_class(env, irn, -1, cls) && !arch_irn_is(env, irn, ignore)) /** * Somebody who can be asked about IR nodes. diff --git a/ir/be/becopyopt.c b/ir/be/becopyopt.c index abbf85896..431743e2c 100644 --- a/ir/be/becopyopt.c +++ b/ir/be/becopyopt.c @@ -76,7 +76,7 @@ void free_copy_opt(copy_opt_t *co) { int co_is_optimizable_root(const copy_opt_t *co, ir_node *irn) { arch_register_req_t req; - if (arch_irn_is_ignore(co->aenv, irn)) + if (arch_irn_is(co->aenv, irn, ignore)) return 0; if (is_Reg_Phi(irn) || is_Perm_Proj(co->aenv, irn) || is_2addr_code(co->aenv, irn, &req)) @@ -90,7 +90,7 @@ int co_is_optimizable_arg(const copy_opt_t *co, ir_node *irn) { assert(0 && "Is buggy and obsolete. Do not use"); - if (arch_irn_is_ignore(co->aenv, irn)) + if (arch_irn_is(co->aenv, irn, ignore)) return 0; foreach_out_edge(irn, edge) { @@ -472,7 +472,7 @@ static void build_graph_walker(ir_node *irn, void *env) { int pos, max; arch_register_req_t req; - if (!is_curr_reg_class(co, irn) || arch_irn_is_ignore(co->aenv, irn)) + if (!is_curr_reg_class(co, irn) || arch_irn_is(co->aenv, irn, ignore)) return; /* Phis */ diff --git a/ir/be/belower.c b/ir/be/belower.c index db07734af..d4224ec5c 100644 --- a/ir/be/belower.c +++ b/ir/be/belower.c @@ -508,7 +508,7 @@ static void gen_assure_different_pattern(ir_node *irn, be_irg_t *birg, ir_node * firm_dbg_module_t *mod = firm_dbg_register("firm.be.lower"); const arch_register_class_t *cls = arch_get_irn_reg_class(arch_env, other_different, -1); - if (arch_irn_is_ignore(arch_env, other_different) || ! mode_is_datab(get_irn_mode(other_different))) { + if (arch_irn_is(arch_env, other_different, ignore) || ! mode_is_datab(get_irn_mode(other_different))) { DBG((mod, LEVEL_1, "ignore constraint for %+F because other_irn is ignore or not a datab node\n", irn)); return; } diff --git a/ir/be/bemain.c b/ir/be/bemain.c index d30146685..54aee99c1 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -332,7 +332,7 @@ static void be_main_loop(FILE *file_handle) void be_main(FILE *file_handle) { /* never build code for pseudo irgs */ - set_visit_pseudo_irgs(0); + set_visit_pseudo_irgs(0); be_node_init(); be_main_loop(file_handle); diff --git a/ir/be/beraextern.c b/ir/be/beraextern.c index cbd55d746..8a9d45ea9 100644 --- a/ir/be/beraextern.c +++ b/ir/be/beraextern.c @@ -345,7 +345,7 @@ static void ssa_destr_simple_walker(ir_node *blk, void *env) { if (!is_Phi(phi)) break; - if (arch_irn_is_ignore(raenv->aenv, phi)) + if (arch_irn_is(raenv->aenv, phi, ignore)) continue; raenv->cls = arch_get_irn_reg_class(raenv->aenv, phi, -1); @@ -536,7 +536,7 @@ static INLINE int get_spill_costs(be_raext_env_t *raenv, var_info_t *vi) { int c_spills=0, c_reloads=0; pset_foreach(vi->values, irn) { - if (arch_irn_is_ignore(raenv->aenv, irn) || be_is_Reload(irn)) { + if (arch_irn_is(raenv->aenv, irn, ignore) || be_is_Reload(irn)) { pset_break(vi->values); return UNSPILLABLE; } @@ -619,7 +619,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) { int pos, max; var_info_t *vi1, *vi2; - if (arch_get_irn_reg_class(raenv->aenv, irn, -1) != raenv->cls || arch_irn_is_ignore(raenv->aenv, irn)) + if (arch_get_irn_reg_class(raenv->aenv, irn, -1) != raenv->cls || arch_irn_is(raenv->aenv, irn, ignore)) return; vi1 = get_var_info(irn); @@ -628,7 +628,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) { if (arch_irn_classify(raenv->aenv, irn) == arch_irn_class_copy) { ir_node *other = get_irn_n(irn, be_pos_Copy_orig); - if (! arch_irn_is_ignore(raenv->aenv, other)) { + if (! arch_irn_is(raenv->aenv, other, ignore)) { vi2 = get_var_info(other); fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); @@ -640,7 +640,7 @@ static void dump_affinities_walker(ir_node *irn, void *env) { for (pos = 0, max = get_irn_arity(irn); posaenv, &req, irn, pos); - if (arch_register_req_is(&req, should_be_same) && arch_irn_is_ignore(raenv->aenv, req.other_same)) { + if (arch_register_req_is(&req, should_be_same) && arch_irn_is(raenv->aenv, req.other_same, ignore)) { vi2 = get_var_info(req.other_same); fprintf(raenv->f, "(%d, %d, %d)\n", vi1->var_nr, vi2->var_nr, get_affinity_weight(irn)); diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 08b9c6431..b54008a2d 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -614,17 +614,20 @@ static void remove_unused_reloads(ir_graph *irg, belady_env_t *bel) { ir_node *spill; DBG((dbg, DBG_SPILL, "Removing %+F before %+F in %+F\n", irn, sched_next(irn), get_nodes_block(irn))); - spill = get_irn_n(irn, be_pos_Reload_mem); + if (be_is_Reload(irn)) + spill = get_irn_n(irn, be_pos_Reload_mem); /* remove reload */ set_irn_n(irn, 0, new_Bad()); sched_remove(irn); - /* if spill not used anymore, remove it too - * test of regclass is necessary since spill may be a phi-M */ - if (get_irn_n_edges(spill) == 0 && bel->cls == arch_get_irn_reg_class(bel->arch, spill, -1)) { - set_irn_n(spill, 0, new_Bad()); - sched_remove(spill); + if (be_is_Reload(irn)) { + /* if spill not used anymore, remove it too + * test of regclass is necessary since spill may be a phi-M */ + if (get_irn_n_edges(spill) == 0 && bel->cls == arch_get_irn_reg_class(bel->arch, spill, -1)) { + set_irn_n(spill, 0, new_Bad()); + sched_remove(spill); + } } } }