diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-11-24 17:58:43 +0100 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-11-25 11:52:23 +0100 |
commit | d1c1919ef8a18eea9d5c1741f8c9adaabf5571f2 (patch) | |
tree | 7def615aac6435a038ca6c45f958f4fc4bed06d9 /gcc | |
parent | 8acbd7bef6edbf537e3037174907029b530212f6 (diff) | |
download | gcc-d1c1919ef8a18eea9d5c1741f8c9adaabf5571f2.zip gcc-d1c1919ef8a18eea9d5c1741f8c9adaabf5571f2.tar.gz gcc-d1c1919ef8a18eea9d5c1741f8c9adaabf5571f2.tar.bz2 |
path solver: Move boolean import code to compute_imports.
In a follow-up patch I will be pruning the set of exported ranges
within blocks to avoid unnecessary work. In order to do this, all the
interesting SSA names must be in the internal import bitmap ahead of
time. I had already abstracted them out into compute_imports, but I
missed the boolean code. This fixes the oversight.
There's a net gain of 25 threadable paths, which is unexpected but
welcome.
Tested on x86-64 & ppc64le Linux.
gcc/ChangeLog:
PR tree-optimization/103254
* gimple-range-path.cc (path_range_query::compute_ranges): Move
exported boolean code...
(path_range_query::compute_imports): ...here.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple-range-path.cc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index e240866..806bce9 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -537,7 +537,8 @@ void path_range_query::compute_imports (bitmap imports, basic_block exit) { // Start with the imports from the exit block... - bitmap r_imports = m_ranger->gori ().imports (exit); + gori_compute &gori = m_ranger->gori (); + bitmap r_imports = gori.imports (exit); bitmap_copy (imports, r_imports); auto_vec<tree> worklist (bitmap_count_bits (imports)); @@ -579,6 +580,16 @@ path_range_query::compute_imports (bitmap imports, basic_block exit) } } } + // Exported booleans along the path, may help conditionals. + if (m_resolve) + for (i = 0; i < m_path.length (); ++i) + { + basic_block bb = m_path[i]; + tree name; + FOR_EACH_GORI_EXPORT_NAME (gori, bb, name) + if (TREE_CODE (TREE_TYPE (name)) == BOOLEAN_TYPE) + bitmap_set_bit (imports, SSA_NAME_VERSION (name)); + } } // Compute the ranges for IMPORTS along PATH. @@ -622,18 +633,6 @@ path_range_query::compute_ranges (const vec<basic_block> &path, { basic_block bb = curr_bb (); - if (m_resolve) - { - gori_compute &gori = m_ranger->gori (); - tree name; - - // Exported booleans along the path, may help conditionals. - // Add them as interesting imports. - FOR_EACH_GORI_EXPORT_NAME (gori, bb, name) - if (TREE_CODE (TREE_TYPE (name)) == BOOLEAN_TYPE) - bitmap_set_bit (m_imports, SSA_NAME_VERSION (name)); - } - compute_ranges_in_block (bb); adjust_for_non_null_uses (bb); |