m_oracle = new path_oracle (m_ranger.oracle ());
}
-path_range_query::path_range_query (gimple_ranger &ranger,
- edge e,
- bool resolve)
- : m_cache (new ssa_global_cache),
- m_has_cache_entry (BITMAP_ALLOC (NULL)),
- m_ranger (ranger),
- m_resolve (resolve)
-{
- m_oracle = new path_oracle (m_ranger.oracle ());
- auto_vec<basic_block> bbs (2);
- bbs.quick_push (e->dest);
- bbs.quick_push (e->src);
- reset_path (bbs, NULL);
-}
-
path_range_query::~path_range_query ()
{
delete m_oracle;
const bitmap_head *dependencies = NULL,
bool resolve = true);
path_range_query (gimple_ranger &ranger, bool resolve = true);
- path_range_query (gimple_ranger &ranger, edge e, bool resolve = true);
virtual ~path_range_query ();
void reset_path (const vec<basic_block> &, const bitmap_head *dependencies);
bool range_of_expr (vrange &r, tree name, gimple * = NULL) override;
increases effectiveness of code motion optimizations, and reduces the need
for loop preconditioning. */
+/* Given a path through edge E, whose last statement is COND, return
+ the range of the solved conditional in R. */
+
+static void
+edge_range_query (irange &r, edge e, gcond *cond, gimple_ranger &ranger)
+{
+ auto_vec<basic_block> path (2);
+ path.safe_push (e->dest);
+ path.safe_push (e->src);
+ path_range_query query (ranger, path);
+ if (!query.range_of_stmt (r, cond))
+ r.set_varying (boolean_type_node);
+}
+
/* Return true if the condition on the first iteration of the loop can
be statically determined. */
desired_static_value = boolean_true_node;
int_range<2> r;
- path_range_query query (*ranger, e);
- query.range_of_stmt (r, last);
+ edge_range_query (r, e, last, *ranger);
return r == int_range<2> (desired_static_value, desired_static_value);
}