aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-11-26 17:00:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-11-26 17:00:19 +0000
commita61f9cc067a63d8311cfbc941d1bdd6bbcc0cfb1 (patch)
tree5b4bbaf84b24ebda928572d9d57f3e7da9971092 /gcc
parent6780e186fc7a4ebf334f4b140cfd103e15deca3c (diff)
downloadgcc-a61f9cc067a63d8311cfbc941d1bdd6bbcc0cfb1.zip
gcc-a61f9cc067a63d8311cfbc941d1bdd6bbcc0cfb1.tar.gz
gcc-a61f9cc067a63d8311cfbc941d1bdd6bbcc0cfb1.tar.bz2
tree-ssa-dce.c (nr_walks): New variable.
2009-11-26 Richard Guenther <rguenther@suse.de> * tree-ssa-dce.c (nr_walks): New variable. (mark_aliased_reaching_defs_necessary): Adjust oracle cut-off. (perform_tree_ssa_dce): Init nr_walks. From-SVN: r154676
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-dce.c16
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2666821..b6eb7c5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-26 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-dce.c (nr_walks): New variable.
+ (mark_aliased_reaching_defs_necessary): Adjust oracle cut-off.
+ (perform_tree_ssa_dce): Init nr_walks.
+
2009-11-26 Michael Matz <matz@suse.de>
PR tree-optimization/41905
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 0ddda76..cdb6432 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -489,6 +489,7 @@ ref_may_be_aliased (tree ref)
static bitmap visited = NULL;
static unsigned int longest_chain = 0;
static unsigned int total_chain = 0;
+static unsigned int nr_walks = 0;
static bool chain_ovfl = false;
/* Worker for the walker that marks reaching definitions of REF,
@@ -557,6 +558,7 @@ mark_aliased_reaching_defs_necessary (gimple stmt, tree ref)
if (chain > longest_chain)
longest_chain = chain;
total_chain += chain;
+ nr_walks++;
}
/* Worker for the walker that marks reaching definitions of REF, which
@@ -803,11 +805,16 @@ propagate_necessity (struct edge_list *el)
gcc_unreachable ();
/* If we over-used our alias oracle budget drop to simple
- mode. The cost metric allows quadratic behavior up to
- a constant maximal chain and after that falls back to
+ mode. The cost metric allows quadratic behavior
+ (number of uses times number of may-defs queries) up to
+ a constant maximal number of queries and after that falls back to
super-linear complexity. */
- if (longest_chain > 256
- && total_chain > 256 * longest_chain)
+ if (/* Constant but quadratic for small functions. */
+ total_chain > 128 * 128
+ /* Linear in the number of may-defs. */
+ && total_chain > 32 * longest_chain
+ /* Linear in the number of uses. */
+ && total_chain > nr_walks * 32)
{
chain_ovfl = true;
if (visited)
@@ -1376,6 +1383,7 @@ perform_tree_ssa_dce (bool aggressive)
longest_chain = 0;
total_chain = 0;
+ nr_walks = 0;
chain_ovfl = false;
visited = BITMAP_ALLOC (NULL);
propagate_necessity (el);