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
890f0fbd
Commit
890f0fbd
authored
Jan 08, 2016
by
yb9976
Browse files
Make optimizations robust against constant values.
This fixes opt/boolopt3.c.
parent
dabdd5f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/boolopt.c
View file @
890f0fbd
...
...
@@ -115,8 +115,14 @@ static ir_node *make_Cmp(ir_node *const block, ir_node *const cmp, ir_relation c
*/
static
ir_node
*
bool_and
(
cond_pair
*
const
cpair
,
ir_node
*
dst_block
)
{
ir_node
*
const
cmp_lo
=
cpair
->
cmp_lo
;
ir_node
*
const
cmp_hi
=
cpair
->
cmp_hi
;
ir_node
*
const
cmp_lo
=
cpair
->
cmp_lo
;
ir_node
*
const
cmp_hi
=
cpair
->
cmp_hi
;
if
(
is_Const
(
cmp_lo
))
return
is_Const_null
(
cmp_lo
)
?
cmp_hi
:
cmp_lo
;
if
(
is_Const
(
cmp_hi
))
return
is_Const_null
(
cmp_hi
)
?
cmp_lo
:
cmp_hi
;
ir_relation
rel_lo
=
cpair
->
rel_lo
;
ir_relation
const
rel_hi
=
cpair
->
rel_hi
;
ir_tarval
*
tv_lo
=
cpair
->
tv_lo
;
...
...
@@ -240,8 +246,14 @@ static ir_node *bool_and(cond_pair* const cpair, ir_node *dst_block)
*/
static
ir_node
*
bool_or
(
cond_pair
*
const
cpair
,
ir_node
*
dst_block
)
{
ir_node
*
const
cmp_lo
=
cpair
->
cmp_lo
;
ir_node
*
const
cmp_hi
=
cpair
->
cmp_hi
;
ir_node
*
const
cmp_lo
=
cpair
->
cmp_lo
;
ir_node
*
const
cmp_hi
=
cpair
->
cmp_hi
;
if
(
is_Const
(
cmp_lo
))
return
is_Const_null
(
cmp_lo
)
?
cmp_hi
:
cmp_lo
;
if
(
is_Const
(
cmp_hi
))
return
is_Const_null
(
cmp_hi
)
?
cmp_lo
:
cmp_hi
;
ir_relation
rel_lo
=
cpair
->
rel_lo
;
ir_relation
const
rel_hi
=
cpair
->
rel_hi
;
ir_tarval
*
tv_lo
=
cpair
->
tv_lo
;
...
...
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