X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_optimize.c;h=631f6e6c7b98f04481ab90be5120c08e321d11ae;hb=8694468860fe14808c20e9e246fe1368c097b322;hp=42aab8eac3148a3bedc609010ee21a93d89f90f8;hpb=399e9483347d0d5d1b5fddd0e91685174df3ad0a;p=libfirm diff --git a/ir/be/ia32/ia32_optimize.c b/ir/be/ia32/ia32_optimize.c index 42aab8eac..631f6e6c7 100644 --- a/ir/be/ia32/ia32_optimize.c +++ b/ir/be/ia32/ia32_optimize.c @@ -765,8 +765,10 @@ static ia32_am_cand_t is_am_candidate(heights_t *h, const ir_node *block, ir_nod other = right; /* If there is a data dependency of other irn from load: cannot use AM */ - if (get_nodes_block(other) == block) - is_cand = heights_reachable_in_block(h, get_Proj_pred(other), load) ? 0 : is_cand; + if (get_nodes_block(other) == block) { + other = skip_Proj(other); + is_cand = heights_reachable_in_block(h, other, load) ? 0 : is_cand; + } } cand = is_cand ? IA32_AM_CAND_LEFT : IA32_AM_CAND_NONE; @@ -781,8 +783,10 @@ static ia32_am_cand_t is_am_candidate(heights_t *h, const ir_node *block, ir_nod other = left; /* If there is a data dependency of other irn from load: cannot use load */ - if (get_nodes_block(other) == block) - is_cand = heights_reachable_in_block(h, get_Proj_pred(other), load) ? 0 : is_cand; + if (get_nodes_block(other) == block) { + other = skip_Proj(other); + is_cand = heights_reachable_in_block(h, other, load) ? 0 : is_cand; + } } cand = is_cand ? (cand | IA32_AM_CAND_RIGHT) : cand; @@ -1518,6 +1522,8 @@ static void optimize_am(ir_node *irn, void *env) { DBG_OPT_AM_D(load, store, irn); DB((mod, LEVEL_1, "merged with %+F and %+F into dest AM\n", load, store)); + + need_exchange_on_fail = 0; } } /* if (store) */ else if (get_ia32_am_support(irn) & ia32_am_Source) { @@ -1531,7 +1537,7 @@ static void optimize_am(ir_node *irn, void *env) { } /* was exchanged but optimize failed: exchange back */ - if (check_am_src && need_exchange_on_fail) { + if (need_exchange_on_fail) { exchange_left_right(irn, &left, &right, 3, 2); cand = orig_cand; }