diff options
author | Martin Liska <mliska@suse.cz> | 2022-11-08 12:36:43 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-11-08 12:36:43 +0100 |
commit | 4b13c73bba935443be3207abf26f7ba05f79badc (patch) | |
tree | a6bb1525d07859fa8fc6f61dd13df7ddfd1ac254 /gcc/gimple-range-cache.cc | |
parent | 33f5dde0cd15df9cf89b29280d4ff5fcf7b30e66 (diff) | |
parent | fa271afb58423014e2feef9f15c1a87428e64ddc (diff) | |
download | gcc-devel/sphinx.tar.gz |
Merge branch 'master' into devel/sphinxdevel/sphinx
Diffstat (limited to 'gcc/gimple-range-cache.cc')
-rw-r--r-- | gcc/gimple-range-cache.cc | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/gcc/gimple-range-cache.cc b/gcc/gimple-range-cache.cc index 89e2403acce..ce5a0c8155e 100644 --- a/gcc/gimple-range-cache.cc +++ b/gcc/gimple-range-cache.cc @@ -1544,8 +1544,27 @@ ranger_cache::range_from_dom (vrange &r, tree name, basic_block start_bb, return true; } -// This routine is used during a block walk to move the state of non-null for -// any operands on stmt S to nonnull. +// This routine will register an inferred value in block BB, and possibly +// update the on-entry cache if appropriate. + +void +ranger_cache::register_inferred_value (const vrange &ir, tree name, + basic_block bb) +{ + Value_Range r (TREE_TYPE (name)); + if (!m_on_entry.get_bb_range (r, name, bb)) + exit_range (r, name, bb, RFD_READ_ONLY); + if (r.intersect (ir)) + { + m_on_entry.set_bb_range (name, bb, r); + // If this range was invariant before, remove invariance. + if (!m_gori.has_edge_range_p (name)) + m_gori.set_range_invariant (name, false); + } +} + +// This routine is used during a block walk to adjust any inferred ranges +// of operands on stmt S. void ranger_cache::apply_inferred_ranges (gimple *s) @@ -1574,17 +1593,6 @@ ranger_cache::apply_inferred_ranges (gimple *s) tree name = infer.name (x); m_exit.add_range (name, bb, infer.range (x)); if (update) - { - Value_Range r (TREE_TYPE (name)); - if (!m_on_entry.get_bb_range (r, name, bb)) - exit_range (r, name, bb, RFD_READ_ONLY); - if (r.intersect (infer.range (x))) - { - m_on_entry.set_bb_range (name, bb, r); - // If this range was invariant before, remove invariance. - if (!m_gori.has_edge_range_p (name)) - m_gori.set_range_invariant (name, false); - } - } + register_inferred_value (infer.range (x), name, bb); } } |