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
f83f5665
Commit
f83f5665
authored
Sep 17, 2007
by
Christoph Mallon
Browse files
Use is_Const_null() instead of tarval_is_null(get_Const_tarval()).
[r15843]
parent
39777374
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
f83f5665
...
...
@@ -925,7 +925,7 @@ static ir_node *equivalent_node_left_zero(ir_node *n) {
ir_node
*
a
=
get_binop_left
(
n
);
ir_node
*
b
=
get_binop_right
(
n
);
if
(
tarval_is_null
(
value_of
(
b
)
))
{
if
(
is_Const
(
b
)
&&
is_Const_null
(
b
))
{
n
=
a
;
DBG_OPT_ALGSIM1
(
oldn
,
a
,
b
,
n
,
FS_OPT_NEUTRAL_0
);
...
...
@@ -959,7 +959,7 @@ static ir_node *equivalent_node_Sub(ir_node *n) {
b
=
get_Sub_right
(
n
);
/* Beware: modes might be different */
if
(
tarval_is_null
(
value_of
(
b
)
))
{
if
(
is_Const
(
b
)
&&
is_Const_null
(
b
))
{
ir_node
*
a
=
get_Sub_left
(
n
);
if
(
mode
==
get_irn_mode
(
a
))
{
n
=
a
;
...
...
@@ -1099,10 +1099,10 @@ static ir_node *equivalent_node_Or(ir_node *n) {
if
(
a
==
b
)
{
n
=
a
;
/* Or has it's own neutral element */
DBG_OPT_ALGSIM0
(
oldn
,
n
,
FS_OPT_OR
);
}
else
if
(
tarval_is_null
(
value_of
(
a
)
))
{
}
else
if
(
is_Const
(
a
)
&&
is_Const_null
(
a
))
{
n
=
b
;
DBG_OPT_ALGSIM1
(
oldn
,
a
,
b
,
n
,
FS_OPT_OR
);
}
else
if
(
tarval_is_null
(
value_of
(
b
)
))
{
}
else
if
(
is_Const
(
b
)
&&
is_Const_null
(
b
))
{
n
=
a
;
DBG_OPT_ALGSIM1
(
oldn
,
a
,
b
,
n
,
FS_OPT_OR
);
}
...
...
@@ -3426,9 +3426,7 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
}
/* TODO extend to arbitrary constants */
if
(
is_Conv
(
left
)
&&
is_Const
(
right
)
&&
tarval_is_null
(
get_Const_tarval
(
right
)))
{
if
(
is_Conv
(
left
)
&&
is_Const
(
right
)
&&
is_Const_null
(
right
))
{
ir_mode
*
mode
=
get_irn_mode
(
left
);
ir_node
*
op
=
get_Conv_op
(
left
);
ir_mode
*
op_mode
=
get_irn_mode
(
op
);
...
...
ir/opt/opt_confirms.c
View file @
f83f5665
...
...
@@ -184,9 +184,7 @@ int value_not_null(ir_node *n, ir_node **confirm) {
if
(
op
==
op_SymConst
&&
get_SymConst_kind
(
n
)
==
symconst_addr_ent
)
return
1
;
if
(
op
==
op_Const
)
{
tarval
*
tv
=
get_Const_tarval
(
n
);
if
(
tv
!=
tarval_bad
&&
!
tarval_is_null
(
tv
))
if
(
!
is_Const_null
(
n
))
return
1
;
}
else
{
for
(;
is_Confirm
(
n
);
n
=
skip_Cast
(
get_Confirm_value
(
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