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
946fa0cb
Commit
946fa0cb
authored
Aug 18, 2014
by
Matthias Braun
Browse files
iropt: (x+C1,C2) => Cmp(X,C1-C2) is only beneficial if Add has no other users
parent
85646be4
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
946fa0cb
...
@@ -5211,7 +5211,8 @@ is_bittest: {
...
@@ -5211,7 +5211,8 @@ is_bittest: {
DBG_OPT_ALGSIM0
(
n
,
n
,
FS_OPT_CMP_OP_C
);
DBG_OPT_ALGSIM0
(
n
,
n
,
FS_OPT_CMP_OP_C
);
}
}
}
}
}
else
if
(
is_Add
(
left
)
||
is_Or_Eor_Add
(
left
))
{
}
else
if
((
is_Add
(
left
)
||
is_Or_Eor_Add
(
left
))
&&
only_one_user
(
left
))
{
/* a + c1 ==/!= c2 ==> a ==/!= c2 - c1 */
/* a + c1 ==/!= c2 ==> a ==/!= c2 - c1 */
ir_tarval
*
tv2
=
value_of
(
get_binop_right
(
left
));
ir_tarval
*
tv2
=
value_of
(
get_binop_right
(
left
));
if
(
tarval_is_constant
(
tv2
))
{
if
(
tarval_is_constant
(
tv2
))
{
...
...
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