Do not calculate an entry range for invariant names.

If an SSA_NAME is invariant, do not calculate an on_entry value.

	PR tree-optimization/117467
	* gimple-range-cache.cc (ranger_cache::entry_range): Do not
	invoke range_from_dom for invariant ssa-names.
This commit is contained in:
Andrew MacLeod 2024-11-25 09:50:33 -05:00
parent 75e7d1600f
commit 48eda34624

View file

@ -1183,6 +1183,13 @@ ranger_cache::entry_range (vrange &r, tree name, basic_block bb,
return;
}
// If NAME is invariant, simply return the defining range.
if (!gori ().has_edge_range_p (name))
{
range_of_def (r, name);
return;
}
// Look for the on-entry value of name in BB from the cache.
// Otherwise pick up the best available global value.
if (!m_on_entry.get_bb_range (r, name, bb))