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
16188a6b
Commit
16188a6b
authored
Mar 31, 2014
by
yb9976
Browse files
Improved local optimization: a ^ a => 0.
parent
4bd86128
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
16188a6b
...
...
@@ -444,8 +444,16 @@ static ir_tarval *computed_value_Eor(const ir_node *n)
const
ir_node
*
a
=
get_Eor_left
(
n
);
const
ir_node
*
b
=
get_Eor_right
(
n
);
if
(
a
==
b
)
/* a ^ a == 0 */
if
(
a
==
b
||
(
is_Confirm
(
a
)
&&
is_Confirm
(
b
)
&&
get_Confirm_relation
(
a
)
==
ir_relation_equal
&&
get_Confirm_relation
(
b
)
==
ir_relation_equal
&&
get_Confirm_bound
(
a
)
==
get_Confirm_value
(
b
)
&&
get_Confirm_bound
(
b
)
==
get_Confirm_value
(
a
)))
{
return
get_mode_null
(
get_irn_mode
(
n
));
}
/* x^~x => ~0 */
if
(
complement_values
(
a
,
b
))
return
get_mode_all_one
(
get_irn_mode
(
n
));
...
...
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