projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- CondEval now really can handle Confirms
[libfirm]
/
ir
/
opt
/
ldstopt.c
diff --git
a/ir/opt/ldstopt.c
b/ir/opt/ldstopt.c
index
07df1e9
..
dcfc739
100644
(file)
--- a/
ir/opt/ldstopt.c
+++ b/
ir/opt/ldstopt.c
@@
-446,8
+446,8
@@
static unsigned is_Call_pure(ir_node *call) {
/* try the called entity */
ir_node *ptr = get_Call_ptr(call);
/* try the called entity */
ir_node *ptr = get_Call_ptr(call);
- if (is_
SymConst_addr_ent
(ptr)) {
- ir_entity *ent = get_
SymConst
_entity(ptr);
+ if (is_
Global
(ptr)) {
+ ir_entity *ent = get_
Global
_entity(ptr);
prop = get_entity_additional_properties(ent);
}
prop = get_entity_additional_properties(ent);
}
@@
-586,7
+586,7
@@
static unsigned follow_Mem_chain(ir_node *load, ir_node *curr) {
get_irn_mode(get_Store_value(pred)),
ptr, load_mode);
/* if the might be an alias, we cannot pass this Store */
get_irn_mode(get_Store_value(pred)),
ptr, load_mode);
/* if the might be an alias, we cannot pass this Store */
- if (rel != no_alias)
+ if (rel !=
ir_
no_alias)
break;
pred = skip_Proj(get_Store_mem(pred));
} else if (is_Load(pred)) {
break;
pred = skip_Proj(get_Store_mem(pred));
} else if (is_Load(pred)) {
@@
-887,7
+887,7
@@
static unsigned follow_Mem_chain_for_Store(ir_node *store, ir_node *curr) {
get_nodes_MacroBlock(pred) == mblk &&
is_completely_overwritten(get_irn_mode(get_Store_value(pred)), mode)) {
/*
get_nodes_MacroBlock(pred) == mblk &&
is_completely_overwritten(get_irn_mode(get_Store_value(pred)), mode)) {
/*
- * a Store after a Store in the same
b
lock -- a write after write.
+ * a Store after a Store in the same
MacroB
lock -- a write after write.
* We may remove the first Store, if it does not have an exception handler.
*
* TODO: What, if both have the same exception handler ???
* We may remove the first Store, if it does not have an exception handler.
*
* TODO: What, if both have the same exception handler ???
@@
-902,8
+902,10
@@
static unsigned follow_Mem_chain_for_Store(ir_node *store, ir_node *curr) {
} else if (is_Load(pred) && get_Load_ptr(pred) == ptr &&
value == pred_info->projs[pn_Load_res]) {
/*
} else if (is_Load(pred) && get_Load_ptr(pred) == ptr &&
value == pred_info->projs[pn_Load_res]) {
/*
- * a Store of a value after a Load -- a write after read.
- * We may remove the second Store, if it does not have an exception handler.
+ * a Store of a value just loaded from the same address
+ * -- a write after read.
+ * We may remove the Store, if it does not have an exception
+ * handler.
*/
if (! info->projs[pn_Store_X_except]) {
DBG_OPT_WAR(store, pred);
*/
if (! info->projs[pn_Store_X_except]) {
DBG_OPT_WAR(store, pred);
@@
-922,10
+924,16
@@
static unsigned follow_Mem_chain_for_Store(ir_node *store, ir_node *curr) {
get_irn_mode(get_Store_value(pred)),
ptr, mode);
/* if the might be an alias, we cannot pass this Store */
get_irn_mode(get_Store_value(pred)),
ptr, mode);
/* if the might be an alias, we cannot pass this Store */
- if (rel != no_alias)
+ if (rel !=
ir_
no_alias)
break;
pred = skip_Proj(get_Store_mem(pred));
} else if (get_irn_op(pred) == op_Load) {
break;
pred = skip_Proj(get_Store_mem(pred));
} else if (get_irn_op(pred) == op_Load) {
+ ir_alias_relation rel = get_alias_relation(
+ current_ir_graph, get_Load_ptr(pred), get_Load_mode(pred),
+ ptr, mode);
+ if (rel != ir_no_alias)
+ break;
+
pred = skip_Proj(get_Load_mem(pred));
} else {
/* follow only Load chains */
pred = skip_Proj(get_Load_mem(pred));
} else {
/* follow only Load chains */
@@
-973,6
+981,7
@@
static unsigned optimize_store(ir_node *store) {
/* follow the memory chain as long as there are only Loads */
INC_MASTER();
/* follow the memory chain as long as there are only Loads */
INC_MASTER();
+
return follow_Mem_chain_for_Store(store, skip_Proj(mem));
} /* optimize_store */
return follow_Mem_chain_for_Store(store, skip_Proj(mem));
} /* optimize_store */
@@
-1351,10
+1360,10
@@
static void move_loads_out_of_loops(scc *pscc, loop_env *env) {
if (info->projs[pn_Load_res] == NULL || info->projs[pn_Load_X_regular] != NULL || info->projs[pn_Load_X_except] != NULL)
continue;
if (info->projs[pn_Load_res] == NULL || info->projs[pn_Load_X_regular] != NULL || info->projs[pn_Load_X_except] != NULL)
continue;
- /* for now, we can only handle Load(
SymConst
) */
- if (! is_
SymConst_addr_ent
(ptr))
+ /* for now, we can only handle Load(
Global
) */
+ if (! is_
Global
(ptr))
continue;
continue;
- ent = get_
SymConst
_entity(ptr);
+ ent = get_
Global
_entity(ptr);
load_mode = get_Load_mode(load);
for (other = pscc->head; other != NULL; other = next_other) {
node_entry *ne = get_irn_ne(other, env);
load_mode = get_Load_mode(load);
for (other = pscc->head; other != NULL; other = next_other) {
node_entry *ne = get_irn_ne(other, env);
@@
-1367,7
+1376,7
@@
static void move_loads_out_of_loops(scc *pscc, loop_env *env) {
get_irn_mode(get_Store_value(other)),
ptr, load_mode);
/* if the might be an alias, we cannot pass this Store */
get_irn_mode(get_Store_value(other)),
ptr, load_mode);
/* if the might be an alias, we cannot pass this Store */
- if (rel != no_alias)
+ if (rel !=
ir_
no_alias)
break;
}
/* only pure Calls are allowed here, so ignore them */
break;
}
/* only pure Calls are allowed here, so ignore them */