r.intersect (op_range);
return true;
}
-// Return TRUE if a range can be calculated or recomputed for NAME on edge E.
-
-bool
-gori_compute::has_edge_range_p (tree name, edge e)
-{
- // Check if NAME is an export or can be recomputed.
- if (e)
- return is_export_p (name, e->src) || may_recompute_p (name, e);
-
- // If no edge is specified, check if NAME can have a range calculated
- // on any edge.
- return is_export_p (name) || may_recompute_p (name);
-}
-
-// Dump what is known to GORI computes to listing file F.
-
-void
-gori_compute::dump (FILE *f)
-{
- gori_map::dump (f);
-}
-// Return TRUE if NAME can be recomputed on edge E. If any direct dependant
-// is exported on edge E, it may change the computed value of NAME.
+// Return TRUE if NAME can be recomputed on any edge exiting BB. If any
+// direct dependant is exported, it may also change the computed value of NAME.
bool
-gori_compute::may_recompute_p (tree name, edge e)
+gori_compute::may_recompute_p (tree name, basic_block bb)
{
tree dep1 = depend1 (name);
tree dep2 = depend2 (name);
return false;
// If edge is specified, check if NAME can be recalculated on that edge.
- if (e)
- return ((is_export_p (dep1, e->src))
- || (dep2 && is_export_p (dep2, e->src)));
+ if (bb)
+ return ((is_export_p (dep1, bb))
+ || (dep2 && is_export_p (dep2, bb)));
return (is_export_p (dep1)) || (dep2 && is_export_p (dep2));
}
+// Return TRUE if NAME can be recomputed on edge E. If any direct dependant
+// is exported on edge E, it may change the computed value of NAME.
+
+bool
+gori_compute::may_recompute_p (tree name, edge e)
+{
+ gcc_checking_assert (e);
+ return may_recompute_p (name, e->src);
+}
+
+
+// Return TRUE if a range can be calculated or recomputed for NAME on any
+// edge exiting BB.
+
+bool
+gori_compute::has_edge_range_p (tree name, basic_block bb)
+{
+ // Check if NAME is an export or can be recomputed.
+ if (bb)
+ return is_export_p (name, bb) || may_recompute_p (name, bb);
+
+ // If no block is specified, check for anywhere in the IL.
+ return is_export_p (name) || may_recompute_p (name);
+}
+
+// Return TRUE if a range can be calculated or recomputed for NAME on edge E.
+
+bool
+gori_compute::has_edge_range_p (tree name, edge e)
+{
+ gcc_checking_assert (e);
+ return has_edge_range_p (name, e->src);
+}
+
// Calculate a range on edge E and return it in R. Try to evaluate a
// range for NAME on this edge. Return FALSE if this is either not a
// control edge or NAME is not defined by this edge.
return false;
}
+// Dump what is known to GORI computes to listing file F.
+
+void
+gori_compute::dump (FILE *f)
+{
+ gori_map::dump (f);
+}
// ------------------------------------------------------------------------
// GORI iterator. Although we have bitmap iterators, don't expose that it
public:
gori_compute (int not_executable_flag = 0);
bool outgoing_edge_range_p (irange &r, edge e, tree name, range_query &q);
- bool has_edge_range_p (tree name, edge e = NULL);
+ bool has_edge_range_p (tree name, basic_block bb = NULL);
+ bool has_edge_range_p (tree name, edge e);
void dump (FILE *f);
private:
- bool may_recompute_p (tree name, edge e = NULL);
+ bool may_recompute_p (tree name, edge e);
+ bool may_recompute_p (tree name, basic_block bb = NULL);
bool compute_operand_range (irange &r, gimple *stmt, const irange &lhs,
tree name, class fur_source &src);
bool compute_operand_range_switch (irange &r, gswitch *s, const irange &lhs,