mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-02 16:23:56 +08:00
combine.c (gen_lowpart_for_combine): Update handling of subregs_of_mode
* combine.c (gen_lowpart_for_combine): Update handling of subregs_of_mode * flow.c (life_analysis, mark_used_regs): Likewise. * regclass.c (subregs_of_mode): Turn into single bitmap. (cannot_change-mode_set_regs, invalid_mode_change_p): Update dealing with subregs_of_mode * regs.h (subregs_of_mode): Update prototype. From-SVN: r63552
This commit is contained in:
parent
e459243b87
commit
10a3fdd926
@ -1,3 +1,13 @@
|
||||
Fri Feb 28 11:09:14 CET 2003 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* combine.c (gen_lowpart_for_combine): Update handling of
|
||||
subregs_of_mode
|
||||
* flow.c (life_analysis, mark_used_regs): Likewise.
|
||||
* regclass.c (subregs_of_mode): Turn into single bitmap.
|
||||
(cannot_change-mode_set_regs, invalid_mode_change_p): Update
|
||||
dealing with subregs_of_mode
|
||||
* regs.h (subregs_of_mode): Update prototype.
|
||||
|
||||
2003-02-28 Josef Zlomek <zlomekj@suse.cz>
|
||||
|
||||
* emit-rtl.c (set_reg_attrs_for_parm): New function.
|
||||
|
@ -10201,8 +10201,9 @@ gen_lowpart_for_combine (mode, x)
|
||||
&& GET_CODE (result) == SUBREG
|
||||
&& GET_CODE (SUBREG_REG (result)) == REG
|
||||
&& REGNO (SUBREG_REG (result)) >= FIRST_PSEUDO_REGISTER)
|
||||
SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (result)],
|
||||
REGNO (SUBREG_REG (result)));
|
||||
bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (result))
|
||||
* MAX_MACHINE_MODE
|
||||
+ GET_MODE (result));
|
||||
#endif
|
||||
|
||||
if (result)
|
||||
|
16
gcc/flow.c
16
gcc/flow.c
@ -436,11 +436,7 @@ life_analysis (f, file, flags)
|
||||
|
||||
#ifdef CANNOT_CHANGE_MODE_CLASS
|
||||
if (flags & PROP_REG_INFO)
|
||||
{
|
||||
int j;
|
||||
for (j=0; j < NUM_MACHINE_MODES; ++j)
|
||||
INIT_REG_SET (&subregs_of_mode[j]);
|
||||
}
|
||||
bitmap_initialize (&subregs_of_mode, 1);
|
||||
#endif
|
||||
|
||||
if (! optimize)
|
||||
@ -3845,8 +3841,9 @@ mark_used_regs (pbi, x, cond, insn)
|
||||
#ifdef CANNOT_CHANGE_MODE_CLASS
|
||||
if (GET_CODE (SUBREG_REG (x)) == REG
|
||||
&& REGNO (SUBREG_REG (x)) >= FIRST_PSEUDO_REGISTER)
|
||||
SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (x)],
|
||||
REGNO (SUBREG_REG (x)));
|
||||
bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (x))
|
||||
* MAX_MACHINE_MODE
|
||||
+ GET_MODE (x));
|
||||
#endif
|
||||
|
||||
/* While we're here, optimize this case. */
|
||||
@ -3894,8 +3891,9 @@ mark_used_regs (pbi, x, cond, insn)
|
||||
if (GET_CODE (testreg) == SUBREG
|
||||
&& GET_CODE (SUBREG_REG (testreg)) == REG
|
||||
&& REGNO (SUBREG_REG (testreg)) >= FIRST_PSEUDO_REGISTER)
|
||||
SET_REGNO_REG_SET (&subregs_of_mode[GET_MODE (testreg)],
|
||||
REGNO (SUBREG_REG (testreg)));
|
||||
bitmap_set_bit (&subregs_of_mode, REGNO (SUBREG_REG (testreg))
|
||||
* MAX_MACHINE_MODE
|
||||
+ GET_MODE (testreg));
|
||||
#endif
|
||||
|
||||
/* Modifying a single register in an alternate mode
|
||||
|
@ -428,9 +428,6 @@ reg_to_stack (first, file)
|
||||
/* Clean up previous run. */
|
||||
stack_regs_mentioned_data = 0;
|
||||
|
||||
if (!optimize)
|
||||
split_all_insns (0);
|
||||
|
||||
/* See if there is something to do. Flow analysis is quite
|
||||
expensive so we might save some compilation time. */
|
||||
for (i = FIRST_STACK_REG; i <= LAST_STACK_REG; i++)
|
||||
|
@ -232,9 +232,9 @@ static char *in_inc_dec;
|
||||
#endif /* FORBIDDEN_INC_DEC_CLASSES */
|
||||
|
||||
#ifdef CANNOT_CHANGE_MODE_CLASS
|
||||
/* All registers that have been subreged. Indexed by mode, where each
|
||||
entry is a regset of registers. */
|
||||
regset_head subregs_of_mode [NUM_MACHINE_MODES];
|
||||
/* All registers that have been subreged. Indexed by regno * MAX_MACHINE_MODE
|
||||
+ mode. */
|
||||
bitmap_head subregs_of_mode;
|
||||
#endif
|
||||
|
||||
/* Sample MEM values for use by memory_move_secondary_cost. */
|
||||
@ -2638,16 +2638,18 @@ cannot_change_mode_set_regs (used, from, regno)
|
||||
unsigned int regno;
|
||||
{
|
||||
enum machine_mode to;
|
||||
int n, i;
|
||||
int start = regno * MAX_MACHINE_MODE;
|
||||
|
||||
for (to = VOIDmode; to < MAX_MACHINE_MODE; ++to)
|
||||
if (REGNO_REG_SET_P (&subregs_of_mode[to], regno))
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (! TEST_HARD_REG_BIT (*used, i)
|
||||
&& REG_CANNOT_CHANGE_MODE_P (i, from, to))
|
||||
SET_HARD_REG_BIT (*used, i);
|
||||
}
|
||||
EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
|
||||
if (n >= MAX_MACHINE_MODE + start)
|
||||
return;
|
||||
to = n - start;
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (! TEST_HARD_REG_BIT (*used, i)
|
||||
&& REG_CANNOT_CHANGE_MODE_P (i, from, to))
|
||||
SET_HARD_REG_BIT (*used, i);
|
||||
);
|
||||
}
|
||||
|
||||
/* Return 1 if REGNO has had an invalid mode change in CLASS from FROM
|
||||
@ -2660,11 +2662,16 @@ invalid_mode_change_p (regno, class, from_mode)
|
||||
enum machine_mode from_mode;
|
||||
{
|
||||
enum machine_mode to_mode;
|
||||
int n;
|
||||
int start = regno * MAX_MACHINE_MODE;
|
||||
|
||||
for (to_mode = 0; to_mode < NUM_MACHINE_MODES; ++to_mode)
|
||||
if (REGNO_REG_SET_P (&subregs_of_mode[(int) to_mode], regno)
|
||||
&& CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
|
||||
EXECUTE_IF_SET_IN_BITMAP (&subregs_of_mode, start, n,
|
||||
if (n >= MAX_MACHINE_MODE + start)
|
||||
return 0;
|
||||
to_mode = n - start;
|
||||
if (CANNOT_CHANGE_MODE_CLASS (from_mode, to_mode, class))
|
||||
return 1;
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CANNOT_CHANGE_MODE_CLASS */
|
||||
|
@ -66,7 +66,7 @@ typedef struct reg_info_def
|
||||
|
||||
extern varray_type reg_n_info;
|
||||
|
||||
extern regset_head subregs_of_mode [NUM_MACHINE_MODES];
|
||||
extern bitmap_head subregs_of_mode;
|
||||
|
||||
/* Indexed by n, gives number of times (REG n) is used or set. */
|
||||
|
||||
|
@ -3458,7 +3458,9 @@ rest_of_compilation (decl)
|
||||
#endif
|
||||
|
||||
/* If optimizing, then go ahead and split insns now. */
|
||||
#ifndef STACK_REGS
|
||||
if (optimize > 0)
|
||||
#endif
|
||||
split_all_insns (0);
|
||||
|
||||
cleanup_cfg (optimize ? CLEANUP_EXPENSIVE : 0);
|
||||
@ -3551,10 +3553,6 @@ rest_of_compilation (decl)
|
||||
close_dump_file (DFI_ce3, print_rtl_with_bb, insns);
|
||||
timevar_pop (TV_IFCVT2);
|
||||
}
|
||||
#ifdef STACK_REGS
|
||||
if (optimize)
|
||||
split_all_insns (1);
|
||||
#endif
|
||||
|
||||
#ifdef INSN_SCHEDULING
|
||||
if (optimize > 0 && flag_schedule_insns_after_reload)
|
||||
|
Loading…
Reference in New Issue
Block a user