Go to file
Aldy Hernandez 573e20aaca Abstract out (forward) jump threader state handling.
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.
2021-07-27 17:58:14 +02:00
c++tools Daily bump. 2021-07-22 00:16:46 +00:00
config Daily bump. 2021-07-10 00:16:53 +00:00
contrib Daily bump. 2021-07-21 00:16:54 +00:00
fixincludes Daily bump. 2021-07-07 00:17:12 +00:00
gcc Abstract out (forward) jump threader state handling. 2021-07-27 17:58:14 +02:00
gnattools
gotools
include Daily bump. 2021-07-25 00:16:22 +00:00
INSTALL
intl
libada
libatomic Daily bump. 2021-07-22 00:16:46 +00:00
libbacktrace
libcc1
libcody
libcpp Daily bump. 2021-07-27 00:16:27 +00:00
libdecnumber
libffi Daily bump. 2021-07-10 00:16:53 +00:00
libgcc Daily bump. 2021-07-16 00:16:25 +00:00
libgfortran Daily bump. 2021-07-27 00:16:27 +00:00
libgo runtime: remove direct assignments to memory locations 2021-07-09 19:48:53 -07:00
libgomp Don't use libgomp 'cbuf' buffering with OpenACC 'async' 2021-07-27 11:16:37 +02:00
libiberty
libitm
libobjc
liboffloadmic
libphobos
libquadmath
libsanitizer Daily bump. 2021-07-21 00:16:54 +00:00
libssp
libstdc++-v3 c++: Reject ordered comparison of null pointers [PR99701] 2021-07-27 11:38:59 -04:00
libvtv
lto-plugin
maintainer-scripts
zlib
.dir-locals.el dir-locals: Use https for bug references 2021-07-20 11:40:34 +01:00
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Daily bump. 2021-07-21 00:16:54 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Darwin, config: Revise host config fragment. 2021-07-09 17:35:57 +01:00
configure.ac Darwin, config: Revise host config fragment. 2021-07-09 17:35:57 +01:00
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 add myself to DCO section 2021-07-15 01:16:51 -04:00
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.