From 884eb109498da4ec48fb64bd4a2d86f8d1001147 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 25 Nov 2012 12:14:53 +0100 Subject: [PATCH] beinsn: Do not store, whether insn operands are constrained. The only user of this information (bechordal) can just check the register requirement type. --- ir/be/bechordal_common.c | 11 ++++++----- ir/be/beinsn.c | 9 +++------ ir/be/beinsn_t.h | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ir/be/bechordal_common.c b/ir/be/bechordal_common.c index 8049f0576..914a228cb 100644 --- a/ir/be/bechordal_common.c +++ b/ir/be/bechordal_common.c @@ -238,11 +238,12 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn) for (int i = insn->use_start; i < insn->n_ops; ++i) { be_operand_t *op = &insn->ops[i]; ir_node *proj = op->carrier; - /* - * Note that the predecessor must not be a Proj of the Perm, - * since ignore-nodes are not Perm'ed. - */ - if (op->has_constraints && is_Proj(proj) && get_Proj_pred(proj) == perm) { + /* Note that the predecessor is not necessarily a Proj of the Perm, + * since ignore-nodes are not Perm'ed. */ + /* FIXME: Only setting the constraints, when the register requirement is + * limited, is a hack. It will break when multiple differently constrained + * inputs use the same value. */ + if (arch_register_req_is(op->req, limited) && is_Proj(proj) && get_Proj_pred(proj) == perm) { be_set_constr_out(perm, get_Proj_proj(proj), op->req); } } diff --git a/ir/be/beinsn.c b/ir/be/beinsn.c index 237017160..f82b4173b 100644 --- a/ir/be/beinsn.c +++ b/ir/be/beinsn.c @@ -63,10 +63,9 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn) o.irn = irn; o.pos = -(get_Proj_proj(p) + 1); o.partner = NULL; - o.has_constraints = arch_register_req_is(o.req, limited) | (o.req->width > 1); obstack_grow(obst, &o, sizeof(o)); insn->n_ops++; - insn->has_constraints |= o.has_constraints; + insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1); } } } else if (arch_irn_consider_in_reg_alloc(env->cls, irn)) { @@ -76,10 +75,9 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn) o.irn = irn; o.pos = -1; o.partner = NULL; - o.has_constraints = arch_register_req_is(o.req, limited) | (o.req->width > 1); obstack_grow(obst, &o, sizeof(o)); insn->n_ops++; - insn->has_constraints |= o.has_constraints; + insn->has_constraints |= arch_register_req_is(o.req, limited) | (o.req->width > 1); } insn->use_start = insn->n_ops; @@ -95,10 +93,9 @@ be_insn_t *be_scan_insn(be_chordal_env_t const *const env, ir_node *const irn) o.irn = irn; o.pos = i; o.partner = NULL; - o.has_constraints = arch_register_req_is(o.req, limited); obstack_grow(obst, &o, sizeof(o)); insn->n_ops++; - insn->has_constraints |= o.has_constraints; + insn->has_constraints |= arch_register_req_is(o.req, limited); } } diff --git a/ir/be/beinsn_t.h b/ir/be/beinsn_t.h index d4003f054..079c89706 100644 --- a/ir/be/beinsn_t.h +++ b/ir/be/beinsn_t.h @@ -42,7 +42,6 @@ struct be_operand_t { const bitset_t *regs; /**< admissible register bitset */ int pos; /**< pos of the operand (0 to n are inputs, -1 to -n are outputs) */ const arch_register_req_t *req; /**< register constraints for the carrier node */ - unsigned has_constraints : 1; /**< the carrier node has register constraints (the constraint type is limited) */ }; struct be_insn_t { -- 2.20.1