return true;
}
+// Compute ranges defined in the PHIs in this block.
+
+void
+path_range_query::compute_ranges_in_phis (basic_block bb)
+{
+ int_range_max r;
+ gphi_iterator iter;
+
+ // PHIs must be resolved simultaneously on entry to the block
+ // because any dependencies must be satistifed with values on entry.
+ // Thus, we calculate all PHIs first, and then update the cache at
+ // the end.
+
+ m_tmp_phi_cache.clear ();
+ for (iter = gsi_start_phis (bb); !gsi_end_p (iter); gsi_next (&iter))
+ {
+ gphi *phi = iter.phi ();
+ tree name = gimple_phi_result (phi);
+
+ if (import_p (name) && range_defined_in_block (r, name, bb))
+ m_tmp_phi_cache.set_global_range (name, r);
+ }
+ for (iter = gsi_start_phis (bb); !gsi_end_p (iter); gsi_next (&iter))
+ {
+ gphi *phi = iter.phi ();
+ tree name = gimple_phi_result (phi);
+
+ if (m_tmp_phi_cache.get_global_range (r, name))
+ set_cache (r, name);
+ }
+}
+
// Compute ranges defined in the current block, or exported to the
// next block.
}
// Solve imports defined in this block, starting with the PHIs...
- for (gphi_iterator iter = gsi_start_phis (bb); !gsi_end_p (iter);
- gsi_next (&iter))
- {
- gphi *phi = iter.phi ();
- tree name = gimple_phi_result (phi);
-
- if (import_p (name) && range_defined_in_block (r, name, bb))
- set_cache (r, name);
- }
+ compute_ranges_in_phis (bb);
// ...and then the rest of the imports.
EXECUTE_IF_SET_IN_BITMAP (m_imports, 0, i, bi)
{
// Methods to compute ranges for the given path.
bool range_defined_in_block (irange &, tree name, basic_block bb);
void compute_ranges_in_block (basic_block bb);
+ void compute_ranges_in_phis (basic_block bb);
void adjust_for_non_null_uses (basic_block bb);
void ssa_range_in_phi (irange &r, gphi *phi);
void compute_outgoing_relations (basic_block bb, basic_block next);
// Range cache for SSA names.
ssa_global_cache *m_cache;
+ ssa_global_cache m_tmp_phi_cache;
+
// Set for each SSA that has an active entry in the cache.
bitmap m_has_cache_entry;