Commit 84fabdde by Jie Zhang Committed by Jie Zhang

haifa-sched.c (ISSUE_POINTS): Remove.

	* haifa-sched.c (ISSUE_POINTS): Remove.
	(max_issue): Don't issue more than issue_rate instructions.

Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>

From-SVN: r166002
parent 9c042d80
2010-10-27 Jie Zhang <jie@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
* haifa-sched.c (ISSUE_POINTS): Remove.
(max_issue): Don't issue more than issue_rate instructions.
2010-10-27 Ian Lance Taylor <iant@google.com> 2010-10-27 Ian Lance Taylor <iant@google.com>
PR target/46197 PR target/46197
...@@ -199,10 +199,6 @@ struct common_sched_info_def *common_sched_info; ...@@ -199,10 +199,6 @@ struct common_sched_info_def *common_sched_info;
/* The minimal value of the INSN_TICK of an instruction. */ /* The minimal value of the INSN_TICK of an instruction. */
#define MIN_TICK (-max_insn_queue_index) #define MIN_TICK (-max_insn_queue_index)
/* Issue points are used to distinguish between instructions in max_issue ().
For now, all instructions are equally good. */
#define ISSUE_POINTS(INSN) 1
/* List of important notes we must keep around. This is a pointer to the /* List of important notes we must keep around. This is a pointer to the
last element in the list. */ last element in the list. */
rtx note_list; rtx note_list;
...@@ -2444,8 +2440,7 @@ static int cached_issue_rate = 0; ...@@ -2444,8 +2440,7 @@ static int cached_issue_rate = 0;
insns is insns with the best rank (the first insn in READY). To insns is insns with the best rank (the first insn in READY). To
make this function tries different samples of ready insns. READY make this function tries different samples of ready insns. READY
is current queue `ready'. Global array READY_TRY reflects what is current queue `ready'. Global array READY_TRY reflects what
insns are already issued in this try. MAX_POINTS is the sum of points insns are already issued in this try. The function stops immediately,
of all instructions in READY. The function stops immediately,
if it reached the such a solution, that all instruction can be issued. if it reached the such a solution, that all instruction can be issued.
INDEX will contain index of the best insn in READY. The following INDEX will contain index of the best insn in READY. The following
function is used only for first cycle multipass scheduling. function is used only for first cycle multipass scheduling.
...@@ -2458,7 +2453,7 @@ int ...@@ -2458,7 +2453,7 @@ int
max_issue (struct ready_list *ready, int privileged_n, state_t state, max_issue (struct ready_list *ready, int privileged_n, state_t state,
int *index) int *index)
{ {
int n, i, all, n_ready, best, delay, tries_num, max_points; int n, i, all, n_ready, best, delay, tries_num;
int more_issue; int more_issue;
struct choice_entry *top; struct choice_entry *top;
rtx insn; rtx insn;
...@@ -2477,19 +2472,9 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state, ...@@ -2477,19 +2472,9 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
} }
/* Init max_points. */ /* Init max_points. */
max_points = 0;
more_issue = issue_rate - cycle_issued_insns; more_issue = issue_rate - cycle_issued_insns;
gcc_assert (more_issue >= 0); gcc_assert (more_issue >= 0);
for (i = 0; i < n_ready; i++)
if (!ready_try [i])
{
if (more_issue-- > 0)
max_points += ISSUE_POINTS (ready_element (ready, i));
else
break;
}
/* The number of the issued insns in the best solution. */ /* The number of the issued insns in the best solution. */
best = 0; best = 0;
...@@ -2513,12 +2498,17 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state, ...@@ -2513,12 +2498,17 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
if (/* If we've reached a dead end or searched enough of what we have if (/* If we've reached a dead end or searched enough of what we have
been asked... */ been asked... */
top->rest == 0 top->rest == 0
/* Or have nothing else to try. */ /* or have nothing else to try... */
|| i >= n_ready) || i >= n_ready
/* or should not issue more. */
|| top->n >= more_issue)
{ {
/* ??? (... || i == n_ready). */ /* ??? (... || i == n_ready). */
gcc_assert (i <= n_ready); gcc_assert (i <= n_ready);
/* We should not issue more than issue_rate instructions. */
gcc_assert (top->n <= more_issue);
if (top == choice_stack) if (top == choice_stack)
break; break;
...@@ -2541,7 +2531,7 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state, ...@@ -2541,7 +2531,7 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
/* This is the index of the insn issued first in this /* This is the index of the insn issued first in this
solution. */ solution. */
*index = choice_stack [1].index; *index = choice_stack [1].index;
if (top->n == max_points || best == all) if (top->n == more_issue || best == all)
break; break;
} }
} }
...@@ -2574,7 +2564,7 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state, ...@@ -2574,7 +2564,7 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
n = top->n; n = top->n;
if (memcmp (top->state, state, dfa_state_size) != 0) if (memcmp (top->state, state, dfa_state_size) != 0)
n += ISSUE_POINTS (insn); n++;
/* Advance to the next choice_entry. */ /* Advance to the next choice_entry. */
top++; top++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment