Commit 463301c3 by Jan Hubicka Committed by Jan Hubicka

cfgcleanup.c (thread_jump): Update call of cselib_init.

	* cfgcleanup.c (thread_jump): Update call of cselib_init.
	* cselib.c (cselib_record_memory): New static variable.
	(cselib_lookup_mem, cselib_record_set, cselib_record_sets):
	Give up on memories when asked for.
	(cselib_init): Accept new argument.
	* cselib.h (cselib_init): Update prototype.
	* gcse.c (local_cprop_pass): Update call of cselib_init.
	* loop.c (load_mems): Update call of cselib_init.
	* postreload.c (reload_cse_regs_1): Update call of cselib_init.
	* sched-deps.c (sched_analyze): Update call of cselib_init.

From-SVN: r78917
parent 3b6ce0af
2004-03-04 Jan Hubicka <jh@suse.cz>
* cfgcleanup.c (thread_jump): Update call of cselib_init.
* cselib.c (cselib_record_memory): New static variable.
(cselib_lookup_mem, cselib_record_set, cselib_record_sets):
Give up on memories when asked for.
(cselib_init): Accept new argument.
* cselib.h (cselib_init): Update prototype.
* gcse.c (local_cprop_pass): Update call of cselib_init.
* loop.c (load_mems): Update call of cselib_init.
* postreload.c (reload_cse_regs_1): Update call of cselib_init.
* sched-deps.c (sched_analyze): Update call of cselib_init.
2004-03-04 David Edelsohn <edelsohn@gnu.org> 2004-03-04 David Edelsohn <edelsohn@gnu.org>
GP <gp@qnx.com> GP <gp@qnx.com>
......
...@@ -349,7 +349,7 @@ thread_jump (int mode, edge e, basic_block b) ...@@ -349,7 +349,7 @@ thread_jump (int mode, edge e, basic_block b)
return NULL; return NULL;
} }
cselib_init (); cselib_init (false);
/* First process all values computed in the source basic block. */ /* First process all values computed in the source basic block. */
for (insn = NEXT_INSN (BB_HEAD (e->src)); insn != NEXT_INSN (BB_END (e->src)); for (insn = NEXT_INSN (BB_HEAD (e->src)); insn != NEXT_INSN (BB_END (e->src));
......
...@@ -42,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -42,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "params.h" #include "params.h"
#include "alloc-pool.h" #include "alloc-pool.h"
static bool cselib_record_memory;
static int entry_and_rtx_equal_p (const void *, const void *); static int entry_and_rtx_equal_p (const void *, const void *);
static hashval_t get_value_hash (const void *); static hashval_t get_value_hash (const void *);
static struct elt_list *new_elt_list (struct elt_list *, cselib_val *); static struct elt_list *new_elt_list (struct elt_list *, cselib_val *);
...@@ -748,6 +749,7 @@ cselib_lookup_mem (rtx x, int create) ...@@ -748,6 +749,7 @@ cselib_lookup_mem (rtx x, int create)
struct elt_list *l; struct elt_list *l;
if (MEM_VOLATILE_P (x) || mode == BLKmode if (MEM_VOLATILE_P (x) || mode == BLKmode
|| !cselib_record_memory
|| (FLOAT_MODE_P (mode) && flag_float_store)) || (FLOAT_MODE_P (mode) && flag_float_store))
return 0; return 0;
...@@ -1201,7 +1203,8 @@ cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt) ...@@ -1201,7 +1203,8 @@ cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt)
n_useless_values--; n_useless_values--;
src_elt->locs = new_elt_loc_list (src_elt->locs, dest); src_elt->locs = new_elt_loc_list (src_elt->locs, dest);
} }
else if (GET_CODE (dest) == MEM && dest_addr_elt != 0) else if (GET_CODE (dest) == MEM && dest_addr_elt != 0
&& cselib_record_memory)
{ {
if (src_elt->locs == 0) if (src_elt->locs == 0)
n_useless_values--; n_useless_values--;
...@@ -1275,7 +1278,8 @@ cselib_record_sets (rtx insn) ...@@ -1275,7 +1278,8 @@ cselib_record_sets (rtx insn)
sets[i].dest = dest = XEXP (dest, 0); sets[i].dest = dest = XEXP (dest, 0);
/* We don't know how to record anything but REG or MEM. */ /* We don't know how to record anything but REG or MEM. */
if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM) if (GET_CODE (dest) == REG
|| (GET_CODE (dest) == MEM && cselib_record_memory))
{ {
rtx src = sets[i].src; rtx src = sets[i].src;
if (cond) if (cond)
...@@ -1320,7 +1324,8 @@ cselib_record_sets (rtx insn) ...@@ -1320,7 +1324,8 @@ cselib_record_sets (rtx insn)
for (i = 0; i < n_sets; i++) for (i = 0; i < n_sets; i++)
{ {
rtx dest = sets[i].dest; rtx dest = sets[i].dest;
if (GET_CODE (dest) == REG || GET_CODE (dest) == MEM) if (GET_CODE (dest) == REG
|| (GET_CODE (dest) == MEM && cselib_record_memory))
cselib_record_set (dest, sets[i].src_elt, sets[i].dest_addr_elt); cselib_record_set (dest, sets[i].src_elt, sets[i].dest_addr_elt);
} }
} }
...@@ -1398,7 +1403,7 @@ cselib_process_insn (rtx insn) ...@@ -1398,7 +1403,7 @@ cselib_process_insn (rtx insn)
init_alias_analysis. */ init_alias_analysis. */
void void
cselib_init (void) cselib_init (bool record_memory)
{ {
elt_list_pool = create_alloc_pool ("elt_list", elt_list_pool = create_alloc_pool ("elt_list",
sizeof (struct elt_list), 10); sizeof (struct elt_list), 10);
...@@ -1408,6 +1413,7 @@ cselib_init (void) ...@@ -1408,6 +1413,7 @@ cselib_init (void)
sizeof (cselib_val), 10); sizeof (cselib_val), 10);
value_pool = create_alloc_pool ("value", value_pool = create_alloc_pool ("value",
RTX_SIZE (VALUE), 100); RTX_SIZE (VALUE), 100);
cselib_record_memory = record_memory;
/* This is only created once. */ /* This is only created once. */
if (! callmem) if (! callmem)
callmem = gen_rtx_MEM (BLKmode, const0_rtx); callmem = gen_rtx_MEM (BLKmode, const0_rtx);
......
...@@ -64,7 +64,7 @@ struct elt_list GTY(()) ...@@ -64,7 +64,7 @@ struct elt_list GTY(())
}; };
extern cselib_val *cselib_lookup (rtx, enum machine_mode, int); extern cselib_val *cselib_lookup (rtx, enum machine_mode, int);
extern void cselib_init (void); extern void cselib_init (bool record_memory);
extern void cselib_finish (void); extern void cselib_finish (void);
extern void cselib_process_insn (rtx); extern void cselib_process_insn (rtx);
extern enum machine_mode cselib_reg_set_mode (rtx); extern enum machine_mode cselib_reg_set_mode (rtx);
......
...@@ -4407,7 +4407,7 @@ local_cprop_pass (int alter_jumps) ...@@ -4407,7 +4407,7 @@ local_cprop_pass (int alter_jumps)
rtx libcall_stack[MAX_NESTED_LIBCALLS + 1], *libcall_sp; rtx libcall_stack[MAX_NESTED_LIBCALLS + 1], *libcall_sp;
bool changed = false; bool changed = false;
cselib_init (); cselib_init (false);
libcall_sp = &libcall_stack[MAX_NESTED_LIBCALLS]; libcall_sp = &libcall_stack[MAX_NESTED_LIBCALLS];
*libcall_sp = 0; *libcall_sp = 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
......
...@@ -9797,7 +9797,7 @@ load_mems (const struct loop *loop) ...@@ -9797,7 +9797,7 @@ load_mems (const struct loop *loop)
; ;
prev_ebb_head = p; prev_ebb_head = p;
cselib_init (); cselib_init (true);
/* Build table of mems that get set to constant values before the /* Build table of mems that get set to constant values before the
loop. */ loop. */
......
...@@ -181,7 +181,7 @@ reload_cse_regs_1 (rtx first) ...@@ -181,7 +181,7 @@ reload_cse_regs_1 (rtx first)
rtx insn; rtx insn;
rtx testreg = gen_rtx_REG (VOIDmode, -1); rtx testreg = gen_rtx_REG (VOIDmode, -1);
cselib_init (); cselib_init (true);
init_alias_analysis (); init_alias_analysis ();
for (insn = first; insn; insn = NEXT_INSN (insn)) for (insn = first; insn; insn = NEXT_INSN (insn))
......
...@@ -1156,7 +1156,7 @@ sched_analyze (struct deps *deps, rtx head, rtx tail) ...@@ -1156,7 +1156,7 @@ sched_analyze (struct deps *deps, rtx head, rtx tail)
rtx loop_notes = 0; rtx loop_notes = 0;
if (current_sched_info->use_cselib) if (current_sched_info->use_cselib)
cselib_init (); cselib_init (true);
for (insn = head;; insn = NEXT_INSN (insn)) for (insn = head;; insn = NEXT_INSN (insn))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment