projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ignore generated files.
[libfirm]
/
ir
/
opt
/
opt_osr.c
diff --git
a/ir/opt/opt_osr.c
b/ir/opt/opt_osr.c
index
8569b99
..
79cd9a3
100644
(file)
--- a/
ir/opt/opt_osr.c
+++ b/
ir/opt/opt_osr.c
@@
-23,7
+23,7
@@
* @date 12.5.2006
* @author Michael Beck
* @version $Id$
* @date 12.5.2006
* @author Michael Beck
* @version $Id$
- * @
summary
+ * @
brief
* Implementation of the Operator Strength Reduction algorithm
* by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick.
* Extended version.
* Implementation of the Operator Strength Reduction algorithm
* by Keith D. Cooper, L. Taylor Simpson, Christopher A. Vick.
* Extended version.
@@
-175,8
+175,7
@@
static node_entry *get_irn_ne(ir_node *irn, iv_env *env) {
node_entry *e = get_irn_link(irn);
if (e == NULL) {
node_entry *e = get_irn_link(irn);
if (e == NULL) {
- e = obstack_alloc(&env->obst, sizeof(*e));
- memset(e, 0, sizeof(*e));
+ e = OALLOCZ(&env->obst, node_entry);
set_irn_link(irn, e);
}
return e;
set_irn_link(irn, e);
}
return e;
@@
-480,8
+479,7
@@
static int replace(ir_node *irn, ir_node *iv, ir_node *rc, iv_env *env) {
exchange(irn, result);
e = get_irn_ne(result, env);
if (e->pscc == NULL) {
exchange(irn, result);
e = get_irn_ne(result, env);
if (e->pscc == NULL) {
- e->pscc = obstack_alloc(&env->obst, sizeof(*e->pscc));
- memset(e->pscc, 0, sizeof(*e->pscc));
+ e->pscc = OALLOCZ(&env->obst, scc);
update_scc(result, e, env);
}
++env->replaced;
update_scc(result, e, env);
}
++env->replaced;
@@
-997,10
+995,9
@@
static void dfs(ir_node *irn, iv_env *env) {
node->low = MIN(o->DFSnum, node->low);
}
if (node->low == node->DFSnum) {
node->low = MIN(o->DFSnum, node->low);
}
if (node->low == node->DFSnum) {
- scc *pscc =
obstack_alloc(&env->obst, sizeof(*pscc)
);
+ scc *pscc =
OALLOCZ(&env->obst, scc
);
ir_node *x;
ir_node *x;
- memset(pscc, 0, sizeof(*pscc));
do {
node_entry *e;
do {
node_entry *e;
@@
-1291,8
+1288,8
@@
void remove_phi_cycles(ir_graph *irg) {
env.process_scc = process_phi_only_scc;
/* Clear all links and move Proj nodes into the
env.process_scc = process_phi_only_scc;
/* Clear all links and move Proj nodes into the
-
the same block as it's
predecessors.
-
This can improve the placement of new nodes.
+
* the same block as their
predecessors.
+
*
This can improve the placement of new nodes.
*/
projs_moved = 0;
irg_walk_graph(irg, NULL, clear_and_fix, &projs_moved);
*/
projs_moved = 0;
irg_walk_graph(irg, NULL, clear_and_fix, &projs_moved);
@@
-1387,12
+1384,6
@@
void opt_osr(ir_graph *irg, unsigned flags) {
int edges;
int projs_moved;
int edges;
int projs_moved;
- if (! get_opt_strength_red()) {
- /* only kill Phi cycles */
- remove_phi_cycles(irg);
- return;
- }
-
rem = current_ir_graph;
current_ir_graph = irg;
rem = current_ir_graph;
current_ir_graph = irg;