projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lower_dw: Shift lowering without intrinsics
[libfirm]
/
ir
/
be
/
beabihelper.c
diff --git
a/ir/be/beabihelper.c
b/ir/be/beabihelper.c
index
62d8591
..
0aec141
100644
(file)
--- a/
ir/be/beabihelper.c
+++ b/
ir/be/beabihelper.c
@@
-165,9
+165,9
@@
static void rsm_clear_regs(register_state_mapping_t *rsm,
* Add a register and its constraint flags to a register state map
* and return its index inside the map.
*/
* Add a register and its constraint flags to a register state map
* and return its index inside the map.
*/
-static
in
t rsm_add_reg(register_state_mapping_t *rsm,
- const arch_register_t *reg,
- arch_register_req_type_t flags)
+static
size_
t rsm_add_reg(register_state_mapping_t *rsm,
+
const arch_register_t *reg,
+
arch_register_req_type_t flags)
{
size_t input_idx = ARR_LEN(rsm->regs);
int cls_idx = reg->reg_class->index;
{
size_t input_idx = ARR_LEN(rsm->regs);
int cls_idx = reg->reg_class->index;
@@
-267,8
+267,6
@@
ir_node *be_prolog_create_start(beabi_helper_env_t *env, dbg_info *dbgi,
ir_node *start = be_new_Start(dbgi, block, n_start_outs);
int o;
ir_node *start = be_new_Start(dbgi, block, n_start_outs);
int o;
- arch_irn_add_flags(start, arch_irn_flags_prolog);
-
assert(env->prolog.value_map == NULL);
env->prolog.value_map = NEW_ARR_F(ir_node*, n_start_outs);
assert(env->prolog.value_map == NULL);
env->prolog.value_map = NEW_ARR_F(ir_node*, n_start_outs);
@@
-326,7
+324,7
@@
void be_epilog_begin(beabi_helper_env_t *env)
void be_epilog_add_reg(beabi_helper_env_t *env, const arch_register_t *reg,
arch_register_req_type_t flags, ir_node *value)
{
void be_epilog_add_reg(beabi_helper_env_t *env, const arch_register_t *reg,
arch_register_req_type_t flags, ir_node *value)
{
-
in
t index = rsm_add_reg(&env->epilog, reg, flags);
+
size_
t index = rsm_add_reg(&env->epilog, reg, flags);
rsm_set_value(&env->epilog, index, value);
}
rsm_set_value(&env->epilog, index, value);
}
@@
-366,7
+364,6
@@
ir_node *be_epilog_create_return(beabi_helper_env_t *env, dbg_info *dbgi,
ret = be_new_Return(dbgi, get_irn_irg(block), block, n_res, pop,
n_return_in, in);
ret = be_new_Return(dbgi, get_irn_irg(block), block, n_res, pop,
n_return_in, in);
- arch_irn_add_flags(ret, arch_irn_flags_epilog);
for (i = 0; i < n_return_in; ++i) {
const reg_flag_t *regflag = &env->epilog.regs[i];
const arch_register_t *reg = regflag->reg;
for (i = 0; i < n_return_in; ++i) {
const reg_flag_t *regflag = &env->epilog.regs[i];
const arch_register_t *reg = regflag->reg;
@@
-414,10
+411,6
@@
static ir_node *add_to_keep(ir_node *last_keep,
}
}
op = skip_Proj_const(node);
}
}
op = skip_Proj_const(node);
- if (arch_irn_get_flags(op) & arch_irn_flags_prolog)
- arch_irn_add_flags(last_keep, arch_irn_flags_prolog);
- if (arch_irn_get_flags(op) & arch_irn_flags_epilog)
- arch_irn_add_flags(last_keep, arch_irn_flags_epilog);
return last_keep;
}
return last_keep;
}
@@
-428,6
+421,7
@@
static void add_missing_keep_walker(ir_node *node, void *data)
const ir_edge_t *edge;
ir_mode *mode = get_irn_mode(node);
ir_node *last_keep;
const ir_edge_t *edge;
ir_mode *mode = get_irn_mode(node);
ir_node *last_keep;
+ ir_node **existing_projs;
(void) data;
if (mode != mode_T) {
if (!has_real_user(node)) {
(void) data;
if (mode != mode_T) {
if (!has_real_user(node)) {
@@
-448,6
+442,7
@@
static void add_missing_keep_walker(ir_node *node, void *data)
return;
rbitset_alloca(found_projs, n_outs);
return;
rbitset_alloca(found_projs, n_outs);
+ existing_projs = ALLOCANZ(ir_node*, n_outs);
foreach_out_edge(node, edge) {
ir_node *succ = get_edge_src_irn(edge);
ir_mode *mode = get_irn_mode(succ);
foreach_out_edge(node, edge) {
ir_node *succ = get_edge_src_irn(edge);
ir_mode *mode = get_irn_mode(succ);
@@
-458,10
+453,11
@@
static void add_missing_keep_walker(ir_node *node, void *data)
continue;
if (mode == mode_M || mode == mode_X)
continue;
continue;
if (mode == mode_M || mode == mode_X)
continue;
+ pn = get_Proj_proj(succ);
+ existing_projs[pn] = succ;
if (!has_real_user(succ))
continue;
if (!has_real_user(succ))
continue;
- pn = get_Proj_proj(succ);
assert(pn < n_outs);
rbitset_set(found_projs, pn);
}
assert(pn < n_outs);
rbitset_set(found_projs, pn);
}
@@
-483,7
+479,9
@@
static void add_missing_keep_walker(ir_node *node, void *data)
continue;
}
continue;
}
- value = new_r_Proj(node, arch_register_class_mode(cls), i);
+ value = existing_projs[i];
+ if (value == NULL)
+ value = new_r_Proj(node, arch_register_class_mode(cls), i);
last_keep = add_to_keep(last_keep, cls, value);
}
}
last_keep = add_to_keep(last_keep, cls, value);
}
}