diff options
author | spark <spark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-07 16:46:54 +0000 |
---|---|---|
committer | spark <spark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-05-07 16:46:54 +0000 |
commit | 2d94e017b81e99347346317e2c505e201f1b516a (patch) | |
tree | efca3a11b6447634d482883da64e29d63ef7a443 | |
parent | 1ce061d3f78887640b9ac6ff30c781561cc3307d (diff) |
2007-05-07 Seongbae Park <seongbae.park@gmail.com>
* dse.c (add_wild_read): Do not remove read_info_t
that has non-zero alias_set.
(canon_address): Remove unused parameter for_read and bb_info.
Remove the unused code path, and update the dump message.
(record_store): Accomodate canon_address signature change.
(check_mem_read_rtx): Don't bail out early for wild_read.
(check_mem_read_rtx): Accomodate canon_address signature change.
(scan_insn): Move call insn handling after note_uses.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/dataflow-branch@124503 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.dataflow | 11 | ||||
-rw-r--r-- | gcc/dse.c | 64 |
2 files changed, 41 insertions, 34 deletions
diff --git a/gcc/ChangeLog.dataflow b/gcc/ChangeLog.dataflow index 0223a1a6bb9..9d708eb7399 100644 --- a/gcc/ChangeLog.dataflow +++ b/gcc/ChangeLog.dataflow @@ -1,3 +1,14 @@ +2007-05-07 Seongbae Park <seongbae.park@gmail.com> + + * dse.c (add_wild_read): Do not remove read_info_t + that has non-zero alias_set. + (canon_address): Remove unused parameter for_read and bb_info. + Remove the unused code path, and update the dump message. + (record_store): Accomodate canon_address signature change. + (check_mem_read_rtx): Don't bail out early for wild_read. + (check_mem_read_rtx): Accomodate canon_address signature change. + (scan_insn): Move call insn handling after note_uses. + 2007-05-05 Ramana Radhakrishnan <ramana.r@gmail.com> Serge Belyshev <belyshev@depni.sinp.msu.ru> Kenneth Zadeck <zadeck@naturalbridge.com> diff --git a/gcc/dse.c b/gcc/dse.c index 65335c5b2f3..1443000bd40 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -925,15 +925,19 @@ static void add_wild_read (bb_info_t bb_info) { insn_info_t insn_info = bb_info->last_insn; - read_info_t ptr = insn_info->read_rec; + read_info_t *ptr = &insn_info->read_rec; - while (ptr) + while (*ptr) { - read_info_t next = ptr->next; - pool_free (read_info_pool, ptr); - ptr = next; + read_info_t next = (*ptr)->next; + if ( (*ptr)->alias_set == 0 ) + { + pool_free (read_info_pool, *ptr); + *ptr = next; + } + else + ptr = &(*ptr)->next; } - insn_info->read_rec = NULL; insn_info->wild_read = true; active_local_stores = NULL; } @@ -958,7 +962,7 @@ add_wild_read (bb_info_t bb_info) FOR_READ is true if this is a mem read and false if not. */ static bool -canon_address (bool for_read, bb_info_t bb_info, rtx mem, +canon_address (rtx mem, HOST_WIDE_INT *alias_set_out, int *group_id, HOST_WIDE_INT *offset, @@ -1059,12 +1063,8 @@ canon_address (bool for_read, bb_info_t bb_info, rtx mem, *group_id = -1; if (*base == NULL) { - if (for_read) - { - add_wild_read (bb_info); - if (dump_file) - fprintf (dump_file, " adding wild read, no cselib val.\n"); - } + if (dump_file) + fprintf (dump_file, " no cselib val - should be a wild read.\n"); return false; } if (dump_file) @@ -1167,8 +1167,7 @@ record_store (rtx body, bb_info_t bb_info) if (MEM_VOLATILE_P (mem)) insn_info->cannot_delete = true; - if (!canon_address (false, bb_info, mem, - &spill_alias_set, &group_id, &offset, &base)) + if (!canon_address (mem, &spill_alias_set, &group_id, &offset, &base)) { clear_rhs_from_active_local_stores (); return 0; @@ -1467,9 +1466,6 @@ check_mem_read_rtx (rtx *loc, void *data) bb_info = (bb_info_t) data; insn_info = bb_info->last_insn; - if (insn_info->wild_read) - return 0; - if ((MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) || (MEM_VOLATILE_P (mem))) { @@ -1485,8 +1481,7 @@ check_mem_read_rtx (rtx *loc, void *data) if (MEM_READONLY_P (mem)) return 0; - if (!canon_address (true, bb_info, mem, - &spill_alias_set, &group_id, &offset, &base)) + if (!canon_address (mem, &spill_alias_set, &group_id, &offset, &base)) { if (dump_file) fprintf (dump_file, " adding wild read, canon_address failure.\n"); @@ -1727,6 +1722,21 @@ scan_insn (bb_info_t bb_info, rtx insn) insn_info->insn = insn; bb_info->last_insn = insn_info; + + /* Cselib clears the table for this case, so we have to essentually + do the same. */ + if (NONJUMP_INSN_P (insn) + && GET_CODE (PATTERN (insn)) == ASM_OPERANDS + && MEM_VOLATILE_P (PATTERN (insn))) + { + add_wild_read (bb_info); + insn_info->cannot_delete = true; + return; + } + + /* Look at all of the uses in the insn. */ + note_uses (&PATTERN (insn), check_mem_read_use, bb_info); + if (CALL_P (insn)) { insn_info->cannot_delete = true; @@ -1744,20 +1754,6 @@ scan_insn (bb_info_t bb_info, rtx insn) return; } - /* Cselib clears the table for this case, so we have to essentually - do the same. */ - if (NONJUMP_INSN_P (insn) - && GET_CODE (PATTERN (insn)) == ASM_OPERANDS - && MEM_VOLATILE_P (PATTERN (insn))) - { - add_wild_read (bb_info); - insn_info->cannot_delete = true; - return; - } - - /* Look at all of the uses in the insn. */ - note_uses (&PATTERN (insn), check_mem_read_use, bb_info); - #if 0 /* Look for memory reference in the notes. */ for_each_rtx (®_NOTES (insn), check_mem_read_rtx, bb_info); |