re PR rtl-optimization/52203 (ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7136 with -fsel-sched-pipelining -fselective-scheduling2 and other custom flags)
PR rtl-optimization/52203 * sel-sched.c (estimate_insn_cost): New parameter pempty. Adjust all callers to pass NULL except ... (reset_sched_cycles_in_current_ebb): ... here, save the value in new variable 'empty'. Increase issue_rate only for non-empty insns. From-SVN: r185036
This commit is contained in:
parent
d6baa4460b
commit
3f1960accc
|
@ -1,3 +1,12 @@
|
||||||
|
2012-03-07 Andrey Belevantsev <abel@ispras.ru>
|
||||||
|
|
||||||
|
PR rtl-optimization/52203
|
||||||
|
* sel-sched.c (estimate_insn_cost): New parameter pempty. Adjust
|
||||||
|
all callers to pass NULL except ...
|
||||||
|
(reset_sched_cycles_in_current_ebb): ... here, save the value
|
||||||
|
in new variable 'empty'. Increase issue_rate only for
|
||||||
|
non-empty insns.
|
||||||
|
|
||||||
2012-03-07 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2012-03-07 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
PR target/51417
|
PR target/51417
|
||||||
|
|
|
@ -4265,9 +4265,10 @@ invoke_aftermath_hooks (fence_t fence, rtx best_insn, int issue_more)
|
||||||
return issue_more;
|
return issue_more;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Estimate the cost of issuing INSN on DFA state STATE. */
|
/* Estimate the cost of issuing INSN on DFA state STATE. Write to PEMPTY
|
||||||
|
true when INSN does not change the processor state. */
|
||||||
static int
|
static int
|
||||||
estimate_insn_cost (rtx insn, state_t state)
|
estimate_insn_cost (rtx insn, state_t state, bool *pempty)
|
||||||
{
|
{
|
||||||
static state_t temp = NULL;
|
static state_t temp = NULL;
|
||||||
int cost;
|
int cost;
|
||||||
|
@ -4277,6 +4278,8 @@ estimate_insn_cost (rtx insn, state_t state)
|
||||||
|
|
||||||
memcpy (temp, state, dfa_state_size);
|
memcpy (temp, state, dfa_state_size);
|
||||||
cost = state_transition (temp, insn);
|
cost = state_transition (temp, insn);
|
||||||
|
if (pempty)
|
||||||
|
*pempty = (memcmp (temp, state, dfa_state_size) == 0);
|
||||||
|
|
||||||
if (cost < 0)
|
if (cost < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -4307,7 +4310,7 @@ get_expr_cost (expr_t expr, fence_t fence)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return estimate_insn_cost (insn, FENCE_STATE (fence));
|
return estimate_insn_cost (insn, FENCE_STATE (fence), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the best insn for scheduling, either via max_issue or just take
|
/* Find the best insn for scheduling, either via max_issue or just take
|
||||||
|
@ -7020,7 +7023,7 @@ reset_sched_cycles_in_current_ebb (void)
|
||||||
{
|
{
|
||||||
int cost, haifa_cost;
|
int cost, haifa_cost;
|
||||||
int sort_p;
|
int sort_p;
|
||||||
bool asm_p, real_insn, after_stall, all_issued;
|
bool asm_p, real_insn, after_stall, all_issued, empty;
|
||||||
int clock;
|
int clock;
|
||||||
|
|
||||||
if (!INSN_P (insn))
|
if (!INSN_P (insn))
|
||||||
|
@ -7047,7 +7050,7 @@ reset_sched_cycles_in_current_ebb (void)
|
||||||
haifa_cost = 0;
|
haifa_cost = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
haifa_cost = estimate_insn_cost (insn, curr_state);
|
haifa_cost = estimate_insn_cost (insn, curr_state, &empty);
|
||||||
|
|
||||||
/* Stall for whatever cycles we've stalled before. */
|
/* Stall for whatever cycles we've stalled before. */
|
||||||
after_stall = 0;
|
after_stall = 0;
|
||||||
|
@ -7081,7 +7084,7 @@ reset_sched_cycles_in_current_ebb (void)
|
||||||
if (!after_stall
|
if (!after_stall
|
||||||
&& real_insn
|
&& real_insn
|
||||||
&& haifa_cost > 0
|
&& haifa_cost > 0
|
||||||
&& estimate_insn_cost (insn, curr_state) == 0)
|
&& estimate_insn_cost (insn, curr_state, NULL) == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* When the data dependency stall is longer than the DFA stall,
|
/* When the data dependency stall is longer than the DFA stall,
|
||||||
|
@ -7093,7 +7096,7 @@ reset_sched_cycles_in_current_ebb (void)
|
||||||
if ((after_stall || all_issued)
|
if ((after_stall || all_issued)
|
||||||
&& real_insn
|
&& real_insn
|
||||||
&& haifa_cost == 0)
|
&& haifa_cost == 0)
|
||||||
haifa_cost = estimate_insn_cost (insn, curr_state);
|
haifa_cost = estimate_insn_cost (insn, curr_state, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
haifa_clock += i;
|
haifa_clock += i;
|
||||||
|
@ -7125,7 +7128,8 @@ reset_sched_cycles_in_current_ebb (void)
|
||||||
if (real_insn)
|
if (real_insn)
|
||||||
{
|
{
|
||||||
cost = state_transition (curr_state, insn);
|
cost = state_transition (curr_state, insn);
|
||||||
issued_insns++;
|
if (!empty)
|
||||||
|
issued_insns++;
|
||||||
|
|
||||||
if (sched_verbose >= 2)
|
if (sched_verbose >= 2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue