aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <r.sandiford@uk.ibm.com>2012-06-06 09:12:58 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2012-06-06 09:12:58 +0000
commitc881de027cad019b0c8e556613bec7ac8d492fe0 (patch)
treeea916a73f9fec97c16c5cf2ff5b2caffd34df151 /gcc
parent14ae3cbc62bc39d5a3ff9b3067977d4f99739ed6 (diff)
downloadgcc-c881de027cad019b0c8e556613bec7ac8d492fe0.zip
gcc-c881de027cad019b0c8e556613bec7ac8d492fe0.tar.gz
gcc-c881de027cad019b0c8e556613bec7ac8d492fe0.tar.bz2
invoke.texi (sched-pressure-algorithm): Document new --param.
gcc/ * doc/invoke.texi (sched-pressure-algorithm): Document new --param. * common.opt (fsched-pressure-algorithm=): Remove. * flag-types.h (sched_pressure_algorithm): Move to... * sched-int.h (sched_pressure_algorithm): ...here. * params.def (sched-pressure-algorithm): New param. * haifa-sched.c (sched_init): Use it to initialize sched_pressure. * common/config/s390/s390-common.c (s390_option_optimization_table): Remove OPT_fsched_pressure_algorithm_ entry. * config/s390/s390.c (s390_option_override): Set a default value for PARAM_SCHED_PRESSURE_ALGORITHM. From-SVN: r188258
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/common.opt13
-rw-r--r--gcc/common/config/s390/s390-common.c5
-rw-r--r--gcc/config/s390/s390.c5
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/flag-types.h8
-rw-r--r--gcc/haifa-sched.c3
-rw-r--r--gcc/params.def6
-rw-r--r--gcc/sched-int.h8
9 files changed, 46 insertions, 26 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7ed2807..6c00603 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2012-06-06 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * doc/invoke.texi (sched-pressure-algorithm): Document new --param.
+ * common.opt (fsched-pressure-algorithm=): Remove.
+ * flag-types.h (sched_pressure_algorithm): Move to...
+ * sched-int.h (sched_pressure_algorithm): ...here.
+ * params.def (sched-pressure-algorithm): New param.
+ * haifa-sched.c (sched_init): Use it to initialize sched_pressure.
+ * common/config/s390/s390-common.c (s390_option_optimization_table):
+ Remove OPT_fsched_pressure_algorithm_ entry.
+ * config/s390/s390.c (s390_option_override): Set a default value for
+ PARAM_SCHED_PRESSURE_ALGORITHM.
+
2012-06-05 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/53487
diff --git a/gcc/common.opt b/gcc/common.opt
index 9e3ba18..faa0572 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1664,19 +1664,6 @@ fsched-pressure
Common Report Var(flag_sched_pressure) Init(0) Optimization
Enable register pressure sensitive insn scheduling
-fsched-pressure-algorithm=
-Common Joined RejectNegative Enum(sched_pressure_algorithm) Var(flag_sched_pressure_algorithm) Init(SCHED_PRESSURE_WEIGHTED)
--fsched-pressure-algorithm=[weighted|model] Set the pressure-scheduling algorithm
-
-Enum
-Name(sched_pressure_algorithm) Type(enum sched_pressure_algorithm) UnknownError(unknown %<fsched-pressure%> algorithm %qs)
-
-EnumValue
-Enum(sched_pressure_algorithm) String(weighted) Value(SCHED_PRESSURE_WEIGHTED)
-
-EnumValue
-Enum(sched_pressure_algorithm) String(model) Value(SCHED_PRESSURE_MODEL)
-
fsched-spec
Common Report Var(flag_schedule_speculative) Init(1) Optimization
Allow speculative motion of non-loads
diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c
index 4d36428..0c9a161 100644
--- a/gcc/common/config/s390/s390-common.c
+++ b/gcc/common/config/s390/s390-common.c
@@ -51,11 +51,8 @@ static const struct default_options s390_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
- /* Enable -fsched-pressure using -fsched-pressure-algorithm=model
- by default when optimizing. */
+ /* Enable -fsched-pressure by default when optimizing. */
{ OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 },
- { OPT_LEVELS_1_PLUS, OPT_fsched_pressure_algorithm_,
- NULL, SCHED_PRESSURE_MODEL },
/* ??? There are apparently still problems with -fcaller-saves. */
{ OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 },
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index bc0bf8a..477bd24 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -1649,6 +1649,11 @@ s390_option_override (void)
is beneficial on s390, we enable it if available. */
if (flag_prefetch_loop_arrays < 0 && HAVE_prefetch && optimize >= 3)
flag_prefetch_loop_arrays = 1;
+
+ /* Use the alternative scheduling-pressure algorithm by default. */
+ maybe_set_param_value (PARAM_SCHED_PRESSURE_ALGORITHM, 2,
+ global_options.x_param_values,
+ global_options_set.x_param_values);
}
/* Map for smallest class containing reg regno. */
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 6312fc0..2c75bbb 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -9350,6 +9350,17 @@ Set the maximum number of instructions executed in parallel in
reassociated tree. This parameter overrides target dependent
heuristics used by default if has non zero value.
+@item sched-pressure-algorithm
+Choose between the two available implementations of
+@option{-fsched-pressure}. Algorithm 1 is the original implementation
+and is the more likely to prevent instructions from being reordered.
+Algorithm 2 was designed to be a compromise between the relatively
+conservative approach taken by algorithm 1 and the rather aggressive
+approach taken by the default scheduler. It relies more heavily on
+having a regular register file and accurate register pressure classes.
+See @file{haifa-sched.c} in the GCC sources for more details.
+
+The default choice depends on the target.
@end table
@end table
diff --git a/gcc/flag-types.h b/gcc/flag-types.h
index eb2da4f..f757423 100644
--- a/gcc/flag-types.h
+++ b/gcc/flag-types.h
@@ -106,14 +106,6 @@ enum symbol_visibility
};
#endif
-/* The algorithm used to implement -fsched-pressure. */
-enum sched_pressure_algorithm
-{
- SCHED_PRESSURE_NONE,
- SCHED_PRESSURE_WEIGHTED,
- SCHED_PRESSURE_MODEL
-};
-
/* The algorithm used for the integrated register allocator (IRA). */
enum ira_algorithm
{
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index b959bc5..9ec005a 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -6229,7 +6229,8 @@ sched_init (void)
if (flag_sched_pressure
&& !reload_completed
&& common_sched_info->sched_pass_id == SCHED_RGN_PASS)
- sched_pressure = flag_sched_pressure_algorithm;
+ sched_pressure = ((enum sched_pressure_algorithm)
+ PARAM_VALUE (PARAM_SCHED_PRESSURE_ALGORITHM));
else
sched_pressure = SCHED_PRESSURE_NONE;
diff --git a/gcc/params.def b/gcc/params.def
index 27db782..ad2cf43 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -979,6 +979,12 @@ DEFPARAM (PARAM_MAX_TRACKED_STRLENS,
"track string lengths",
1000, 0, 0)
+/* Keep this in sync with the sched_pressure_algorithm enum. */
+DEFPARAM (PARAM_SCHED_PRESSURE_ALGORITHM,
+ "sched-pressure-algorithm",
+ "Which -fsched-pressure algorithm to apply",
+ 1, 1, 2)
+
/*
Local variables:
mode:c
diff --git a/gcc/sched-int.h b/gcc/sched-int.h
index 06e21ac..fa5fc66 100644
--- a/gcc/sched-int.h
+++ b/gcc/sched-int.h
@@ -37,6 +37,14 @@ along with GCC; see the file COPYING3. If not see
enum sched_pass_id_t { SCHED_PASS_UNKNOWN, SCHED_RGN_PASS, SCHED_EBB_PASS,
SCHED_SMS_PASS, SCHED_SEL_PASS };
+/* The algorithm used to implement -fsched-pressure. */
+enum sched_pressure_algorithm
+{
+ SCHED_PRESSURE_NONE,
+ SCHED_PRESSURE_WEIGHTED,
+ SCHED_PRESSURE_MODEL
+};
+
typedef VEC (basic_block, heap) *bb_vec_t;
typedef VEC (rtx, heap) *insn_vec_t;
typedef VEC (rtx, heap) *rtx_vec_t;