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
6939c62c
Commit
6939c62c
authored
Feb 07, 2015
by
Victor Pfautz
Committed by
yb9976
Jun 01, 2015
Browse files
iropt: (a | b) ^ (a & b) -> a ^ b added
parent
e01496d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
6939c62c
...
...
@@ -2925,6 +2925,35 @@ static ir_node *transform_node_Eor_(ir_node *n)
}
}
if
(
is_Or
(
a
)
&&
is_And
(
b
)
&&
only_one_user
(
a
)
&&
only_one_user
(
b
))
{
ir_node
*
al
=
get_binop_left
(
a
);
ir_node
*
ar
=
get_binop_right
(
a
);
ir_node
*
bl
=
get_binop_left
(
b
);
ir_node
*
br
=
get_binop_right
(
b
);
if
((
al
==
bl
&&
ar
==
br
)
||
(
al
==
br
&&
ar
==
bl
))
{
/* (x | y) ^ (x & y) -> x ^ y */
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_node
*
block
=
get_nodes_block
(
n
);
return
new_rd_Eor
(
dbgi
,
block
,
al
,
ar
,
mode
);
}
}
if
(
is_And
(
a
)
&&
is_Or
(
b
)
&&
only_one_user
(
a
)
&&
only_one_user
(
b
))
{
ir_node
*
al
=
get_binop_left
(
a
);
ir_node
*
ar
=
get_binop_right
(
a
);
ir_node
*
bl
=
get_binop_left
(
b
);
ir_node
*
br
=
get_binop_right
(
b
);
if
((
al
==
bl
&&
ar
==
br
)
||
(
al
==
br
&&
ar
==
bl
))
{
/* (x & y) ^ (x | y) -> x ^ y */
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_node
*
block
=
get_nodes_block
(
n
);
return
new_rd_Eor
(
dbgi
,
block
,
al
,
ar
,
mode
);
}
}
// Eor elimination
ir_node
*
ta
=
a
;
ir_node
*
tb
=
b
;
...
...
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