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;
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;
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) {
}
/* 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;
}