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
cef4733a
Commit
cef4733a
authored
Jun 01, 2011
by
Matthias Braun
Browse files
experimental patch to limit GCSE so we don't produce partially dead code like crazy
parent
dee663d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/ir/iropt.c
View file @
cef4733a
...
...
@@ -6316,10 +6316,23 @@ int identities_cmp(const void *elt, const void *key)
/* for pinned nodes, the block inputs must be equal */
if
(
get_irn_n
(
a
,
-
1
)
!=
get_irn_n
(
b
,
-
1
))
return
1
;
}
else
if
(
!
get_opt_global_cse
())
{
/* for block-local CSE both nodes must be in the same Block */
if
(
get_nodes_block
(
a
)
!=
get_nodes_block
(
b
))
return
1
;
}
else
{
ir_node
*
block_a
=
get_nodes_block
(
a
);
ir_node
*
block_b
=
get_nodes_block
(
b
);
if
(
!
get_opt_global_cse
())
{
/* for block-local CSE both nodes must be in the same Block */
if
(
block_a
!=
block_b
)
return
1
;
}
else
{
/* The optimistic approach would be to do nothing here.
* However doing GCSE optimisatically produces alot of partially dead code which appears
* to be worse in practice than the missed opportunities.
* So we use a very conservative variant here and only CSE if 1 value dominates the
* other. */
if
(
!
block_dominates
(
block_a
,
block_b
)
&&
!
block_dominates
(
block_b
,
block_a
))
return
1
;
}
}
/* compare a->in[0..ins] with b->in[0..ins] */
...
...
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