From: Jeff Law Date: Wed, 29 May 2002 16:53:46 +0000 (-0600) Subject: haifa-sched.c (schedule_block): Do not count USE and CLOBBER insns against the issue... X-Git-Tag: releases/gcc-3.3.0~4735 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=243e5500360c548ed93dd3f9fb06e7bf50420ec8;p=gcc.git haifa-sched.c (schedule_block): Do not count USE and CLOBBER insns against the issue rate. * haifa-sched.c (schedule_block): Do not count USE and CLOBBER insns against the issue rate. * sched-deps.c (sched_create_groups_for_libcalls): New function. (sched_analyze): Use it. From-SVN: r54004 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ff0f270de46..26ef675a9a39 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2002-05-29 Dale Johannesen + Michael Matz + David Edelsohn + Jeff Law + + * haifa-sched.c (schedule_block): Do not count USE and CLOBBER + insns against the issue rate. + + * sched-deps.c (sched_create_groups_for_libcalls): New function. + (sched_analyze): Use it. + 2002-05-29 Chris Lattner * ssa.c (rename_insn_1): Rename uses of undefined registers to @@ -3086,7 +3097,7 @@ doc: (mips_expand_prologue, mips_expand_epilogue): Update callers. (highpart_shift_operator): Attach ATTRIBUTE_UNUSED to mode argument. -Thu May 9 11:50:09 2002 Jeffrey A Law (law@cygnus.com) +Thu May 9 11:50:09 2002 Jeffrey A Law (law@redhat.com) * athlon.md, k6.md, pentium.md, ppro.md): New files. * i386.md: Move scheduling information into new files. @@ -4276,7 +4287,7 @@ Tue Apr 30 19:15:36 CEST 2002 Jan Hubicka (scheduling descriptions): Kill uses of fop1. (sse, mmx, fp patterns): Set type and mode properly. -Tue Apr 30 09:31:59 2002 Jeffrey A Law (law@cygnus.com) +Tue Apr 30 09:31:59 2002 Jeffrey A Law (law@redhat.com) * pa.c (override_options): Default to PA8000 scheduling. * doc/invoke.texi (HP-PA options): Mention newly added 7300 diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 63a31352a5b7..a03b9b346b48 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -2179,7 +2179,10 @@ schedule_block (b, rgn_n_insns) can_issue_more = (*targetm.sched.variable_issue) (sched_dump, sched_verbose, insn, can_issue_more); - else + /* A naked CLOBBER or USE generates no instruction, so do + not count them against the issue rate. */ + else if (GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER) can_issue_more--; schedule_insn (insn, &ready, clock_var); diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 0afb21bcf6b6..715463547770 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -88,6 +88,7 @@ static void flush_pending_lists PARAMS ((struct deps *, rtx, int, int)); static void sched_analyze_1 PARAMS ((struct deps *, rtx, rtx)); static void sched_analyze_2 PARAMS ((struct deps *, rtx, rtx)); static void sched_analyze_insn PARAMS ((struct deps *, rtx, rtx, rtx)); +static void sched_create_groups_for_libcalls PARAMS ((rtx, rtx)); static rtx group_leader PARAMS ((rtx)); static rtx get_condition PARAMS ((rtx)); @@ -1210,6 +1211,57 @@ sched_analyze_insn (deps, x, insn, loop_notes) } } +/* Find any libcall sequences between HEAD and TAIL inclusive; set + SCHED_GROUP_P appropriately for such sequences. */ + +static void +sched_create_groups_for_libcalls (head, tail) + rtx head, tail; +{ + rtx insn; + int tail_seen_p = 0; + + for (insn = head;; insn = NEXT_INSN (insn)) + { + rtx link, end_seq, set, r0, note; + if (INSN_P (insn) && GET_CODE (PATTERN (insn)) == CLOBBER + && (r0 = XEXP (PATTERN (insn), 0), GET_CODE (r0) == REG) + && (link = find_reg_note (insn, REG_LIBCALL, NULL_RTX)) != 0 + && (end_seq = XEXP (link, 0)) != 0 + && INSN_P (end_seq) + && (set = single_set (end_seq)) != 0 + && SET_DEST (set) == r0 && SET_SRC (set) == r0 + && (note = find_reg_note (end_seq, REG_EQUAL, NULL_RTX)) != 0) + { + /* We found a libcall block between insn and end_seq. + The inner insns should be scheduled in a block. */ + rtx inner; + /* Paranoia. */ + if (insn == tail) + tail_seen_p = 1; + /* We don't want to set this flag on the initial clobber, because + the semantic of SCHED_GROUP_P is to make insn be scheduled + together with the previous insn. */ + for (inner = NEXT_INSN (insn); inner; inner = NEXT_INSN (inner)) + { + if (INSN_P (inner)) + set_sched_group_p (inner); + /* Paranoia. */ + if (inner == tail) + tail_seen_p = 1; + if (inner == end_seq) + break; + } + /* We should be able to skip the whole lib-call block. + Remember that one NEXT_INSN is done in the loop-iteration. */ + insn = end_seq; + } + if (insn == tail || tail_seen_p) + break; + } + return; +} + /* Analyze every insn between HEAD and TAIL inclusive, creating LOG_LINKS for every dependency. */ @@ -1357,6 +1409,10 @@ sched_analyze (deps, head, tail) { if (current_sched_info->use_cselib) cselib_finish (); + + if (! reload_completed) + sched_create_groups_for_libcalls (head, tail); + return; } }