diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2003-04-18 01:29:19 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2003-04-18 01:29:19 +0000 |
commit | 4d3eb89ac4bc25e9333d6be594f9e30fcd70b08f (patch) | |
tree | ba6dc32d068ba59b61380790c314c6c8efb852f5 | |
parent | dc93be8dce94babcd3f159154e6bc773ef8bdf15 (diff) | |
download | gcc-4d3eb89ac4bc25e9333d6be594f9e30fcd70b08f.zip gcc-4d3eb89ac4bc25e9333d6be594f9e30fcd70b08f.tar.gz gcc-4d3eb89ac4bc25e9333d6be594f9e30fcd70b08f.tar.bz2 |
gcse.c (compute_ld_motion_mems): For MEM destinations...
* gcse.c (compute_ld_motion_mems): For MEM destinations, only
consider those to be movable where the source matches
want_to_gcse_p.
(update_ld_motion_stores): In comment, refer to
compute_ld_motion_mems for validity of replacement.
From-SVN: r65766
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/gcse.c | 25 |
2 files changed, 23 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f128fe5..abbec33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2003-04-18 Hans-Peter Nilsson <hp@bitrange.com> + + * gcse.c (compute_ld_motion_mems): For MEM destinations, only + consider those to be movable where the source matches + want_to_gcse_p. + (update_ld_motion_stores): In comment, refer to + compute_ld_motion_mems for validity of replacement. + Fri Apr 18 01:28:51 CEST 2003 Jan Hubicka <jh@suse.cz> * gcov-dump.c (tag_summary): Remove max_sum @@ -6771,11 +6771,13 @@ invalidate_any_buried_refs (x) } } -/* Find all the 'simple' MEMs which are used in LOADs and STORES. Simple - being defined as MEM loads and stores to symbols, with no - side effects and no registers in the expression. If there are any - uses/defs which don't match this criteria, it is invalidated and - trimmed out later. */ +/* Find all the 'simple' MEMs which are used in LOADs and STORES. Simple + being defined as MEM loads and stores to symbols, with no side effects + and no registers in the expression. For a MEM destination, we also + check that the insn is still valid if we replace the destination with a + REG, as is done in update_ld_motion_stores. If there are any uses/defs + which don't match this criteria, they are invalidated and trimmed out + later. */ static void compute_ld_motion_mems () @@ -6823,7 +6825,10 @@ compute_ld_motion_mems () ptr = ldst_entry (dest); if (GET_CODE (src) != MEM - && GET_CODE (src) != ASM_OPERANDS) + && GET_CODE (src) != ASM_OPERANDS + /* Check for REG manually since want_to_gcse_p + returns 0 for all REGs. */ + && (REG_P (src) || want_to_gcse_p (src))) ptr->stores = alloc_INSN_LIST (insn, ptr->stores); else ptr->invalid = 1; @@ -6918,10 +6923,10 @@ update_ld_motion_stores (expr) matter to set the reaching reg everywhere... some might be dead and should be eliminated later. */ - /* We replace SET mem = expr with - SET reg = expr - SET mem = reg , where reg is the - reaching reg used in the load. */ + /* We replace (set mem expr) with (set reg expr) (set mem reg) + where reg is the reaching reg used in the load. We checked in + compute_ld_motion_mems that we can replace (set mem expr) with + (set reg expr) in that insn. */ rtx list = mem_ptr->stores; for ( ; list != NULL_RTX; list = XEXP (list, 1)) |