![]() This patch implements a storage class that will be used to stream out ranges to long term storage, initially in SSA_NAME_RANGE_INFO, but it is flexible enough to use with our obstack allocator. For instance, in the future we could use it in the ranger cache to save memory. The current size of range_info_def which is used in SSA_NAME_RANGE_INFO is 16 bytes. With this patch, the size of the slot (irange_storage_slot) will be 24 bytes. But we'll have the ability to be able to store up to 5 pairs of sub-ranges if necessary. If we ever need to save more (say for switches), we could explore a trailing_wide_ints structure with a pointer to the m_len[N] bits as Jakub has suggested. In follow-up patches I will contribute the SSA_NAME_RANGE_INFO changes as well as changes storing the nonzero bits within an irange. For reference, the main interface is rather simple: class vrange_storage { public: vrange_storage (vrange_allocator *alloc) : m_alloc (alloc) { } void *alloc_slot (const vrange &r); void free (void *slot); void get_vrange (const void *slot, vrange &r, tree type); void set_vrange (void *slot, const vrange &r); static bool fits_p (const void *slot, const vrange &r); }; The above class will have the knowledge to stream out the different ranges we support (currently only irange_storage_slot). As has been discussed, the irange storage will use trailing wide ints: class GTY ((variable_size)) irange_storage_slot { <snip> <snip> // This is the maximum number of wide_int's allowed in the trailing // ints structure, without going over 16 bytes (128 bits) in the // control word that preceeds the HOST_WIDE_INTs in // trailing_wide_ints::m_val[]. static const unsigned MAX_INTS = 12; // Maximum number of range pairs we can handle, considering the // nonzero bits take one wide_int. static const unsigned MAX_PAIRS = (MAX_INTS - 1) / 2; trailing_wide_ints<MAX_INTS> m_ints; }; Tested on x86-64 Linux. gcc/ChangeLog: * Makefile.in (OBJS): Add value-range-storage.o. (GTFILES): Add value-range-storage.h. * gengtype.cc (open_base_files): Add value-range-storage.h. * value-range-storage.cc: New file. * value-range-storage.h: New file. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgo | ||
libgomp | ||
libiberty | ||
libitm | ||
libobjc | ||
liboffloadmic | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.