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
413caa54
Commit
413caa54
authored
Apr 14, 2010
by
Matthias Braun
Browse files
combos constant dataflow analysis has to be consistent with the localopt; this should fix 300.twolf
[r27394]
parent
43d2b5ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
413caa54
...
...
@@ -487,8 +487,10 @@ static tarval *computed_value_Proj_Cmp(const ir_node *n)
/*
* BEWARE: a == a is NOT always True for floating Point values, as
* NaN != NaN is defined, so we must check this here.
* (Note: Some pnc do still allow optimisations but we don't do them
* here because we would get inconsistent with combos compute_Cmp then)
*/
if
(
left
==
right
&&
(
!
mode_is_float
(
mode
)
||
pn_cmp
==
pn_Cmp_Lt
||
pn_cmp
==
pn_Cmp_Gt
)
)
{
if
(
left
==
right
&&
!
mode_is_float
(
mode
))
{
/* This is a trick with the bits used for encoding the Cmp
Proj numbers, the following statement is not the same:
return new_tarval_from_long(pn_cmp == pn_Cmp_Eq, mode_b) */
...
...
ir/opt/combo.c
View file @
413caa54
...
...
@@ -2315,13 +2315,7 @@ static void compute_Cmp(node_t *node)
node
->
type
.
tv
=
tarval_b_true
;
}
}
else
if
(
is_con
(
a
)
&&
is_con
(
b
))
{
/* both nodes are constants, we can probably do something */
if
(
mode_is_float
(
mode
))
{
/* beware of NaN's */
node
->
type
.
tv
=
tarval_bottom
;
}
else
{
node
->
type
.
tv
=
tarval_b_true
;
}
node
->
type
.
tv
=
tarval_b_true
;
}
else
{
node
->
type
.
tv
=
tarval_bottom
;
}
...
...
@@ -2347,13 +2341,16 @@ static void compute_Proj_Cmp(node_t *node, ir_node *cmp)
node
->
type
.
tv
=
tarval_undefined
;
}
else
if
(
is_con
(
a
)
&&
is_con
(
b
))
{
default_compute
(
node
);
}
else
if
(
r
->
part
==
l
->
part
&&
(
!
mode_is_float
(
get_irn_mode
(
l
->
node
))
||
pnc
==
pn_Cmp_Lt
||
pnc
==
pn_Cmp_Gt
))
{
/*
* BEWARE: a == a is NOT always True for floating Point values, as
* NaN != NaN is defined, so we must check this here.
* (while for some pnc we could still optimize we have to stay
* consistent with compute_Cmp, so don't do anything for floats)
*/
tv
=
pnc
&
pn_Cmp_Eq
?
tarval_b_true
:
tarval_b_false
;
}
else
if
(
r
->
part
==
l
->
part
&&
!
mode_is_float
(
get_irn_mode
(
l
->
node
)))
{
tv
=
pnc
&
pn_Cmp_Eq
?
tarval_b_true
:
tarval_b_false
;
/* if the node was ONCE evaluated by all constants, but now
this breaks AND we get from the argument partitions a different
...
...
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