From: Christoph Mallon Date: Sat, 24 Nov 2012 17:37:38 +0000 (+0100) Subject: heur4: Avoid unnecessary bitset operations when the node is not limited. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7105209a991d24ef0be91898e7fb36386c3a9b9b;p=libfirm heur4: Avoid unnecessary bitset operations when the node is not limited. --- diff --git a/ir/be/becopyheur4.c b/ir/be/becopyheur4.c index 5e5015015..264be4def 100644 --- a/ir/be/becopyheur4.c +++ b/ir/be/becopyheur4.c @@ -173,13 +173,12 @@ static co_mst_irn_t *co_mst_irn_init(co_mst_env_t *env, const ir_node *irn) req = arch_get_irn_register_req(irn); if (arch_register_req_is(req, limited)) { rbitset_copy_to_bitset(req->limited, res->adm_colors); + /* exclude global ignore registers as well */ + bitset_and(res->adm_colors, env->allocatable_regs); } else { - bitset_set_all(res->adm_colors); + bitset_copy(res->adm_colors, env->allocatable_regs); } - /* exclude global ignore registers as well */ - bitset_and(res->adm_colors, env->allocatable_regs); - /* compute the constraint factor */ res->constr_factor = (real_t) (1 + env->n_regs - bitset_popcount(res->adm_colors)) / env->n_regs;