diff options
author | Ken Raeburn <raeburn@cygnus.com> | 1999-02-01 12:50:53 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@gcc.gnu.org> | 1999-02-01 12:50:53 +0000 |
commit | c68da89c455fce41d03acecff5883099b1c97424 (patch) | |
tree | 6e36a17f813c9f393e14690ca6a6478095b3fcb0 /gcc/varray.h | |
parent | 9594b1b2a1bad01f95ac82d6bf44cb98a34a14d9 (diff) | |
download | gcc-c68da89c455fce41d03acecff5883099b1c97424.tar.gz |
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
Diffstat (limited to 'gcc/varray.h')
-rw-r--r-- | gcc/varray.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/varray.h b/gcc/varray.h index bf744fc402d..5905773d190 100644 --- a/gcc/varray.h +++ b/gcc/varray.h @@ -30,6 +30,30 @@ #include "system.h" #endif +/* Auxiliary structure used inside the varray structure, used for + function integration data. */ + +struct const_equiv_data { + /* Map pseudo reg number in calling function to equivalent constant. We + cannot in general substitute constants into parameter pseudo registers, + since some machine descriptions (many RISCs) won't always handle + the resulting insns. So if an incoming parameter has a constant + equivalent, we record it here, and if the resulting insn is + recognizable, we go with it. + + We also use this mechanism to convert references to incoming arguments + and stacked variables. copy_rtx_and_substitute will replace the virtual + incoming argument and virtual stacked variables registers with new + pseudos that contain pointers into the replacement area allocated for + this inline instance. These pseudos are then marked as being equivalent + to the appropriate address and substituted if valid. */ + rtx rtx; + + /* Record the valid age for each entry. The entry is invalid if its + age is less than const_age. */ + unsigned age; +}; + /* Union of various array types that are used. */ typedef union varray_data_tag { char c[1]; @@ -50,6 +74,7 @@ typedef union varray_data_tag { struct bitmap_head_def *bitmap[1]; struct sched_info_tag *sched[1]; struct reg_info_def *reg[1]; + struct const_equiv_data const_equiv[1]; } varray_data; /* Virtual array of pointers header. */ @@ -118,6 +143,9 @@ extern varray_type varray_init PROTO ((size_t, size_t, const char *)); #define VARRAY_REG_INIT(va, num, name) \ va = varray_init (num, sizeof (struct reg_info_def *), name) +#define VARRAY_CONST_EQUIV_INIT(va, num, name) \ + va = varray_init (num, sizeof (struct const_equiv_data), name) + /* Free up memory allocated by the virtual array, but do not free any of the elements involved. */ #define VARRAY_FREE(vp) \ @@ -128,6 +156,8 @@ extern varray_type varray_grow PROTO((varray_type, size_t)); #define VARRAY_GROW(VA, N) ((VA) = varray_grow (VA, N)) +#define VARRAY_SIZE(VA) ((VA)->num_elements) + /* Check for VARRAY_xxx macros being in bound, return N for use as an index. */ #ifdef ENABLE_CHECKING @@ -159,5 +189,6 @@ extern varray_type varray_grow PROTO((varray_type, size_t)); #define VARRAY_BITMAP(VA, N) ((VA)->data.bitmap[ VARRAY_CHECK (VA, N) ]) #define VARRAY_SCHED(VA, N) ((VA)->data.sched[ VARRAY_CHECK (VA, N) ]) #define VARRAY_REG(VA, N) ((VA)->data.reg[ VARRAY_CHECK (VA, N) ]) +#define VARRAY_CONST_EQUIV(VA, N) ((VA)->data.const_equiv[ VARRAY_CHECK (VA, N) ]) #endif /* _VARRAY_H_ */ |