diff options
author | Andrey Belevantsev <abel@ispras.ru> | 2009-04-21 12:29:41 +0000 |
---|---|---|
committer | Andrey Belevantsev <abel@ispras.ru> | 2009-04-21 12:29:41 +0000 |
commit | 530b8dd2aae470e45a9b6de4472101be683e6fbb (patch) | |
tree | 96eebb520c0ced5174c64fa632d08d18d5672760 | |
parent | 963bcbfa2b9f70ab20c56c4fd6a2c72aed96baf3 (diff) |
* sel-sched.c (advance_one_cycle): Set FENCE_ISSUE_MOREsel-sched-branch
to can_issue_more.
(advance_state_on_fence): Likewise.
(sel_target_adjust_priority): Print debug output only when
sched_verbose >= 4, not 2.
(get_expr_cost): Do not issue all unique insns on the next cycle.
(fill_insns): Initialize can_issue_more from the value saved
with the fence.
* sel-sched-ir.c (flist_add): New parameter issue_more.
Init FENCE_ISSUE_MORE with it.
(merge_fences): Likewise.
(init_fences): Update call to flist_add.
(add_to_fences, add_clean_fence_to_fences,
add_dirty_fence_to_fences): Likewise.
(move_fence_to_fences): Update call to merge_fences.
* sel-sched-ir.h (struct _fence): New field issue_more.
(FENCE_ISSUE_MORE): New accessor macro.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/sel-sched-branch@146520 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.sel-sched | 19 | ||||
-rw-r--r-- | gcc/sel-sched-ir.c | 25 | ||||
-rw-r--r-- | gcc/sel-sched-ir.h | 4 | ||||
-rw-r--r-- | gcc/sel-sched.c | 12 |
4 files changed, 46 insertions, 14 deletions
diff --git a/gcc/ChangeLog.sel-sched b/gcc/ChangeLog.sel-sched index 91c357efc9e..13336a30405 100644 --- a/gcc/ChangeLog.sel-sched +++ b/gcc/ChangeLog.sel-sched @@ -1,4 +1,23 @@ 2009-04-21 Andrey Belevantsev <abel@ispras.ru + * sel-sched.c (advance_one_cycle): Set FENCE_ISSUE_MORE + to can_issue_more. + (advance_state_on_fence): Likewise. + (sel_target_adjust_priority): Print debug output only when + sched_verbose >= 4, not 2. + (get_expr_cost): Do not issue all unique insns on the next cycle. + (fill_insns): Initialize can_issue_more from the value saved + with the fence. + * sel-sched-ir.c (flist_add): New parameter issue_more. + Init FENCE_ISSUE_MORE with it. + (merge_fences): Likewise. + (init_fences): Update call to flist_add. + (add_to_fences, add_clean_fence_to_fences, + add_dirty_fence_to_fences): Likewise. + (move_fence_to_fences): Update call to merge_fences. + * sel-sched-ir.h (struct _fence): New field issue_more. + (FENCE_ISSUE_MORE): New accessor macro. + +2009-04-21 Andrey Belevantsev <abel@ispras.ru * sel-sched.c (try_replace_dest_reg): When chosen register and original register is the same, do not bail out early, but still check all original insns for validity of replacing destination diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 1d52114dc0f..88581f5f3aa 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -261,7 +261,7 @@ static void flist_add (flist_t *lp, insn_t insn, state_t state, deps_t dc, void *tc, insn_t last_scheduled_insn, VEC(rtx,gc) *executing_insns, int *ready_ticks, int ready_ticks_size, insn_t sched_next, - int cycle, int cycle_issued_insns, + int cycle, int cycle_issued_insns, int issue_more, bool starts_cycle_p, bool after_stall_p) { fence_t f; @@ -286,6 +286,7 @@ flist_add (flist_t *lp, insn_t insn, state_t state, deps_t dc, void *tc, FENCE_TC (f) = tc; FENCE_LAST_SCHEDULED_INSN (f) = last_scheduled_insn; + FENCE_ISSUE_MORE (f) = issue_more; FENCE_EXECUTING_INSNS (f) = executing_insns; FENCE_READY_TICKS (f) = ready_ticks; FENCE_READY_TICKS_SIZE (f) = ready_ticks_size; @@ -617,6 +618,7 @@ init_fences (insn_t old_fence) ready_ticks_size, NULL_RTX /* sched_next */, 1 /* cycle */, 0 /* cycle_issued_insns */, + issue_rate, /* issue_more */ 1 /* starts_cycle_p */, 0 /* after_stall_p */); } } @@ -628,14 +630,14 @@ init_fences (insn_t old_fence) 3) all other fields are set to corresponding constant values. INSN, STATE, DC, TC, LAST_SCHEDULED_INSN, EXECUTING_INSNS, - READY_TICKS, READY_TICKS_SIZE, SCHED_NEXT, CYCLE and AFTER_STALL_P - are the corresponding fields of the second fence. */ + READY_TICKS, READY_TICKS_SIZE, SCHED_NEXT, CYCLE, ISSUE_MORE + and AFTER_STALL_P are the corresponding fields of the second fence. */ static void merge_fences (fence_t f, insn_t insn, state_t state, deps_t dc, void *tc, rtx last_scheduled_insn, VEC(rtx, gc) *executing_insns, int *ready_ticks, int ready_ticks_size, - rtx sched_next, int cycle, bool after_stall_p) + rtx sched_next, int cycle, int issue_more, bool after_stall_p) { insn_t last_scheduled_insn_old = FENCE_LAST_SCHEDULED_INSN (f); @@ -665,6 +667,7 @@ merge_fences (fence_t f, insn_t insn, FENCE_CYCLE (f) = cycle; FENCE_LAST_SCHEDULED_INSN (f) = NULL; + FENCE_ISSUE_MORE (f) = issue_rate; VEC_free (rtx, gc, executing_insns); free (ready_ticks); if (FENCE_EXECUTING_INSNS (f)) @@ -696,6 +699,7 @@ merge_fences (fence_t f, insn_t insn, delete_target_context (tc); FENCE_LAST_SCHEDULED_INSN (f) = NULL; + FENCE_ISSUE_MORE (f) = issue_rate; } else if (candidate->src == BLOCK_FOR_INSN (last_scheduled_insn)) @@ -712,6 +716,7 @@ merge_fences (fence_t f, insn_t insn, FENCE_TC (f) = tc; FENCE_LAST_SCHEDULED_INSN (f) = last_scheduled_insn; + FENCE_ISSUE_MORE (f) = issue_more; } else { @@ -798,7 +803,8 @@ add_to_fences (flist_tail_t new_fences, insn_t insn, state_t state, deps_t dc, void *tc, rtx last_scheduled_insn, VEC(rtx, gc) *executing_insns, int *ready_ticks, int ready_ticks_size, rtx sched_next, int cycle, - int cycle_issued_insns, bool starts_cycle_p, bool after_stall_p) + int cycle_issued_insns, int issue_rate, + bool starts_cycle_p, bool after_stall_p) { fence_t f = flist_lookup (FLIST_TAIL_HEAD (new_fences), insn); @@ -807,7 +813,7 @@ add_to_fences (flist_tail_t new_fences, insn_t insn, flist_add (FLIST_TAIL_TAILP (new_fences), insn, state, dc, tc, last_scheduled_insn, executing_insns, ready_ticks, ready_ticks_size, sched_next, cycle, cycle_issued_insns, - starts_cycle_p, after_stall_p); + issue_rate, starts_cycle_p, after_stall_p); FLIST_TAIL_TAILP (new_fences) = &FLIST_NEXT (*FLIST_TAIL_TAILP (new_fences)); @@ -816,7 +822,7 @@ add_to_fences (flist_tail_t new_fences, insn_t insn, { merge_fences (f, insn, state, dc, tc, last_scheduled_insn, executing_insns, ready_ticks, ready_ticks_size, - sched_next, cycle, after_stall_p); + sched_next, cycle, issue_rate, after_stall_p); } } @@ -835,7 +841,7 @@ move_fence_to_fences (flist_t old_fences, flist_tail_t new_fences) merge_fences (f, old->insn, old->state, old->dc, old->tc, old->last_scheduled_insn, old->executing_insns, old->ready_ticks, old->ready_ticks_size, - old->sched_next, old->cycle, + old->sched_next, old->cycle, old->issue_more, old->after_stall_p); } else @@ -861,7 +867,7 @@ add_clean_fence_to_fences (flist_tail_t new_fences, insn_t succ, fence_t fence) NULL_RTX, NULL, XCNEWVEC (int, ready_ticks_size), ready_ticks_size, NULL_RTX, FENCE_CYCLE (fence) + 1, - 0, 1, FENCE_AFTER_STALL_P (fence)); + 0, issue_rate, 1, FENCE_AFTER_STALL_P (fence)); } /* Add a new fence to NEW_FENCES list and initialize all of its data @@ -885,6 +891,7 @@ add_dirty_fence_to_fences (flist_tail_t new_fences, insn_t succ, fence_t fence) FENCE_SCHED_NEXT (fence), FENCE_CYCLE (fence), FENCE_ISSUED_INSNS (fence), + FENCE_ISSUE_MORE (fence), FENCE_STARTS_CYCLE_P (fence), FENCE_AFTER_STALL_P (fence)); } diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h index 3d219e1568a..daf839fc9f9 100644 --- a/gcc/sel-sched-ir.h +++ b/gcc/sel-sched-ir.h @@ -296,6 +296,9 @@ struct _fence /* Insn, which has been scheduled last on this fence. */ rtx last_scheduled_insn; + /* The last value of can_issue_more variable on this fence. */ + int issue_more; + /* If non-NULL force the next scheduled insn to be SCHED_NEXT. */ rtx sched_next; @@ -325,6 +328,7 @@ typedef struct _fence *fence_t; #define FENCE_DC(F) ((F)->dc) #define FENCE_TC(F) ((F)->tc) #define FENCE_LAST_SCHEDULED_INSN(F) ((F)->last_scheduled_insn) +#define FENCE_ISSUE_MORE(F) ((F)->issue_more) #define FENCE_EXECUTING_INSNS(F) ((F)->executing_insns) #define FENCE_READY_TICKS(F) ((F)->ready_ticks) #define FENCE_READY_TICKS_SIZE(F) ((F)->ready_ticks_size) diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 32a3354ea0b..2b4a17380a1 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -587,6 +587,7 @@ advance_one_cycle (fence_t fence) FENCE_ISSUED_INSNS (fence) = 0; FENCE_STARTS_CYCLE_P (fence) = 1; can_issue_more = issue_rate; + FENCE_ISSUE_MORE (fence) = can_issue_more; for (i = 0; VEC_iterate (rtx, FENCE_EXECUTING_INSNS (fence), i, insn); ) { @@ -3235,8 +3236,8 @@ sel_target_adjust_priority (expr_t expr) gcc_assert (EXPR_PRIORITY_ADJ (expr) >= 0); - if (sched_verbose >= 2) - sel_print ("sel_target_adjust_priority: insn %d, %d +%d = %d.\n", + if (sched_verbose >= 4) + sel_print ("sel_target_adjust_priority: insn %d, %d+%d = %d.\n", INSN_UID (EXPR_INSN_RTX (expr)), EXPR_PRIORITY (expr), EXPR_PRIORITY_ADJ (expr), new_priority); @@ -4225,8 +4226,6 @@ get_expr_cost (expr_t expr, fence_t fence) if (recog_memoized (insn) < 0) { if (!FENCE_STARTS_CYCLE_P (fence) - /* FIXME: Is this condition necessary? */ - && VINSN_UNIQUE_P (EXPR_VINSN (expr)) && INSN_ASM_P (insn)) /* This is asm insn which is tryed to be issued on the cycle not first. Issue it on the next cycle. */ @@ -5039,7 +5038,9 @@ advance_state_on_fence (fence_t fence, insn_t insn) if (sched_verbose >= 2) debug_state (FENCE_STATE (fence)); + FENCE_STARTS_CYCLE_P (fence) = 0; + FENCE_ISSUE_MORE (fence) = can_issue_more; return asm_p; } @@ -5092,7 +5093,7 @@ update_fence_and_insn (fence_t fence, insn_t insn, int need_stall) /* Print debug information when insn's fields are updated. */ if (sched_verbose >= 2) { - sel_print ("Scheduling insn: "); + sel_print ("Scheduling insn (%p): ", (void *) insn); dump_insn_1 (insn, 1); sel_print ("\n"); } @@ -5221,6 +5222,7 @@ fill_insns (fence_t fence, int seqno, ilist_t **scheduled_insns_tailpp) blist_add (&bnds, insn, NULL, FENCE_DC (fence)); bnds_tailp = &BLIST_NEXT (bnds); set_target_context (FENCE_TC (fence)); + can_issue_more = FENCE_ISSUE_MORE (fence); target_bb = INSN_BB (insn); /* Do while we can add any operation to the current group. */ |