summaryrefslogtreecommitdiff
path: root/gcc/sel-sched.c
diff options
context:
space:
mode:
authorabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-13 09:36:42 +0000
committerabel <abel@138bc75d-0d04-0410-961f-82ee72b054a4>2012-04-13 09:36:42 +0000
commit30474b14bbc3623f848946b8873ec4f7599170dd (patch)
treeb3ac87c736a413b3a27159041e762bb457b93798 /gcc/sel-sched.c
parentd1d7b24c1e751dc5fa0e6f945bb74a9ce0bbb0bd (diff)
downloadgcc-30474b14bbc3623f848946b8873ec4f7599170dd.tar.gz
PR rtl-optimization/52203
PR rtl-optimization/52715 Revert the 2012-03-07 fix for PR 52203. * sel-sched.c (reset_sched_cycles_in_current_ebb): Check that the insn does not modify DFA right before issuing, adjust issue_rate accordingly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186410 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r--gcc/sel-sched.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 4e13230ed69..ce38fa0e59f 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -4265,10 +4265,9 @@ invoke_aftermath_hooks (fence_t fence, rtx best_insn, int issue_more)
return issue_more;
}
-/* Estimate the cost of issuing INSN on DFA state STATE. Write to PEMPTY
- true when INSN does not change the processor state. */
+/* Estimate the cost of issuing INSN on DFA state STATE. */
static int
-estimate_insn_cost (rtx insn, state_t state, bool *pempty)
+estimate_insn_cost (rtx insn, state_t state)
{
static state_t temp = NULL;
int cost;
@@ -4278,8 +4277,6 @@ estimate_insn_cost (rtx insn, state_t state, bool *pempty)
memcpy (temp, state, dfa_state_size);
cost = state_transition (temp, insn);
- if (pempty)
- *pempty = (memcmp (temp, state, dfa_state_size) == 0);
if (cost < 0)
return 0;
@@ -4310,7 +4307,7 @@ get_expr_cost (expr_t expr, fence_t fence)
return 0;
}
else
- return estimate_insn_cost (insn, FENCE_STATE (fence), NULL);
+ return estimate_insn_cost (insn, FENCE_STATE (fence));
}
/* Find the best insn for scheduling, either via max_issue or just take
@@ -7023,7 +7020,7 @@ reset_sched_cycles_in_current_ebb (void)
{
int cost, haifa_cost;
int sort_p;
- bool asm_p, real_insn, after_stall, all_issued, empty;
+ bool asm_p, real_insn, after_stall, all_issued;
int clock;
if (!INSN_P (insn))
@@ -7050,7 +7047,7 @@ reset_sched_cycles_in_current_ebb (void)
haifa_cost = 0;
}
else
- haifa_cost = estimate_insn_cost (insn, curr_state, &empty);
+ haifa_cost = estimate_insn_cost (insn, curr_state);
/* Stall for whatever cycles we've stalled before. */
after_stall = 0;
@@ -7084,7 +7081,7 @@ reset_sched_cycles_in_current_ebb (void)
if (!after_stall
&& real_insn
&& haifa_cost > 0
- && estimate_insn_cost (insn, curr_state, NULL) == 0)
+ && estimate_insn_cost (insn, curr_state) == 0)
break;
/* When the data dependency stall is longer than the DFA stall,
@@ -7096,7 +7093,7 @@ reset_sched_cycles_in_current_ebb (void)
if ((after_stall || all_issued)
&& real_insn
&& haifa_cost == 0)
- haifa_cost = estimate_insn_cost (insn, curr_state, NULL);
+ haifa_cost = estimate_insn_cost (insn, curr_state);
}
haifa_clock += i;
@@ -7127,8 +7124,14 @@ reset_sched_cycles_in_current_ebb (void)
if (real_insn)
{
+ static state_t temp = NULL;
+
+ if (!temp)
+ temp = xmalloc (dfa_state_size);
+ memcpy (temp, curr_state, dfa_state_size);
+
cost = state_transition (curr_state, insn);
- if (!empty)
+ if (memcmp (temp, curr_state, dfa_state_size))
issued_insns++;
if (sched_verbose >= 2)