aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range-gori.cc
diff options
context:
space:
mode:
authorAndrew MacLeod <amacleod@redhat.com>2022-06-16 12:44:33 -0400
committerAndrew MacLeod <amacleod@redhat.com>2022-06-16 14:16:19 -0400
commit6c849e2fab3f682b715a81cb4ccc792f20c00eeb (patch)
tree380e12d8d882a331c72e8962d1c04732d5247cc8 /gcc/gimple-range-gori.cc
parent5b1594dc2d053803ae98ae39f76fbd71f35cb657 (diff)
downloadgcc-6c849e2fab3f682b715a81cb4ccc792f20c00eeb.zip
gcc-6c849e2fab3f682b715a81cb4ccc792f20c00eeb.tar.gz
gcc-6c849e2fab3f682b715a81cb4ccc792f20c00eeb.tar.bz2
Clear invariant bit for inferred ranges.
The range of an invariant SSA (no outgoing edge range anywhere) is not tracked. If an inferred range is registered, remove the invariant flag. * gimple-range-cache.cc (ranger_cache::apply_inferred_ranges): If name was invaraint before, clear the invariant bit. * gimple-range-gori.cc (gori_map::set_range_invariant): Add a flag. * gimple-range-gori.h (gori_map::set_range_invariant): Adjust prototype.
Diffstat (limited to 'gcc/gimple-range-gori.cc')
-rw-r--r--gcc/gimple-range-gori.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc
index 0a3e54e..a43e44c 100644
--- a/gcc/gimple-range-gori.cc
+++ b/gcc/gimple-range-gori.cc
@@ -499,12 +499,16 @@ gori_map::is_export_p (tree name, basic_block bb)
return bitmap_bit_p (exports (bb), SSA_NAME_VERSION (name));
}
-// Clear the m_maybe_variant bit so ranges will not be tracked for NAME.
+// Set or clear the m_maybe_variant bit to determine if ranges will be tracked
+// for NAME. A clear bit means they will NOT be tracked.
void
-gori_map::set_range_invariant (tree name)
+gori_map::set_range_invariant (tree name, bool invariant)
{
- bitmap_clear_bit (m_maybe_variant, SSA_NAME_VERSION (name));
+ if (invariant)
+ bitmap_clear_bit (m_maybe_variant, SSA_NAME_VERSION (name));
+ else
+ bitmap_set_bit (m_maybe_variant, SSA_NAME_VERSION (name));
}
// Return true if NAME is an import to block BB.