573e20aaca
The *forward* jump threader has multiple places where it pushes and pops state, and where it sets context up for the jump threading simplifier callback. Not only are the idioms repetitive, but the only reason for passing const_and_copies, avail_exprs_stack, and the evrp engine around are so we can set up context. As part of my jump threading work, I will divorce the evrp engine from the DOM jump threader, replacing it with a subset of the path solver I have just contributed. Since this will entail passing even more context around, I've abstracted out the state handling so it can be passed around in one object. This cleans up the code, and also makes it trivial to set up context with another engine in the future. FWIW, I've used these cleanups and the path solver in a POC to improve DOM's threaded edges by an additional 5%, and the overall threading opportunities in the compiler by 1%. This is in addition to the gains I have documented in the backwards threader rewrite. There are no functional changes with this patch. Tested on x86-64 Linux. gcc/ChangeLog: * tree-ssa-dom.c (dom_jump_threader_simplifier): Put avail_exprs_stack in the class, instead of passing it to jump_threader_simplifier. (dom_jump_threader_simplifier::simplify): Add state argument. (dom_opt_dom_walker): Add state. (pass_dominator::execute): Pass state to threader. (dom_opt_dom_walker::before_dom_children): Use state. * tree-ssa-threadedge.c (jump_threader::jump_threader): Replace arguments by state. (jump_threader::record_temporary_equivalences_from_phis): Register equivalences through the state variable. (jump_threader::record_temporary_equivalences_from_stmts_at_dest): Record ranges in a statement through the state variable. (jump_threader::simplify_control_stmt_condition): Pass state to simplify. (jump_threader::simplify_control_stmt_condition_1): Same. (jump_threader::thread_around_empty_blocks): Remove obsolete comment. (jump_threader::thread_through_normal_block): Record equivalences on edge through the state variable. (jump_threader::thread_across_edge): Abstract state pushing. (jt_state::jt_state): New. (jt_state::push): New. (jt_state::pop): New. (jt_state::register_equiv): New. (jt_state::record_ranges_from_stmt): New. (jt_state::register_equivs_on_edge): New. (jump_threader_simplifier::jump_threader_simplifier): Move from header. (jump_threader_simplifier::simplify): Add state argument. * tree-ssa-threadedge.h (class jt_state): New. (class jump_threader): Add state to constructor. (class jump_threader_simplifier): Add state to simplify. Remove avail_exprs_stack from class. * tree-vrp.c (vrp_jump_threader_simplifier::simplify): Add state argument. (vrp_jump_threader::vrp_jump_threader): Add state. (vrp_jump_threader::~vrp_jump_threader): Cleanup state. |
||
---|---|---|
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 | ||
COPYING3 | ||
COPYING3.LIB | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
lt~obsolete.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.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.