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
c77ef4a8
Commit
c77ef4a8
authored
Mar 14, 2014
by
yb9976
Browse files
Added local optimizations: x | (x ^ y) = (x ^ y) | y = x | y.
parent
23ac3b3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
c77ef4a8
...
...
@@ -2358,6 +2358,25 @@ static ir_node *transform_node_Or_(ir_node *n)
return
n
;
}
if
(
is_Eor
(
a
)
||
is_Eor_Add
(
a
))
{
ir_node
*
const
o
=
get_commutative_other_op
(
a
,
b
);
if
(
o
)
{
/* (x ^ y) | y => x | y */
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_node
*
block
=
get_nodes_block
(
n
);
return
new_rd_Or
(
dbgi
,
block
,
o
,
b
,
mode
);
}
}
if
(
is_Eor
(
b
)
||
is_Eor_Add
(
b
))
{
ir_node
*
const
o
=
get_commutative_other_op
(
b
,
a
);
if
(
o
)
{
/* x | (x ^ y) => x | y */
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_node
*
block
=
get_nodes_block
(
n
);
return
new_rd_Or
(
dbgi
,
block
,
a
,
o
,
mode
);
}
}
/* we can combine the relations of two compares with the same operands */
if
(
is_Cmp
(
a
)
&&
is_Cmp
(
b
))
{
ir_node
*
a_left
=
get_Cmp_left
(
a
);
...
...
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