From ac4539bca5c39db469e9e54cfa81072ead93f5c1 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Fri, 14 Aug 2009 18:09:32 +0000 Subject: [PATCH] Skip projs before getting backend flags. [r26336] --- ir/be/bespill.c | 2 +- ir/be/bespillbelady.c | 4 ++-- ir/be/bespillutil.c | 14 +++++--------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/ir/be/bespill.c b/ir/be/bespill.c index f6d5ad24c..2d3436a2b 100644 --- a/ir/be/bespill.c +++ b/ir/be/bespill.c @@ -203,7 +203,7 @@ static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node) req = arch_get_register_req(node, i); if (req->cls != cls) continue; - if (! (req->type & arch_register_req_type_limited)) + if (!(req->type & arch_register_req_type_limited)) continue; in = get_irn_n(node, i); diff --git a/ir/be/bespillbelady.c b/ir/be/bespillbelady.c index 70a0ed99e..662f2c944 100644 --- a/ir/be/bespillbelady.c +++ b/ir/be/bespillbelady.c @@ -291,7 +291,7 @@ static inline unsigned get_distance(ir_node *from, unsigned from_step, return USES_INFINITY; /* We have to keep nonspillable nodes in the workingset */ - if (arch_irn_get_flags(def) & arch_irn_flags_dont_spill) + if (arch_irn_get_flags(skip_Proj_const(def)) & arch_irn_flags_dont_spill) return 0; /* give some bonus to rematerialisable nodes */ @@ -485,7 +485,7 @@ static loc_t to_take_or_not_to_take(ir_node* first, ir_node *node, } /* We have to keep nonspillable nodes in the workingset */ - if (arch_irn_get_flags(node) & arch_irn_flags_dont_spill) { + if (arch_irn_get_flags(skip_Proj_const(node)) & arch_irn_flags_dont_spill) { loc.time = 0; DB((dbg, DBG_START, " %+F taken (dontspill node)\n", node, loc.time)); return loc; diff --git a/ir/be/bespillutil.c b/ir/be/bespillutil.c index c63914ffe..ec3d07814 100644 --- a/ir/be/bespillutil.c +++ b/ir/be/bespillutil.c @@ -197,7 +197,7 @@ void be_add_spill(spill_env_t *env, ir_node *to_spill, ir_node *after) spill_t *s; spill_t *last; - assert(!arch_irn_is(to_spill, dont_spill)); + assert(!arch_irn_is(skip_Proj_const(to_spill), dont_spill)); DB((dbg, LEVEL_1, "Add spill of %+F after %+F\n", to_spill, after)); /* Just for safety make sure that we do not insert the spill in front of a phi */ @@ -263,7 +263,7 @@ void be_add_reload2(spill_env_t *env, ir_node *to_spill, ir_node *before, spill_info_t *info; reloader_t *rel; - assert(!arch_irn_is(to_spill, dont_spill)); + assert(!arch_irn_is(skip_Proj_const(to_spill), dont_spill)); info = get_spillinfo(env, to_spill); @@ -585,11 +585,7 @@ static int is_value_available(spill_env_t *env, const ir_node *arg, static int is_remat_node(const ir_node *node) { assert(!be_is_Spill(node)); - - if (arch_irn_is(node, rematerializable)) - return 1; - - return 0; + return arch_irn_is(skip_Proj_const(node), rematerializable); } /** @@ -624,7 +620,7 @@ static int check_remat_conditions_costs(spill_env_t *env, * (would be better to test wether the flags are actually live at point * reloader...) */ - if (arch_irn_is(spilled, modify_flags)) { + if (arch_irn_is(skip_Proj_const(spilled), modify_flags)) { return REMAT_COST_INFINITE; } @@ -783,7 +779,7 @@ static void determine_spill_costs(spill_env_t *env, spill_info_t *spillinfo) if(spillinfo->spill_costs >= 0) return; - assert(!arch_irn_is(to_spill, dont_spill)); + assert(!arch_irn_is(skip_Proj_const(to_spill), dont_spill)); assert(!be_is_Reload(to_spill)); /* some backends have virtual noreg/unknown nodes that are not scheduled -- 2.20.1