aboutsummaryrefslogtreecommitdiff
path: root/gcc/cprop.c
diff options
context:
space:
mode:
authorBrad Lucier <lucier@math.purdue.edu>2015-11-12 22:27:47 +0000
committerJeff Law <law@gcc.gnu.org>2015-11-12 15:27:47 -0700
commit87d8dd6c4599c09fe4da43adac523cf81613217c (patch)
treee20097f88c7d396bf5c26e3833485b6bb7294026 /gcc/cprop.c
parent6e232ba4246ca324a663ec5ddf0ba4db5cf3fbad (diff)
downloadgcc-87d8dd6c4599c09fe4da43adac523cf81613217c.zip
gcc-87d8dd6c4599c09fe4da43adac523cf81613217c.tar.gz
gcc-87d8dd6c4599c09fe4da43adac523cf81613217c.tar.bz2
[PATCH] Make disabled-optimization warning more informative; increase default max-gcse-memory
* gcc/cprop.c (is_too_expensive): Remove. (gcse.h): Include. (one_cprop_pass): Call gcse_or_cprop_is_too_expensive, not is_too_expensive. * gcc/gcse.h (gcse_or_cprop_is_too_expensive): Declare. * gcc/gcse.c (is_too_expensive): Rename to ... (gcse_or_cprop_is_too_expensive): ... this. Expand warning to add required size of max-gcse-memory. (one_pre_gcse_pass): Use it. (one_code_hoisting_pass): Use it. * gcc/params.def (max-gcse-memory): Increase from 50MB to 128MB. From-SVN: r230276
Diffstat (limited to 'gcc/cprop.c')
-rw-r--r--gcc/cprop.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 082f9fd..7f1acc0 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -39,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "dbgcnt.h"
#include "cfgloop.h"
+#include "gcse.h"
/* An obstack for our working variables. */
@@ -1724,47 +1725,6 @@ bypass_conditional_jumps (void)
return changed;
}
-/* Return true if the graph is too expensive to optimize. PASS is the
- optimization about to be performed. */
-
-static bool
-is_too_expensive (const char *pass)
-{
- /* Trying to perform global optimizations on flow graphs which have
- a high connectivity will take a long time and is unlikely to be
- particularly useful.
-
- In normal circumstances a cfg should have about twice as many
- edges as blocks. But we do not want to punish small functions
- which have a couple switch statements. Rather than simply
- threshold the number of blocks, uses something with a more
- graceful degradation. */
- if (n_edges_for_fn (cfun) > 20000 + n_basic_blocks_for_fn (cfun) * 4)
- {
- warning (OPT_Wdisabled_optimization,
- "%s: %d basic blocks and %d edges/basic block",
- pass, n_basic_blocks_for_fn (cfun),
- n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun));
-
- return true;
- }
-
- /* If allocating memory for the cprop bitmap would take up too much
- storage it's better just to disable the optimization. */
- if ((n_basic_blocks_for_fn (cfun)
- * SBITMAP_SET_SIZE (max_reg_num ())
- * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY)
- {
- warning (OPT_Wdisabled_optimization,
- "%s: %d basic blocks and %d registers",
- pass, n_basic_blocks_for_fn (cfun), max_reg_num ());
-
- return true;
- }
-
- return false;
-}
-
/* Main function for the CPROP pass. */
static int
@@ -1775,7 +1735,7 @@ one_cprop_pass (void)
/* Return if there's nothing to do, or it is too expensive. */
if (n_basic_blocks_for_fn (cfun) <= NUM_FIXED_BLOCKS + 1
- || is_too_expensive (_ ("const/copy propagation disabled")))
+ || gcse_or_cprop_is_too_expensive (_ ("const/copy propagation disabled")))
return 0;
global_const_prop_count = local_const_prop_count = 0;