Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
90317fb9
Commit
90317fb9
authored
Nov 15, 2014
by
Matthias Braun
Browse files
reassoc: Use set_op_reassociate() instead of custom function
parent
b20c3f1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/reassoc.c
View file @
90317fb9
...
...
@@ -614,18 +614,13 @@ void optimize_reassociation(ir_graph *irg)
confirm_irg_properties
(
irg
,
IR_GRAPH_PROPERTIES_CONTROL_FLOW
);
}
static
void
register_node_reassoc_func
(
ir_op
*
op
,
reassociate_func
func
)
{
op
->
ops
.
reassociate
=
func
;
}
void
ir_register_reassoc_node_ops
(
void
)
{
register_node
_reassoc
_func
(
op_Add
,
reassoc_commutative
);
register_node
_reassoc
_func
(
op_And
,
reassoc_commutative
);
register_node
_reassoc
_func
(
op_Eor
,
reassoc_commutative
);
register_node
_reassoc
_func
(
op_Mul
,
reassoc_commutative
);
register_node
_reassoc
_func
(
op_Or
,
reassoc_commutative
);
set_op
_reassoc
iate
(
op_Add
,
reassoc_commutative
);
set_op
_reassoc
iate
(
op_And
,
reassoc_commutative
);
set_op
_reassoc
iate
(
op_Eor
,
reassoc_commutative
);
set_op
_reassoc
iate
(
op_Mul
,
reassoc_commutative
);
set_op
_reassoc
iate
(
op_Or
,
reassoc_commutative
);
}
/* initialize the reassociation by adding operations to some opcodes */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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