summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beprefalloc.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/beprefalloc.c
parent35093541d98be38944c77818bfa2663d590e0968 (diff)
be: Factorise code to create a register requirement.
Diffstat (limited to 'ir/be/beprefalloc.c')
-rw-r--r--ir/be/beprefalloc.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/ir/be/beprefalloc.c b/ir/be/beprefalloc.c
index e0fa7fd..31c600a 100644
--- a/ir/be/beprefalloc.c
+++ b/ir/be/beprefalloc.c
@@ -1437,13 +1437,6 @@ static void assign_phi_registers(ir_node *block)
}
}
-static arch_register_req_t *allocate_reg_req(ir_graph *irg)
-{
- struct obstack *obst = be_get_be_obst(irg);
- arch_register_req_t *req = OALLOCZ(obst, arch_register_req_t);
- return req;
-}
-
/**
* Walker: assign registers to all nodes of a block that
* need registers from the currently considered register class.
@@ -1514,12 +1507,8 @@ static void allocate_coalesce_block(ir_node *block, void *data)
if (need_phi) {
ir_mode *mode = get_irn_mode(node);
const arch_register_req_t *phi_req = cls->class_req;
- if (req->width > 1) {
- arch_register_req_t *new_req = allocate_reg_req(irg);
- new_req->cls = cls;
- new_req->width = req->width;
- phi_req = new_req;
- }
+ if (req->width > 1)
+ phi_req = be_create_cls_req(irg, cls, req->width);
ir_node *phi = be_new_Phi(block, n_preds, phi_ins, mode,
phi_req);