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
23ac3b3f
Commit
23ac3b3f
authored
Mar 14, 2014
by
yb9976
Browse files
Added local optimizations: (a & X) | a = a | (a & X) = a.
parent
ac1ff305
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
23ac3b3f
...
...
@@ -1168,6 +1168,19 @@ static ir_node *equivalent_node_Or(ir_node *n)
return
n
;
}
/* (a & X) | a => a */
if
(
is_And
(
a
)
&&
get_commutative_other_op
(
a
,
b
))
{
n
=
b
;
DBG_OPT_ALGSIM1
(
oldn
,
a
,
b
,
n
,
FS_OPT_OR
);
return
n
;
}
/* a | (a & X) => a */
if
(
is_And
(
b
)
&&
get_commutative_other_op
(
b
,
a
))
{
n
=
a
;
DBG_OPT_ALGSIM1
(
oldn
,
a
,
b
,
n
,
FS_OPT_OR
);
return
n
;
}
return
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