Commit e8bdf4f6 authored by Christian Würdig's avatar Christian Würdig
Browse files

fixed gen_Load (add Proj for unused volatile Loads before renumbering)

parent d5e0ce71
...@@ -1427,6 +1427,16 @@ static ir_node *gen_Load(ia32_transform_env_t *env) { ...@@ -1427,6 +1427,16 @@ static ir_node *gen_Load(ia32_transform_env_t *env) {
ia32_collect_Projs(env->irn, projs, pn_Load_max); ia32_collect_Projs(env->irn, projs, pn_Load_max);
/*
check for special case: the loaded value might not be used (optimized, volatile, ...)
we add a Proj + Keep for volatile loads and ignore all other cases
*/
if (! get_proj_for_pn(node, pn_Load_res) && get_Load_volatility(node) == volatility_is_volatile) {
/* add a result proj and a Keep to produce a pseudo use */
ir_node *proj = new_r_Proj(env->irg, env->block, new_op, mode, pn_ia32_Load_res);
be_new_Keep(arch_get_irn_reg_class(env->cg->arch_env, proj, -1), env->irg, env->block, 1, &proj);
}
/* address might be a constant (symconst or absolute address) */ /* address might be a constant (symconst or absolute address) */
if (is_ia32_Const(ptr)) { if (is_ia32_Const(ptr)) {
lptr = noreg; lptr = noreg;
...@@ -1469,16 +1479,6 @@ static ir_node *gen_Load(ia32_transform_env_t *env) { ...@@ -1469,16 +1479,6 @@ static ir_node *gen_Load(ia32_transform_env_t *env) {
set_ia32_am_flavour(new_op, am_flav); set_ia32_am_flavour(new_op, am_flav);
set_ia32_ls_mode(new_op, mode); set_ia32_ls_mode(new_op, mode);
/*
check for special case: the loaded value might not be used (optimized, volatile, ...)
we add a Proj + Keep for volatile loads and ignore all other cases
*/
if (! get_proj_for_pn(node, pn_Load_res) && get_Load_volatility(node) == volatility_is_volatile) {
/* add a result proj and a Keep to produce a pseudo use */
ir_node *proj = new_r_Proj(env->irg, env->block, new_op, mode, pn_ia32_Load_res);
be_new_Keep(arch_get_irn_reg_class(env->cg->arch_env, proj, -1), env->irg, env->block, 1, &proj);
}
SET_IA32_ORIG_NODE(new_op, ia32_get_old_node_name(env->cg, env->irn)); SET_IA32_ORIG_NODE(new_op, ia32_get_old_node_name(env->cg, env->irn));
return new_op; return new_op;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment