+2012-04-13 Andrey Belevantsev <abel@ispras.ru>
+
+ 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.
+
2012-04-13 Richard Guenther <rguenther@suse.de>
PR c/52549
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;
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;
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
{
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))
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;
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,
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;
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)