beinsn: Do not store, whether insn operands are constrained.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sun, 25 Nov 2012 11:14:53 +0000 (12:14 +0100)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sun, 25 Nov 2012 11:14:53 +0000 (12:14 +0100)
The only user of this information (bechordal) can just check the register requirement type.

ir/be/bechordal_common.c
ir/be/beinsn.c
ir/be/beinsn_t.h

index 8049f05..914a228 100644 (file)
@@ -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;
        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);
                }
        }
                        be_set_constr_out(perm, get_Proj_proj(proj), op->req);
                }
        }
index 2370171..f82b417 100644 (file)
@@ -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.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++;
                                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)) {
                        }
                }
        } 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.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++;
                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;
        }
 
        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.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++;
                        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);
                }
        }
 
                }
        }
 
index d4003f0..079c897 100644 (file)
@@ -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 */
        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 {
 };
 
 struct be_insn_t {