diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2021-09-22 16:58:22 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2021-09-23 12:56:43 -0400 |
commit | 053e1d642104d19d5f9e5fb08a9e7354a0db28f5 (patch) | |
tree | 0e842f9e1c0fdd1788cb7465c2ac4f14b397b519 /gcc/gimple-range.cc | |
parent | 1b07d9dce6c51c98d011236c3d4cd84a2ed59ba2 (diff) | |
download | gcc-053e1d642104d19d5f9e5fb08a9e7354a0db28f5.zip gcc-053e1d642104d19d5f9e5fb08a9e7354a0db28f5.tar.gz gcc-053e1d642104d19d5f9e5fb08a9e7354a0db28f5.tar.bz2 |
Create a ranger-local flag for non-executable edges.
Instead of repurposing EDGE_EXECUTABLE, ranger creates a local flag and
ultizes it throughout.
* gimple-range-cache.cc (ranger_cache::ranger_cache): Take
non-executable_edge flag as parameter.
* gimple-range-cache.h (ranger_cache): Adjust prototype.
* gimple-range-gori.cc (gori_compute::gori_compute): Take
non-executable_edge flag as parameter.
(gori_compute::outgoing_edge_range_p): Check new flag.
* gimple-range-gori.h (gori_compute): Adjust prototype.
* gimple-range.cc (gimple_ranger::gimple_ranger): Create new flag.
(gimple_ranger::range_on_edge): Check new flag.
* gimple-range.h (gimple_ranger::non_executable_edge_flag): New.
* gimple-ssa-evrp.c (rvrp_folder): Pass ranger flag to simplifer.
(hybrid_folder::hybrid_folder): Set ranger non-executable flag value.
(hybrid_folder::fold_stmt): Set flag value in the simplifer.
* vr-values.c (simplify_using_ranges::set_and_propagate_unexecutable):
Use not_executable flag if provided inmstead of EDGE_EXECUTABLE.
(simplify_using_ranges::simplify_switch_using_ranges): Clear
EDGE_EXECUTABLE like it originally did.
(simplify_using_ranges::cleanup_edges_and_switches): Clear any
NON_EXECUTABLE flags.
(simplify_using_ranges::simplify_using_ranges): Adjust.
* vr-values.h (class simplify_using_ranges): Adjust.
(simplify_using_ranges::set_range_query): Add non-executable flag param.
Diffstat (limited to 'gcc/gimple-range.cc')
-rw-r--r-- | gcc/gimple-range.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc index 625d136..d4108db 100644 --- a/gcc/gimple-range.cc +++ b/gcc/gimple-range.cc @@ -34,15 +34,29 @@ along with GCC; see the file COPYING3. If not see #include "cfgloop.h" #include "tree-scalar-evolution.h" #include "gimple-range.h" -#include "domwalk.h" -gimple_ranger::gimple_ranger () : tracer ("") +gimple_ranger::gimple_ranger () : + non_executable_edge_flag (cfun), + m_cache (non_executable_edge_flag), + tracer ("") { // If the cache has a relation oracle, use it. m_oracle = m_cache.oracle (); if (dump_file && (param_evrp_mode & EVRP_MODE_TRACE)) tracer.enable_trace (); - set_all_edges_as_executable (cfun); + + // Ensure the not_executable flag is clear everywhere. + if (flag_checking) + { + basic_block bb; + FOR_ALL_BB_FN (bb, cfun) + { + edge_iterator ei; + edge e; + FOR_EACH_EDGE (e, ei, bb->succs) + gcc_checking_assert ((e->flags & non_executable_edge_flag) == 0); + } + } } bool @@ -174,7 +188,7 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name) } // Check to see if the edge is executable. - if ((e->flags & EDGE_EXECUTABLE) == 0) + if ((e->flags & non_executable_edge_flag)) { r.set_undefined (); if (idx) |