aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.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/gcse.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/gcse.c')
-rw-r--r--gcc/gcse.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index dcee396..64f04c7 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -510,7 +510,6 @@ static void trim_ld_motion_mems (void);
static void update_ld_motion_stores (struct gcse_expr *);
static void clear_modify_mem_tables (void);
static void free_modify_mem_tables (void);
-static bool is_too_expensive (const char *);
#define GNEW(T) ((T *) gmalloc (sizeof (T)))
#define GCNEW(T) ((T *) gcalloc (1, sizeof (T)))
@@ -2565,7 +2564,7 @@ one_pre_gcse_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 (_("PRE disabled")))
+ || gcse_or_cprop_is_too_expensive (_("PRE disabled")))
return 0;
/* We need alias. */
@@ -3493,7 +3492,7 @@ one_code_hoisting_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 (_("GCSE disabled")))
+ || gcse_or_cprop_is_too_expensive (_("GCSE disabled")))
return 0;
doing_code_hoisting_p = true;
@@ -3957,9 +3956,13 @@ update_ld_motion_stores (struct gcse_expr * expr)
/* 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)
+bool
+gcse_or_cprop_is_too_expensive (const char *pass)
{
+ unsigned int memory_request = (n_basic_blocks_for_fn (cfun)
+ * SBITMAP_SET_SIZE (max_reg_num ())
+ * sizeof (SBITMAP_ELT_TYPE));
+
/* 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.
@@ -3981,13 +3984,12 @@ is_too_expensive (const char *pass)
/* If allocating memory for the dataflow bitmaps 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)
+ if (memory_request > MAX_GCSE_MEMORY)
{
warning (OPT_Wdisabled_optimization,
- "%s: %d basic blocks and %d registers",
- pass, n_basic_blocks_for_fn (cfun), max_reg_num ());
+ "%s: %d basic blocks and %d registers; increase --param max-gcse-memory above %d",
+ pass, n_basic_blocks_for_fn (cfun), max_reg_num (),
+ memory_request);
return true;
}