summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bechordal_common.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-11-25 15:44:07 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-11-25 17:20:25 +0100
commitb6aaf00ca3e0065b823ffc6672a625520da8eb10 (patch)
tree47a8472a6dc2d4494a19514bd1340c8978b99d1a /ir/be/bechordal_common.c
parent8056dd449bd30b35879d86e0a0a37a3bf0821c5b (diff)
beinsn: Do not store the register requirements in struct be_operand_t.
Diffstat (limited to 'ir/be/bechordal_common.c')
-rw-r--r--ir/be/bechordal_common.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/ir/be/bechordal_common.c b/ir/be/bechordal_common.c
index 2000a06..538adf2 100644
--- a/ir/be/bechordal_common.c
+++ b/ir/be/bechordal_common.c
@@ -214,7 +214,8 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
* Make the Perm, recompute liveness and re-scan the insn since the
* in operands are now the Projs of the Perm.
*/
- ir_node *const perm = insert_Perm_before(env->irg, env->cls, insn->irn);
+ ir_node *const irn = insn->irn;
+ ir_node *const perm = insert_Perm_before(env->irg, env->cls, irn);
/* Registers are propagated by insert_Perm_before(). Clean them here! */
if (perm == NULL)
@@ -228,23 +229,23 @@ ir_node *pre_process_constraints(be_chordal_env_t *env, be_insn_t **the_insn)
* the live sets may change.
*/
obstack_free(env->obst, insn);
- *the_insn = insn = be_scan_insn(env, insn->irn);
+ *the_insn = insn = be_scan_insn(env, irn);
- /*
- * Copy the input constraints of the insn to the Perm as output
- * constraints. Succeeding phases (coalescing) will need that.
- */
- for (int i = insn->use_start; i < insn->n_ops; ++i) {
- be_operand_t *op = &insn->ops[i];
- ir_node *proj = op->carrier;
+ /* Copy the input constraints of the irn to the Perm as output
+ * constraints. Succeeding phases (coalescing) will need that. */
+ for (int i = 0, n = get_irn_arity(irn); i != n; ++i) {
+ ir_node *const proj = get_irn_n(irn, i);
/* Note that the predecessor is not necessarily a Proj of the Perm,
* since ignore-nodes are not Perm'ed. */
+ if (!is_Proj(proj) || get_Proj_pred(proj) != perm)
+ continue;
/* 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);
- }
+ arch_register_req_t const *const req = arch_get_irn_register_req_in(irn, i);
+ if (!arch_register_req_is(req, limited))
+ continue;
+ be_set_constr_out(perm, get_Proj_proj(proj), req);
}
return perm;