summaryrefslogtreecommitdiffhomepage
path: root/ir/be/benode.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-03-20 06:21:52 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2016-03-21 14:10:55 +0100
commit2da93aea64c0cd68c5e12dc6f9a9cf24f643f2eb (patch)
tree067ce66e8680f00b0c282d25197f7a53ee019897 /ir/be/benode.c
parent35093541d98be38944c77818bfa2663d590e0968 (diff)
be: Factorise code to create a register requirement.
Diffstat (limited to 'ir/be/benode.c')
-rw-r--r--ir/be/benode.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/ir/be/benode.c b/ir/be/benode.c
index 96fc128..3943a52 100644
--- a/ir/be/benode.c
+++ b/ir/be/benode.c
@@ -105,13 +105,6 @@ arch_register_req_t const **be_allocate_in_reqs(ir_graph *const irg, unsigned co
return OALLOCN(obst, arch_register_req_t const*, n);
}
-static arch_register_req_t *allocate_reg_req(ir_graph *const irg)
-{
- struct obstack *obst = be_get_be_obst(irg);
- arch_register_req_t *req = OALLOCZ(obst, arch_register_req_t);
- return req;
-}
-
static void be_node_set_register_req_in(ir_node *const node, int const pos,
arch_register_req_t const *const req)
{
@@ -162,9 +155,7 @@ ir_node *be_new_Perm(arch_register_class_t const *const cls,
be_node_set_register_req_in(irn, i, cls->class_req);
arch_set_irn_register_req_out(irn, i, cls->class_req);
} else {
- arch_register_req_t *const new_req = allocate_reg_req(irg);
- new_req->cls = cls;
- new_req->width = req->width;
+ arch_register_req_t *const new_req = be_create_cls_req(irg, cls, req->width);
be_node_set_register_req_in(irn, i, new_req);
arch_set_irn_register_req_out(irn, i, new_req);
}
@@ -202,10 +193,8 @@ static void set_copy_info(ir_node *const irn, ir_graph *const irg, ir_node *cons
be_node_set_register_req_in(irn, 0, cls->class_req);
- arch_register_req_t *const out_req = allocate_reg_req(irg);
- out_req->cls = cls;
+ arch_register_req_t *const out_req = be_create_cls_req(irg, cls, op_req->width);
out_req->should_be_same = 1U << 0;
- out_req->width = op_req->width;
arch_set_irn_register_req_out(irn, 0, out_req);
}