diff options
author | Nick Clifton <nickc@redhat.com> | 2007-11-05 15:42:30 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2007-11-05 15:42:30 +0000 |
commit | f0ed4cfb9d55717e36c3c056f612e7323facc7ff (patch) | |
tree | 532a1d6bef5e5f6807eb8923edc27006c580c3c2 /gcc/tree-ssa-pre.c | |
parent | 2afad0f6bbf0a98ac7189ca9dbcaef13594e674e (diff) | |
download | gcc-f0ed4cfb9d55717e36c3c056f612e7323facc7ff.zip gcc-f0ed4cfb9d55717e36c3c056f612e7323facc7ff.tar.gz gcc-f0ed4cfb9d55717e36c3c056f612e7323facc7ff.tar.bz2 |
re PR tree-optimization/32540 (Exponential time behavior in PRE)
2007-11-05 Nick Clifton <nickc@redhat.com>
Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/32540
PR tree-optimization/33922
* doc/invoke.texi: Document PARAM_MAX_PARTIAL_ANTIC_LENGTH.
* tree-ssa-pre.c: Include params.h.
(compute_partial_antic_aux): Use PARAM_MAX_PARTIAL_ANTIC_LENGTH
to limit the maximum length of the PA set for a given block.
* Makefile.in: Add a dependency upon params.h for tree-ssa-pre.c
* params.def (PARAM_MAX_PARTIAL_ANTIC_LENGTH): New parameter.
* gcc.dg/tree-ssa/pr32540-1.c: New.
* gcc.dg/tree-ssa/pr32540-2.c: New.
* gcc.dg/tree-ssa/pr33922.c: New.
Co-Authored-By: Sebastian Pop <sebastian.pop@amd.com>
From-SVN: r129901
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r-- | gcc/tree-ssa-pre.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 6203467..59396fd 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -45,6 +45,7 @@ along with GCC; see the file COPYING3. If not see #include "langhooks.h" #include "cfgloop.h" #include "tree-ssa-sccvn.h" +#include "params.h" /* TODO: @@ -1839,6 +1840,7 @@ compute_partial_antic_aux (basic_block block, bitmap_set_t PA_OUT; edge e; edge_iterator ei; + unsigned long max_pa = PARAM_VALUE (PARAM_MAX_PARTIAL_ANTIC_LENGTH); old_PA_IN = PA_OUT = NULL; @@ -1847,6 +1849,14 @@ compute_partial_antic_aux (basic_block block, if (block_has_abnormal_pred_edge) goto maybe_dump_sets; + /* If there are too many partially anticipatable values in the + block, phi_translate_set can take an exponential time: stop + before the translation starts. */ + if (max_pa + && single_succ_p (block) + && bitmap_count_bits (PA_IN (single_succ (block))->values) > max_pa) + goto maybe_dump_sets; + old_PA_IN = PA_IN (block); PA_OUT = bitmap_set_new (); |