21#ifndef GCC_ANALYZER_CONSTRAINT_MANAGER_H
22#define GCC_ANALYZER_CONSTRAINT_MANAGER_H
26class constraint_manager;
66 tree rhs_const)
const;
86 void dump (
bool show_types)
const;
88 std::unique_ptr<json::object>
to_json ()
const;
90 std::unique_ptr<text_art::widget>
101 return !(*
this == other);
136 void dump (
bool show_types)
const;
138 std::unique_ptr<json::value>
to_json ()
const;
141 const text_art::dump_widget_info &dwi)
const;
170 static const bool empty_zero_p =
true;
224 static inline hashval_t
233 return k ==
reinterpret_cast<key_type> (1);
274 std::unique_ptr<json::object>
to_json ()
const;
276 std::unique_ptr<text_art::tree_widget>
354 std::unique_ptr<json::object>
to_json ()
const;
356 std::unique_ptr<text_art::widget>
401 std::unique_ptr<json::object>
to_json ()
const;
406 return !(*
this == other);
411 std::unique_ptr<text_art::tree_widget>
437 return !(*
this == other);
445 std::unique_ptr<json::object>
to_json ()
const;
447 std::unique_ptr<text_art::tree_widget>
489 tree rhs_const)
const;
497 template <
typename PurgeCriteria>
Definition constraint-manager.h:391
bool operator!=(const bounded_ranges_constraint &other) const
Definition constraint-manager.h:404
const bounded_ranges * m_ranges
Definition constraint-manager.h:415
bounded_ranges_constraint(equiv_class_id ec_id, const bounded_ranges *ranges)
Definition constraint-manager.h:393
equiv_class_id m_ec_id
Definition constraint-manager.h:414
std::unique_ptr< text_art::tree_widget > make_dump_widget(const text_art::dump_widget_info &dwi) const
void add_to_hash(inchash::hash *hstate) const
void print(pretty_printer *pp, const constraint_manager &cm) const
std::unique_ptr< json::object > to_json() const
bool operator==(const bounded_ranges_constraint &other) const
Definition constraint-manager.h:181
const bounded_ranges * get_or_create_inverse(const bounded_ranges *other, tree type)
const bounded_ranges * get_or_create_intersection(const bounded_ranges *a, const bounded_ranges *b)
const bounded_ranges * create_ranges_for_switch(const switch_cfg_superedge &edge, const gswitch *switch_stmt)
map_t m_map
Definition constraint-manager.h:243
const bounded_ranges * get_or_create_empty()
hash_map< bounded_ranges *, bounded_ranges *, traits_t > map_t
Definition constraint-manager.h:242
const bounded_ranges * get_or_create_range(const_tree lower_bound, const_tree upper_bound)
const bounded_ranges * get_or_create_union(const vec< const bounded_ranges * > &others)
void log_stats(logger *logger, bool show_objs) const
edge_cache_t m_edge_cache
Definition constraint-manager.h:247
const bounded_ranges * get_or_create_point(const_tree value)
const bounded_ranges * consolidate(bounded_ranges *)
~bounded_ranges_manager()
const bounded_ranges * get_or_create_ranges_for_switch(const switch_cfg_superedge *edge, const gswitch *switch_stmt)
const bounded_ranges * make_case_label_ranges(const gswitch *switch_stmt, tree case_label)
hash_map< const switch_cfg_superedge *, const bounded_ranges * > edge_cache_t
Definition constraint-manager.h:246
Definition call-summary.h:68
Definition constraint-manager.h:425
bool add_constraint(const svalue *lhs, enum tree_code op, const svalue *rhs)
bool add_bounded_ranges(const svalue *sval, const bounded_ranges *ranges)
constraint_manager(const constraint_manager &other)
tristate eval_condition(equiv_class_id lhs, enum tree_code op, equiv_class_id rhs) const
region_model_manager * m_mgr
Definition constraint-manager.h:530
void print(pretty_printer *pp) const
bool get_equiv_class_by_svalue(const svalue *sval, equiv_class_id *out) const
range get_ec_bounds(equiv_class_id ec_id) const
void add_unknown_constraint(equiv_class_id lhs_ec_id, enum tree_code op, equiv_class_id rhs_ec_id)
void dump(FILE *fp) const
virtual ~constraint_manager()
Definition constraint-manager.h:429
void add_constraint_internal(equiv_class_id lhs_id, enum constraint_op c_op, equiv_class_id rhs_id)
constraint_manager(region_model_manager *mgr)
Definition constraint-manager.h:427
constraint_manager & operator=(const constraint_manager &other)
void purge_state_involving(const svalue *sval)
const equiv_class & get_equiv_class_by_index(unsigned idx) const
Definition constraint-manager.h:450
void for_each_fact(fact_visitor *) const
auto_vec< constraint > m_constraints
Definition constraint-manager.h:520
tristate eval_condition(const svalue *lhs, enum tree_code op, const svalue *rhs) const
void dump_to_pp(pretty_printer *pp, bool multiline) const
equiv_class & get_equiv_class_by_index(unsigned idx)
Definition constraint-manager.h:454
static void merge(const constraint_manager &cm_a, const constraint_manager &cm_b, constraint_manager *out)
auto_vec< bounded_ranges_constraint > m_bounded_ranges_constraints
Definition constraint-manager.h:521
void purge(const PurgeCriteria &p, purge_stats *stats)
bool operator==(const constraint_manager &other) const
equiv_class_id get_or_add_equiv_class(const svalue *sval)
equiv_class & get_equiv_class(const svalue *sval)
Definition constraint-manager.h:459
auto_delete_vec< equiv_class > m_equiv_classes
Definition constraint-manager.h:519
tristate eval_condition(equiv_class_id lhs_ec, enum tree_code op, tree rhs_const) const
bool impossible_derived_conditions_p(const svalue *lhs, const svalue *rhs) const
bool replay_call_summary(call_summary_replay &r, const constraint_manager &summary)
bounded_ranges_manager * get_range_manager() const
bool operator!=(const constraint_manager &other) const
Definition constraint-manager.h:435
std::unique_ptr< json::object > to_json() const
bool add_constraint(equiv_class_id lhs_ec_id, enum tree_code op, equiv_class_id rhs_ec_id)
bool sval_constrained_p(const svalue *sval) const
std::unique_ptr< text_art::tree_widget > make_dump_widget(const text_art::dump_widget_info &dwi) const
void on_liveness_change(const svalue_set &live_svalues, const region_model *model)
Definition constraint-manager.h:343
equiv_class_id m_rhs
Definition constraint-manager.h:374
std::unique_ptr< json::object > to_json() const
bool operator==(const constraint &other) const
enum constraint_op m_op
Definition constraint-manager.h:373
equiv_class_id m_lhs
Definition constraint-manager.h:372
bool is_ordering_p() const
Definition constraint-manager.h:364
std::unique_ptr< text_art::widget > make_dump_widget(const text_art::dump_widget_info &dwi, const constraint_manager &cm) const
constraint(equiv_class_id lhs, enum constraint_op c_op, equiv_class_id rhs)
Definition constraint-manager.h:345
void print(pretty_printer *pp, const constraint_manager &cm) const
bool implied_by(const constraint &other, const constraint_manager &cm) const
Definition constraint-manager.h:307
equiv_class_id(unsigned idx)
Definition constraint-manager.h:311
static equiv_class_id from_int(int idx)
Definition constraint-manager.h:326
bool operator!=(const equiv_class_id &other) const
Definition constraint-manager.h:319
const equiv_class & get_obj(const constraint_manager &cm) const
bool operator==(const equiv_class_id &other) const
Definition constraint-manager.h:315
int as_int() const
Definition constraint-manager.h:327
void print(pretty_printer *pp) const
int m_idx
Definition constraint-manager.h:337
bool null_p() const
Definition constraint-manager.h:324
void update_for_removal(equiv_class_id other)
Definition constraint-manager.h:331
static equiv_class_id null()
Definition constraint-manager.h:309
equiv_class & get_obj(constraint_manager &cm) const
Definition constraint-manager.h:255
tree m_constant
Definition constraint-manager.h:285
bool contains_non_constant_p() const
const svalue * get_representative() const
const svalue * m_cst_sval
Definition constraint-manager.h:286
auto_vec< const svalue * > m_vars
Definition constraint-manager.h:289
void add(const svalue *sval)
bool del(const svalue *sval)
tree get_any_constant() const
Definition constraint-manager.h:266
void print(pretty_printer *pp) const
equiv_class(const equiv_class &other)
std::unique_ptr< text_art::tree_widget > make_dump_widget(const text_art::dump_widget_info &dwi, unsigned id) const
bool operator==(const equiv_class &other)
std::unique_ptr< json::object > to_json() const
Definition constraint-manager.h:380
virtual void on_ranges(const svalue *lhs, const bounded_ranges *ranges)=0
virtual void on_fact(const svalue *lhs, enum tree_code, const svalue *rhs)=0
virtual ~fact_visitor()
Definition constraint-manager.h:382
Definition analyzer-logging.h:34
Definition constraint-manager.h:54
void dump_to_pp(pretty_printer *pp) const
bound m_lower_bound
Definition constraint-manager.h:74
tree constrained_to_single_element()
bool add_bound(bound b, enum bound_kind bound_kind)
bool add_bound(enum tree_code op, tree rhs_const)
bound m_upper_bound
Definition constraint-manager.h:75
range(const bound &lower, const bound &upper)
Definition constraint-manager.h:57
range()
Definition constraint-manager.h:56
bool below_lower_bound(tree rhs_const) const
bool above_upper_bound(tree rhs_const) const
tristate eval_condition(enum tree_code op, tree rhs_const) const
Definition region-model-manager.h:32
Definition region-model.h:263
Definition supergraph.h:557
Definition pretty-print.h:241
class edge_def * edge
Definition coretypes.h:352
const union tree_node * const_tree
Definition coretypes.h:98
union tree_node * tree
Definition coretypes.h:97
static void lower(vec< simplify * > &simplifiers, bool gimple)
Definition genmatch.cc:2353
tree_code
Definition genmatch.cc:992
Definition access-diagram.h:30
constraint_op
Definition constraint-manager.h:295
@ CONSTRAINT_NE
Definition constraint-manager.h:296
@ CONSTRAINT_LE
Definition constraint-manager.h:298
@ CONSTRAINT_LT
Definition constraint-manager.h:297
bound_kind
Definition constraint-manager.h:29
@ BK_LOWER
Definition constraint-manager.h:30
@ BK_UPPER
Definition constraint-manager.h:31
const char * constraint_op_code(enum constraint_op c_op)
poly_int< N, C > r
Definition poly-int.h:774
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
Definition constraint-manager.h:37
bool m_closed
Definition constraint-manager.h:47
bound()
Definition constraint-manager.h:38
tree m_constant
Definition constraint-manager.h:46
bound(tree constant, bool closed)
Definition constraint-manager.h:39
void ensure_closed(enum bound_kind bound_kind)
const char * get_relation_as_str() const
Definition constraint-manager.h:82
void dump_to_pp(pretty_printer *pp, bool show_types) const
bool singleton_p() const
Definition constraint-manager.h:106
static void set_json_attr(json::object &obj, const char *name, tree value)
tree m_upper
Definition constraint-manager.h:112
std::unique_ptr< json::object > to_json() const
bool contains_p(tree cst) const
bool operator==(const bounded_range &other) const
void dump(bool show_types) const
std::unique_ptr< text_art::widget > make_dump_widget(const text_art::dump_widget_info &dwi) const
bounded_range(const_tree lower, const_tree upper)
static int cmp(const bounded_range &a, const bounded_range &b)
tree m_lower
Definition constraint-manager.h:111
bool intersects_p(const bounded_range &other, bounded_range *out) const
bool operator!=(const bounded_range &other) const
Definition constraint-manager.h:99
Definition constraint-manager.h:215
static bool is_empty(key_type k)
Definition constraint-manager.h:229
static hashval_t hash(const key_type &k)
Definition constraint-manager.h:225
static void mark_empty(key_type &k)
Definition constraint-manager.h:230
static bool is_deleted(key_type k)
Definition constraint-manager.h:231
static bool equal(const key_type &k1, const key_type &k2)
Definition constraint-manager.h:220
bounded_ranges * key_type
Definition constraint-manager.h:216
bounded_ranges * value_type
Definition constraint-manager.h:217
static const bool empty_zero_p
Definition constraint-manager.h:236
Definition constraint-manager.h:240
Definition constraint-manager.h:123
bounded_ranges(enum tree_code op, tree rhs_const)
bounded_ranges(const bounded_range &range)
bounded_ranges key_t
Definition constraint-manager.h:125
static int cmp(const bounded_ranges *a, const bounded_ranges *b)
hashval_t m_hash
Definition constraint-manager.h:162
auto_vec< bounded_range > m_ranges
Definition constraint-manager.h:161
unsigned get_count() const
Definition constraint-manager.h:152
bool contain_p(tree cst) const
bounded_ranges(const vec< bounded_range > &ranges)
void dump(bool show_types) const
tristate eval_condition(enum tree_code op, tree rhs_const, bounded_ranges_manager *mgr) const
hashval_t get_hash() const
Definition constraint-manager.h:133
void add_to_dump_widget(text_art::tree_widget &parent, const text_art::dump_widget_info &dwi) const
void dump_to_pp(pretty_printer *pp, bool show_types) const
bool empty_p() const
Definition constraint-manager.h:148
std::unique_ptr< json::value > to_json() const
const bounded_range & get_range(unsigned idx) const
Definition constraint-manager.h:153
bool operator==(const bounded_ranges &other) const
Definition region-model.h:200
Definition exploded-graph.h:512
Definition hash-traits.h:466
Definition analyzer.h:508
Definition hash-map-traits.h:33
Definition gengtype.h:252
Definition hash-traits.h:75
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:814
#define false
Definition system.h:888
bool tree_int_cst_equal(const_tree t1, const_tree t2)
Definition tree.cc:6423
#define NULL_TREE
Definition tree.h:317