diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-09-19 17:21:45 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-09-19 18:54:43 +0200 |
commit | 08900f28893b98b2ad0e0c284338d8555636067c (patch) | |
tree | 69f47d73c37d4c7800e1f95dab4bb32af9d28133 /gcc/tree-ssa-threadupdate.c | |
parent | 124c354ad70f09c31610f67743b277a359527649 (diff) | |
download | gcc-08900f28893b98b2ad0e0c284338d8555636067c.zip gcc-08900f28893b98b2ad0e0c284338d8555636067c.tar.gz gcc-08900f28893b98b2ad0e0c284338d8555636067c.tar.bz2 |
Minor cleanups to forward threader.
Every time we allocate a threading edge we push it onto the path in a
distinct step. There's no need to do this in two steps, and avoiding
this, keeps us from exposing the internals of the registry.
I've also did some tiny cleanups in thread_across_edge, most importantly
removing the bitmap in favor of an auto_bitmap.
There are no functional changes.
gcc/ChangeLog:
* tree-ssa-threadbackward.c
(back_threader_registry::register_path): Use push_edge.
* tree-ssa-threadedge.c
(jump_threader::thread_around_empty_blocks): Same.
(jump_threader::thread_through_normal_block): Same.
(jump_threader::thread_across_edge): Same. Also, use auto_bitmap.
Tidy up code.
* tree-ssa-threadupdate.c
(jt_path_registry::allocate_thread_edge): Remove.
(jt_path_registry::push_edge): New.
(dump_jump_thread_path): Make static.
* tree-ssa-threadupdate.h (allocate_thread_edge): Remove.
(push_edge): New.
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index c5a7423..baac112 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -196,10 +196,12 @@ back_jt_path_registry::back_jt_path_registry () { } -jump_thread_edge * -jt_path_registry::allocate_thread_edge (edge e, jump_thread_edge_type t) +void +jt_path_registry::push_edge (vec<jump_thread_edge *> *path, + edge e, jump_thread_edge_type type) { - return m_allocator.allocate_thread_edge (e, t); + jump_thread_edge *x = m_allocator.allocate_thread_edge (e, type); + path->safe_push (x); } vec<jump_thread_edge *> * @@ -211,9 +213,9 @@ jt_path_registry::allocate_thread_path () /* Dump a jump threading path, including annotations about each edge in the path. */ -void +static void dump_jump_thread_path (FILE *dump_file, - const vec<jump_thread_edge *> path, + const vec<jump_thread_edge *> &path, bool registering) { fprintf (dump_file, |