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
af863f10
Commit
af863f10
authored
Jun 03, 2014
by
yb9976
Browse files
Prevent optimization if the operand has multiple users.
parent
26914287
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
af863f10
...
...
@@ -5356,11 +5356,16 @@ static ir_node *transform_node_shl_shr(ir_node *n)
assert
(
tarval_is_constant
(
tv_mask
));
assert
(
get_tarval_mode
(
tv_mask
)
==
mode
);
ir_node
*
block
=
get_nodes_block
(
n
);
ir_graph
*
irg
=
get_irn_irg
(
block
);
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_relation
relation
=
tarval_cmp
(
tv_shl
,
tv_shr
);
ir_node
*
new_shift
;
ir_node
*
block
=
get_nodes_block
(
n
);
ir_graph
*
irg
=
get_irn_irg
(
block
);
dbg_info
*
dbgi
=
get_irn_dbg_info
(
n
);
ir_relation
relation
=
tarval_cmp
(
tv_shl
,
tv_shr
);
/* Reusing the original shift operand is still cheaper. */
if
(
relation
!=
ir_relation_equal
&&
!
only_one_user
(
left
))
return
n
;
ir_node
*
new_shift
;
if
(
relation
==
ir_relation_less
||
relation
==
ir_relation_equal
)
{
ir_tarval
*
tv_shift
=
tarval_sub
(
tv_shr
,
tv_shl
,
NULL
);
ir_node
*
new_const
=
new_r_Const
(
irg
,
tv_shift
);
...
...
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