diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-12 22:27:47 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-12 22:27:47 +0000 |
commit | 82b9069d6988572c5df7b5fa0360197127a6d669 (patch) | |
tree | e20097f88c7d396bf5c26e3833485b6bb7294026 /gcc/gcse.c | |
parent | 2fc5e9873245c21bd5da410befd69739bd62d803 (diff) | |
download | gcc-82b9069d6988572c5df7b5fa0360197127a6d669.tar.gz |
[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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230276 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r-- | gcc/gcse.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c index dcee396562c..64f04c7e045 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; } |