aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2010-07-27 19:34:55 +0000
committerMaxim Kuvyrkov <maxim@codesourcery.com>2010-07-27 19:34:55 +0000
commite036e8dbf2262386f8497ad9b18a91bcbbf86c7d (patch)
treebc917e23e29e482306b5b28d47954ead5d6531dc /gcc/gcse.c
parentb578808cb78eb85ffca817985b227727db2fef8c (diff)
PR rtl-optimization/40956
PR target/42495 PR middle-end/42574 * gcse.c (compute_code_hoist_vbeinout): Consider more expressions for hoisting. (hoist_code): Count occurences in current block too. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@162590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 9b44083fccd..4b2547c3367 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -4247,8 +4247,15 @@ compute_code_hoist_vbeinout (void)
FOR_EACH_BB_REVERSE (bb)
{
if (bb->next_bb != EXIT_BLOCK_PTR)
- sbitmap_intersection_of_succs (hoist_vbeout[bb->index],
- hoist_vbein, bb->index);
+ {
+ sbitmap_intersection_of_succs (hoist_vbeout[bb->index],
+ hoist_vbein, bb->index);
+
+ /* Include expressions in VBEout that are calculated
+ in BB and available at its end. */
+ sbitmap_a_or_b (hoist_vbeout[bb->index],
+ hoist_vbeout[bb->index], comp[bb->index]);
+ }
changed |= sbitmap_a_or_b_and_c_cg (hoist_vbein[bb->index],
antloc[bb->index],
@@ -4430,6 +4437,11 @@ hoist_code (void)
if (TEST_BIT (hoist_vbeout[bb->index], i))
{
+ /* If an expression is computed in BB and is available at end of
+ BB, hoist all occurences dominated by BB to BB. */
+ if (TEST_BIT (comp[bb->index], i))
+ hoistable++;
+
/* We've found a potentially hoistable expression, now
we look at every block BB dominates to see if it
computes the expression. */