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
69d496cd
Commit
69d496cd
authored
Jun 15, 2012
by
Christoph Mallon
Browse files
Make test for superfluous And/Or removal in fp-vrp more general.
parent
78b94dd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/fp-vrp.c
View file @
69d496cd
...
...
@@ -714,18 +714,14 @@ exchange_only:
ir_node
*
const
r
=
get_And_right
(
irn
);
bitinfo
const
*
const
bl
=
get_bitinfo
(
l
);
bitinfo
const
*
const
br
=
get_bitinfo
(
r
);
if
(
bl
->
z
==
bl
->
o
)
{
if
(
tarval_is_null
(
tarval_andnot
(
br
->
z
,
bl
->
z
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
r
);
env
->
modified
=
1
;
}
}
else
if
(
br
->
z
==
br
->
o
)
{
if
(
tarval_is_null
(
tarval_andnot
(
bl
->
z
,
br
->
z
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
l
);
env
->
modified
=
1
;
}
if
(
tarval_is_null
(
tarval_andnot
(
br
->
z
,
bl
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
r
);
env
->
modified
=
1
;
}
else
if
(
tarval_is_null
(
tarval_andnot
(
bl
->
z
,
br
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
l
);
env
->
modified
=
1
;
}
break
;
}
...
...
@@ -757,18 +753,14 @@ exchange_only:
ir_node
*
const
r
=
get_Or_right
(
irn
);
bitinfo
const
*
const
bl
=
get_bitinfo
(
l
);
bitinfo
const
*
const
br
=
get_bitinfo
(
r
);
if
(
bl
->
z
==
bl
->
o
)
{
if
(
tarval_is_null
(
tarval_andnot
(
bl
->
o
,
br
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
r
);
env
->
modified
=
1
;
}
}
else
if
(
br
->
z
==
br
->
o
)
{
if
(
tarval_is_null
(
tarval_andnot
(
br
->
o
,
bl
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
l
);
env
->
modified
=
1
;
}
if
(
tarval_is_null
(
tarval_andnot
(
bl
->
z
,
br
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
r
);
env
->
modified
=
1
;
}
else
if
(
tarval_is_null
(
tarval_andnot
(
br
->
z
,
bl
->
o
)))
{
DB
((
dbg
,
LEVEL_2
,
"%+F(%+F, %+F) is superfluous
\n
"
,
irn
,
l
,
r
));
exchange
(
irn
,
l
);
env
->
modified
=
1
;
}
/* if each bit is guaranteed to be zero on either the left or right
...
...
Write
Preview
Supports
Markdown
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