summaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorgshobaki <gshobaki@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-13 22:42:41 +0000
committergshobaki <gshobaki@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-13 22:42:41 +0000
commit4d56938604b6c93387385b82ab359421996d9097 (patch)
treec7a87beae76242d4de327015672f1d1de55e0afe /gcc/haifa-sched.c
parentcc67441db7d55a680cce1a28c6b18bdaa107618f (diff)
downloadgcc-4d56938604b6c93387385b82ab359421996d9097.tar.gz
2009-07-13 Ghassan Shobaki <ghassan.shobaki@amd.com>
* haifa-sched.c (rank_for_schedule): Introduced flags to enable/disable individual scheduling heuristics. * common.opt: Introduced flags to enable/disable individual heuristics in the scheduler. * doc/invoke.texi: Introduced flags to enable/disable individual heuristics in the scheduler. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149603 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 66be7e5d94b..95cbfc1b1a8 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -890,7 +890,8 @@ rank_for_schedule (const void *x, const void *y)
int val, priority_val, weight_val, info_val;
/* The insn in a schedule group should be issued the first. */
- if (SCHED_GROUP_P (tmp) != SCHED_GROUP_P (tmp2))
+ if (flag_sched_group_heuristic &&
+ SCHED_GROUP_P (tmp) != SCHED_GROUP_P (tmp2))
return SCHED_GROUP_P (tmp2) ? 1 : -1;
/* Make sure that priority of TMP and TMP2 are initialized. */
@@ -899,11 +900,11 @@ rank_for_schedule (const void *x, const void *y)
/* Prefer insn with higher priority. */
priority_val = INSN_PRIORITY (tmp2) - INSN_PRIORITY (tmp);
- if (priority_val)
+ if (flag_sched_critical_path_heuristic && priority_val)
return priority_val;
/* Prefer speculative insn with greater dependencies weakness. */
- if (spec_info)
+ if (flag_sched_spec_insn_heuristic && spec_info)
{
ds_t ds1, ds2;
dw_t dw1, dw2;
@@ -927,16 +928,16 @@ rank_for_schedule (const void *x, const void *y)
}
/* Prefer an insn with smaller contribution to registers-pressure. */
- if (!reload_completed &&
+ if (flag_sched_reg_pressure_heuristic && !reload_completed &&
(weight_val = INSN_REG_WEIGHT (tmp) - INSN_REG_WEIGHT (tmp2)))
return weight_val;
info_val = (*current_sched_info->rank) (tmp, tmp2);
- if (info_val)
+ if(flag_sched_rank_heuristic && info_val)
return info_val;
/* Compare insns based on their relation to the last-scheduled-insn. */
- if (INSN_P (last_scheduled_insn))
+ if (flag_sched_last_insn_heuristic && INSN_P (last_scheduled_insn))
{
dep_t dep1;
dep_t dep2;
@@ -977,7 +978,7 @@ rank_for_schedule (const void *x, const void *y)
val = (sd_lists_size (tmp2, SD_LIST_FORW)
- sd_lists_size (tmp, SD_LIST_FORW));
- if (val != 0)
+ if (flag_sched_dep_count_heuristic && val != 0)
return val;
/* If insns are equally good, sort by INSN_LUID (original insn order),