Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
a1daf895
Commit
a1daf895
authored
Nov 25, 2015
by
Christoph Mallon
Browse files
iropt: Factorise common code.
parent
96b4cd58
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/iropt.c
View file @
a1daf895
...
...
@@ -7493,6 +7493,15 @@ static ir_node *transform_node_Store(ir_node *n)
return
n
;
}
static
bool
always_optimize
(
unsigned
const
iro
)
{
return
iro
==
iro_Block
||
iro
==
iro_Id
||
iro
==
iro_Phi
||
iro
==
iro_Proj
;
}
/**
* Tries several [inplace] [optimizing] transformations and returns an
* equivalent node. The difference to equivalent_node() is that these
...
...
@@ -7539,11 +7548,7 @@ restart:;
}
/* remove unnecessary nodes */
if
(
get_opt_constant_folding
()
||
(
iro
==
iro_Phi
)
||
/* always optimize these nodes. */
(
iro
==
iro_Id
)
||
/* ... */
(
iro
==
iro_Proj
)
||
/* ... */
(
iro
==
iro_Block
))
{
/* Flags tested local. */
if
(
get_opt_constant_folding
()
||
always_optimize
(
iro
))
{
n
=
equivalent_node
(
n
);
if
(
n
!=
old_n
)
goto
restart
;
...
...
@@ -7875,11 +7880,7 @@ ir_node *optimize_node(ir_node *n)
}
/* remove unnecessary nodes */
if
(
get_opt_algebraic_simplification
()
||
(
iro
==
iro_Phi
)
||
/* always optimize these nodes. */
(
iro
==
iro_Id
)
||
(
iro
==
iro_Proj
)
||
(
iro
==
iro_Block
)
)
/* Flags tested local. */
if
(
get_opt_algebraic_simplification
()
||
always_optimize
(
iro
))
n
=
equivalent_node
(
n
);
/* Common Subexpression Elimination.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment