aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-12-18 23:03:23 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-12-18 23:03:23 +0000
commit11b8091fb33c894cea20702d3e85389723987910 (patch)
tree427f71a6fe22d2d9f56e91ff3b27115b1a3c4fb7
parentd3769410c65a7d3f2d58402c3ecf5c253e340c2e (diff)
downloadgcc-11b8091fb33c894cea20702d3e85389723987910.zip
gcc-11b8091fb33c894cea20702d3e85389723987910.tar.gz
gcc-11b8091fb33c894cea20702d3e85389723987910.tar.bz2
* ira.c (ira): Use simple LRA algorithm when not optimizing.
From-SVN: r279550
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/ira.c36
2 files changed, 26 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index be8dfa3..0f1a0b6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * ira.c (ira): Use simple LRA algorithm when not optimizing.
+
2019-12-18 Thomas Schwinge <thomas@codesourcery.com>
* gimplify.c (gimplify_omp_target_update): Elaborate 'exit data'
diff --git a/gcc/ira.c b/gcc/ira.c
index 5df9953..1a9b390 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5192,8 +5192,6 @@ ira (FILE *f)
int ira_max_point_before_emit;
bool saved_flag_caller_saves = flag_caller_saves;
enum ira_region saved_flag_ira_region = flag_ira_region;
- unsigned int i;
- int num_used_regs = 0;
clear_bb_flags ();
@@ -5207,18 +5205,28 @@ ira (FILE *f)
/* Perform target specific PIC register initialization. */
targetm.init_pic_reg ();
- ira_conflicts_p = optimize > 0;
-
- /* Determine the number of pseudos actually requiring coloring. */
- for (i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
- num_used_regs += !!(DF_REG_USE_COUNT (i) + DF_REG_DEF_COUNT (i));
-
- /* If there are too many pseudos and/or basic blocks (e.g. 10K
- pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
- use simplified and faster algorithms in LRA. */
- lra_simple_p
- = (ira_use_lra_p
- && num_used_regs >= (1 << 26) / last_basic_block_for_fn (cfun));
+ if (optimize)
+ {
+ ira_conflicts_p = true;
+
+ /* Determine the number of pseudos actually requiring coloring. */
+ unsigned int num_used_regs = 0;
+ for (unsigned int i = FIRST_PSEUDO_REGISTER; i < DF_REG_SIZE (df); i++)
+ if (DF_REG_DEF_COUNT (i) || DF_REG_USE_COUNT (i))
+ num_used_regs++;
+
+ /* If there are too many pseudos and/or basic blocks (e.g. 10K
+ pseudos and 10K blocks or 100K pseudos and 1K blocks), we will
+ use simplified and faster algorithms in LRA. */
+ lra_simple_p
+ = ira_use_lra_p
+ && num_used_regs >= (1U << 26) / last_basic_block_for_fn (cfun);
+ }
+ else
+ {
+ ira_conflicts_p = false;
+ lra_simple_p = ira_use_lra_p;
+ }
if (lra_simple_p)
{