projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added lowering for lowered intrinsic operations
[libfirm]
/
ir
/
be
/
ia32
/
ia32_optimize.c
diff --git
a/ir/be/ia32/ia32_optimize.c
b/ir/be/ia32/ia32_optimize.c
index
baef41b
..
2198bc1
100644
(file)
--- a/
ir/be/ia32/ia32_optimize.c
+++ b/
ir/be/ia32/ia32_optimize.c
@@
-1,4
+1,4
@@
-/*
+/*
*
* Project: libFIRM
* File name: ir/be/ia32/ia32_optimize.c
* Purpose: Implements several optimizations for IA32
* Project: libFIRM
* File name: ir/be/ia32/ia32_optimize.c
* Purpose: Implements several optimizations for IA32
@@
-152,7
+152,7
@@
static entity *get_entity_for_tv(ia32_code_gen_t *cg, ir_node *cnst)
if (tp == firm_unknown_type)
tp = get_prim_type(cg->isa->types, mode);
if (tp == firm_unknown_type)
tp = get_prim_type(cg->isa->types, mode);
- res = new_entity(get_glob_type(), unique_id("
ia32FloatCnst_
%u"), tp);
+ res = new_entity(get_glob_type(), unique_id("
.LC
%u"), tp);
set_entity_ld_ident(res, get_entity_ident(res));
set_entity_visibility(res, visibility_local);
set_entity_ld_ident(res, get_entity_ident(res));
set_entity_visibility(res, visibility_local);
@@
-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 */
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;
}
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 */
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;
}
cand = is_cand ? (cand | IA32_AM_CAND_RIGHT) : cand;
@@
-1175,7
+1179,7
@@
static ir_node *fold_addr(ia32_code_gen_t *cg, ir_node *irn, ir_node *noreg) {
am_flav = ia32_am_N;
/* determine new am flavour */
am_flav = ia32_am_N;
/* determine new am flavour */
- if (offs || offs_cnst || offs_lea) {
+ if (offs || offs_cnst || offs_lea
|| have_am_sc
) {
am_flav |= ia32_O;
}
if (! be_is_NoReg(cg, base)) {
am_flav |= ia32_O;
}
if (! be_is_NoReg(cg, base)) {
@@
-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));
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) {
}
} /* 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 */
}
/* 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;
}
exchange_left_right(irn, &left, &right, 3, 2);
cand = orig_cand;
}