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
869a57a3
Commit
869a57a3
authored
Sep 17, 2007
by
Christoph Mallon
Browse files
Cmp(Conv(x), 0) -> Cmp(x, 0) if dest mode ist wider than source mode.
[r15829]
parent
291fe400
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
869a57a3
...
...
@@ -3432,6 +3432,24 @@ 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
)))
{
ir_mode
*
mode
=
get_irn_mode
(
left
);
ir_node
*
op
=
get_Conv_op
(
left
);
ir_mode
*
op_mode
=
get_irn_mode
(
op
);
if
(
get_mode_size_bits
(
mode
)
>
get_mode_size_bits
(
op_mode
)
&&
(
mode_is_signed
(
mode
)
||
!
mode_is_signed
(
op_mode
)))
{
ir_node
*
null
=
new_Const
(
op_mode
,
get_mode_null
(
op_mode
));
dbg_info
*
dbg
=
get_irn_dbg_info
(
n
);
ir_graph
*
irg
=
current_ir_graph
;
ir_node
*
block
=
get_nodes_block
(
n
);
return
new_rd_Cmp
(
dbg
,
irg
,
block
,
op
,
null
);
}
}
/* remove Casts */
if
(
is_Cast
(
left
))
left
=
get_Cast_op
(
left
);
...
...
@@ -3511,7 +3529,6 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
default:
break
;
}
}
}
...
...
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