summaryrefslogtreecommitdiffhomepage
path: root/ir/be/TEMPLATE
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-27 21:52:04 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-28 10:36:31 +0200
commit9a6b8525e9916f0b0448468defd150413814ecfe (patch)
tree8560176b7b598b84c47f88efd0f6dbaff2cb5679 /ir/be/TEMPLATE
parent6a3abbe420b99019efd3e8a51bfce4e3cf713d5b (diff)
be: Add and use be_new_Proj().
It is like new_r_Proj(), but the mode is determined automatically from the out requirement of the predecessor. This probably resolves some mode mismatches in untested code paths -- AMD64 backend and SPARC hard float, I'm looking at you!
Diffstat (limited to 'ir/be/TEMPLATE')
-rw-r--r--ir/be/TEMPLATE/TEMPLATE_transform.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/ir/be/TEMPLATE/TEMPLATE_transform.c b/ir/be/TEMPLATE/TEMPLATE_transform.c
index 9d7a4ff..79851c6 100644
--- a/ir/be/TEMPLATE/TEMPLATE_transform.c
+++ b/ir/be/TEMPLATE/TEMPLATE_transform.c
@@ -33,8 +33,6 @@ DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
typedef ir_node* (*new_binop_func)(dbg_info *dbgi, ir_node *block,
ir_node *left, ir_node *right);
-static ir_mode *gp_regs_mode;
-
/**
* returns true if mode should be stored in a general purpose register
*/
@@ -291,7 +289,7 @@ static ir_node *gen_Proj_Proj(ir_node *node)
pn_TEMPLATE_Start_arg2, pn_TEMPLATE_Start_arg3
};
assert(arg_num < ARRAY_SIZE(pns));
- return new_r_Proj(new_start, gp_regs_mode, pns[arg_num]);
+ return be_new_Proj(new_start, pns[arg_num]);
}
}
panic("No transformer for %+F -> %+F -> %+F", node, pred, pred_pred);
@@ -303,9 +301,9 @@ static ir_node *gen_Proj_Load(ir_node *node)
ir_node *new_load = be_transform_node(load);
switch ((pn_Load)get_Proj_num(node)) {
case pn_Load_M:
- return new_r_Proj(new_load, mode_M, pn_TEMPLATE_Load_M);
+ return be_new_Proj(new_load, pn_TEMPLATE_Load_M);
case pn_Load_res:
- return new_r_Proj(new_load, gp_regs_mode, pn_TEMPLATE_Load_res);
+ return be_new_Proj(new_load, pn_TEMPLATE_Load_res);
case pn_Load_X_regular:
case pn_Load_X_except:
panic("exception handling not supported yet");
@@ -329,18 +327,17 @@ static ir_node *gen_Proj_Store(ir_node *node)
static ir_node *gen_Proj_Start(ir_node *node)
{
- dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *start = get_Proj_pred(node);
ir_node *new_start = be_transform_node(start);
unsigned pn = get_Proj_num(node);
switch ((pn_Start)pn) {
case pn_Start_M:
- return new_rd_Proj(dbgi, new_start, mode_M, pn_TEMPLATE_Start_M);
+ return be_new_Proj(new_start, pn_TEMPLATE_Start_M);
case pn_Start_T_args:
return new_r_Bad(get_irn_irg(node), mode_T);
case pn_Start_P_frame_base:
- return new_rd_Proj(dbgi, new_start, gp_regs_mode, pn_TEMPLATE_Start_stack);
+ return be_new_Proj(new_start, pn_TEMPLATE_Start_stack);
}
panic("unexpected Start proj %u", pn);
}
@@ -400,8 +397,6 @@ void TEMPLATE_transform_graph(ir_graph *irg)
assure_irg_properties(irg, IR_GRAPH_PROPERTY_NO_TUPLES
| IR_GRAPH_PROPERTY_NO_BADS);
- gp_regs_mode = TEMPLATE_reg_classes[CLASS_TEMPLATE_gp].mode;
-
TEMPLATE_register_transformers();
setup_calling_convention(irg);