diff options
author | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-26 13:59:22 +0000 |
---|---|---|
committer | amacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-07-26 13:59:22 +0000 |
commit | 85de291ed5d11eab35e18498b64be4c807cb39f5 (patch) | |
tree | d529585912a27f24d918c1691b52427ec3a93d8a /gcc/sched-deps.c | |
parent | f99445ceede4ac11d54ce93c78a61c3c9e38dc66 (diff) | |
download | gcc-85de291ed5d11eab35e18498b64be4c807cb39f5.tar.gz |
2001-07-26 Andrew MacLeod <amacleod@redhat.com>
* params.def (PARAM_MAX_PENDING_LIST_LENGTH): Add parameter to
limit length of dependancy flush list.
* params.h (MAX_PENDING_LIST_LENGTH): Define.
* sched-int.h (struct deps): Add pending_flush_length field.
* sched-deps.c (flush_pending_lists): Last_pending_memory_flush now
has 1 element in it.
(sched_analyze_1): Use MAX_PENDING_LIST_LENGTH.
(sched_analyze): After a jump, if the pending memory flush list is too
large, flush the pending lists.
(init_deps): Initialize pending_flush_length to 0.
* doc/invoke.texi (max_pending_list_length): Document parameter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r-- | gcc/sched-deps.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 422b39485d3..3f4b1290d7c 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -38,6 +38,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "recog.h" #include "sched-int.h" +#include "params.h" extern char *reg_known_equiv_p; extern rtx *reg_known_value; @@ -534,6 +535,7 @@ flush_pending_lists (deps, insn, only_write) free_INSN_LIST_list (&deps->last_pending_memory_flush); deps->last_pending_memory_flush = alloc_INSN_LIST (insn, NULL_RTX); + deps->pending_flush_length = 1; } /* Analyze a single SET, CLOBBER, PRE_DEC, POST_DEC, PRE_INC or POST_INC @@ -675,14 +677,13 @@ sched_analyze_1 (deps, x, insn) { /* Writing memory. */ - if (deps->pending_lists_length > 32) + if (deps->pending_lists_length > MAX_PENDING_LIST_LENGTH) { /* Flush all pending reads and writes to prevent the pending lists from getting any larger. Insn scheduling runs too slowly when - these lists get long. The number 32 was chosen because it - seems like a reasonable number. When compiling GCC with itself, + these lists get long. When compiling GCC with itself, this flush occurs 8 times for sparc, and 10 times for m88k using - the number 32. */ + the default value of 32. */ flush_pending_lists (deps, insn, 0); } else @@ -1246,8 +1247,14 @@ sched_analyze (deps, head, tail) /* Make each JUMP_INSN a scheduling barrier for memory references. */ if (GET_CODE (insn) == JUMP_INSN) - deps->last_pending_memory_flush - = alloc_INSN_LIST (insn, deps->last_pending_memory_flush); + { + /* Keep the list a reasonable size. */ + if (deps->pending_flush_length++ > MAX_PENDING_LIST_LENGTH) + flush_pending_lists (deps, insn, 0); + else + deps->last_pending_memory_flush + = alloc_INSN_LIST (insn, deps->last_pending_memory_flush); + } sched_analyze_insn (deps, PATTERN (insn), insn, loop_notes); loop_notes = 0; } @@ -1473,6 +1480,7 @@ init_deps (deps) deps->pending_write_insns = 0; deps->pending_write_mems = 0; deps->pending_lists_length = 0; + deps->pending_flush_length = 0; deps->last_pending_memory_flush = 0; deps->last_function_call = 0; deps->in_post_call_group_p = 0; |