GCC Middle and Back End API Reference
value-relation.h
Go to the documentation of this file.
1/* Header file for the value range relational processing.
2 Copyright (C) 2020-2026 Free Software Foundation, Inc.
3 Contributed by Andrew MacLeod <amacleod@redhat.com>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 3, or (at your option) any later
10version.
11
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#ifndef GCC_VALUE_RELATION_H
22#define GCC_VALUE_RELATION_H
23
24
25// This file provides access to a relation oracle which can be used to
26// maintain and query relations and equivalences between SSA_NAMES.
27//
28// The general range_query object provided in value-query.h provides
29// access to an oracle, if one is available, via the oracle() method.
30// There are also a couple of access routines provided, which even if there is
31// no oracle, will return the default VREL_VARYING no relation.
32//
33// Typically, when a ranger object is active, there will be an oracle, and
34// any information available can be directly queried. Ranger also sets and
35// utilizes the relation information to enhance it's range calculations, this
36// is totally transparent to the client, and they are free to make queries.
37//
38// relation_kind is a new enum which represents the different relations,
39// often with a direct mapping to tree codes. ie VREL_EQ is equivalent to
40// EQ_EXPR.
41//
42// A query is made requesting the relation between SSA1 and SSA@ in a basic
43// block, or on an edge, the possible return values are:
44//
45// VREL_EQ, VREL_NE, VREL_LT, VREL_LE, VREL_GT, and VREL_GE mean the same.
46// VREL_VARYING : No relation between the 2 names.
47// VREL_UNDEFINED : Impossible relation (ie, A < B && A > B)
48//
49// The oracle maintains VREL_EQ relations with equivalency sets, so if a
50// relation comes back VREL_EQ, it is also possible to query the set of
51// equivalencies. These are basically bitmaps over ssa_names. An iterator is
52// provided later for this activity.
53//
54// Relations are maintained via the dominance trees and are optimized assuming
55// they are registered in dominance order. When a new relation is added, it
56// is intersected with whatever existing relation exists in the dominance tree
57// and registered at the specified block.
58
59
60// These codes are arranged such that VREL_VARYING is the first code, and all
61// the rest are contiguous.
62
63typedef enum relation_kind_t
64{
65 VREL_VARYING = 0, // No known relation, AKA varying.
66 VREL_UNDEFINED, // Impossible relation, ie (r1 < r2) && (r2 > r1)
67 VREL_LT, // r1 < r2
68 VREL_LE, // r1 <= r2
69 VREL_GT, // r1 > r2
70 VREL_GE, // r1 >= r2
71 VREL_EQ, // r1 == r2
72 VREL_NE, // r1 != r2
73 VREL_PE8, // 8 bit partial equivalency
74 VREL_PE16, // 16 bit partial equivalency
75 VREL_PE32, // 32 bit partial equivalency
76 VREL_PE64, // 64 bit partial equivalency
77 VREL_LAST // terminate, not a real relation.
79
80// General relation kind transformations.
86 { return (r >= VREL_LT && r <= VREL_GE); }
88 { return (r >= VREL_PE8 && r <= VREL_PE64); }
90 { return r == VREL_EQ || relation_partial_equiv_p (r); }
91
92void print_relation (FILE *f, relation_kind rel);
93
94// Adjust range as an equivalence.
96
98{
99public:
101 virtual ~relation_oracle () { }
102
103 // register a relation between 2 ssa names.
104 bool record (gimple *, relation_kind, tree, tree);
106 virtual bool record (basic_block, relation_kind, tree, tree) { return false; }
107
108 // Query if there is any relation between SSA1 and SSA2.
109 relation_kind query (gimple *s, tree ssa1, tree ssa2);
110 relation_kind query (edge e, tree ssa1, tree ssa2);
112
113 // Remove relations for an SSA_NAME
114 virtual void clear (tree) { }
115
116 virtual void dump (FILE *, basic_block) const { }
117 virtual void dump (FILE *) const { }
118 void debug () const;
119protected:
124 tree) const
125 { return NULL; }
126 // Return equivalency set for an SSA name in a basic block.
128 // Return partial equivalency record for an SSA name.
129 virtual const class pe_slice *partial_equiv_set (tree) { return NULL; }
130 void valid_equivs (bitmap b, const_bitmap equivs, basic_block bb);
131 // Query for a relation between two equivalency sets in a basic block.
134 friend class path_oracle;
135 // Used to Avoid registering multiple eqiuvalences from the same statement.
137};
138
139// Instance with no storage used for default queries with no active oracle.
141
142// This class represents an equivalency set, and contains a link to the next
143// one in the list to be searched.
144
146{
147public:
148 bitmap m_names; // ssa-names in equiv set.
149 basic_block m_bb; // Block this belongs to
150 equiv_chain *m_next; // Next in block list.
151 void dump (FILE *f) const; // Show names in this list.
152 equiv_chain *find (unsigned ssa);
153};
154
156{
157public:
158 tree ssa_base; // Slice of this name.
159 relation_kind code; // bits that are equivalent.
160 bitmap members; // Other members in the partial equivalency.
161};
162
163// The equivalency oracle maintains equivalencies using the dominator tree.
164// Equivalencies apply to an entire basic block. Equivalencies on edges
165// can be represented only on edges whose destination is a single-pred block,
166// and the equivalence is simply applied to that successor block.
167
169{
170public:
171 equiv_oracle ();
172 ~equiv_oracle ();
173
174 const_bitmap equiv_set (tree ssa, basic_block bb) final override;
175 bool record (basic_block bb, relation_kind k, tree ssa1, tree ssa2) override;
176
177 relation_kind partial_equiv (tree ssa1, tree ssa2, tree *base = NULL) const;
180
181 void clear (tree name) override;
182 void dump (FILE *f, basic_block bb) const override;
183 void dump (FILE *f) const override;
184
185protected:
187 const pe_slice *partial_equiv_set (tree name) final override;
188 inline bool has_equiv_p (unsigned v) { return bitmap_bit_p (m_equiv_set, v); }
190 struct obstack m_chain_obstack;
191private:
192 bitmap m_equiv_set; // Index by ssa-name. true if an equivalence exists.
193 vec <equiv_chain *> m_equiv; // Index by BB. list of equivalences.
195 {
196 public:
197 bitmap m_self_equiv; // Self equivalency set.
198 bitmap m_block_list; // BB's name occurs in equivalencies.
199 };
200 vec <name_info> m_name_info; // Index by ssa-name.
201 vec <pe_slice> m_partial; // Partial equivalencies.
202
203 void limit_check (basic_block bb = NULL);
204 equiv_chain *find_equiv_block (unsigned ssa, int bb) const;
205 equiv_chain *find_equiv_dom (tree name, basic_block bb) const;
206
207 bitmap register_equiv (basic_block bb, unsigned v, equiv_chain *equiv_1);
209 equiv_chain *equiv_2);
210
211 void register_equiv_block (unsigned v, unsigned bbi);
213
214 void register_initial_def (tree ssa);
215 void add_equiv_to_block (basic_block bb, bitmap equiv);
216};
217
218// Summary block header for relations.
219
221{
222public:
223 bitmap m_names; // ssa_names with relations in this block.
224 class relation_chain *m_head; // List of relations in block.
225 int m_num_relations; // Number of relations in block.
227 void clear (tree name);
228};
229
230
231// This class tracks what is known on one side of a frontier search.
232// It represents the relation that root has to each other name.
233// All relations are M_ROOT <REL> ssa_name (v).
234// The m_rhs flag indicates if this is the LHS or RHS of a relation search.
235// This is used to determine if the relation needs to be swapped in order
236// to perform a transitive operation: TRANS (LHS op X , X op RHS).
237// m_visited is also used to efficiently clear the structure.
238// All relations default to VREL_VARYING.
239
241public:
242 frontier_data (bitmap_obstack *obstack, bool rhs);
243 ~frontier_data () { m_known.release (); }
244
245 void clear_search ();
246 bool visited_p (unsigned v) const { return bitmap_bit_p (m_visited, v); }
247 relation_kind known_relation (unsigned v) const;
248 void set_known (unsigned v, relation_kind rel);
249
253 bool m_rhs; // True if rooted at the RHS of the query.
254};
255
256// A relation oracle maintains a set of relations between ssa_names using the
257// dominator tree structures. Equivalencies are considered a subset of
258// a general relation and maintained by an equivalence oracle by transparently
259// passing any EQ_EXPR relations to it.
260// Relations are handled at the basic block level. All relations apply to
261// an entire block, and are thus kept in a summary index by block.
262// Similar to the equivalence oracle, edges are handled by applying the
263// relation to the destination block of the edge, but ONLY if that block
264// has a single successor. For now.
265
267{
268public:
269 dom_oracle ();
270 ~dom_oracle ();
271
272 bool record (basic_block bb, relation_kind k, tree op1, tree op2)
273 final override;
274
275 relation_kind query (basic_block bb, tree ssa1, tree ssa2) final override;
277 final override;
278
279 void clear (tree name) override;
280
281 void dump (FILE *f, basic_block bb) const final override;
282 void dump (FILE *f) const final override;
283protected:
285 tree) const override;
287 bitmap m_relation_set; // Index by ssa-name. True if a relation exists
288 vec <relation_chain_head> m_relations; // Index by BB, list of relations.
289 vec <bitmap> m_block_list; // Index by ssa-name. Blocks with relations.
291 const_bitmap b2) const;
292 relation_kind find_relation_block (int bb, tree ssa1, tree ssa2,
293 relation_chain **obj = NULL) const;
294 relation_kind find_relation_dom (basic_block bb, tree ssa1, tree ssa2) const;
296 tree op1, tree op2);
298 tree op1, tree op2);
299 void record_relation_block (unsigned v, unsigned bbi);
305
306 // NAME is related to the requested ssa name via REL in block BB
307 // nearest_relations () calls will fill this vector.
314
317
318 // One element waiting to be expanded from the frontier.
319 // "implied root <REL> NAME" is the known relation, found in BB.
320 // RHS indicates if root is the LHS or RHS operand of the original request.
327
328 // Both LHS and RHS frontiers share a single worklist, so whichever side
329 // has work outstanding is processed.
330 // M_WL_IX is the next entry to expand; everything before it is done.
332 unsigned m_wl_ix;
333
334 void start_search (frontier_data &side, tree root, const_bitmap equiv,
335 basic_block bb);
336 void add_to_frontier (frontier_data &side, tree name, relation_kind rel,
337 basic_block bb);
339 relation_kind &result);
340};
341
342// A path_oracle implements relations in a list. The only sense of ordering
343// is the latest registered relation is the first found during a search.
344// It can be constructed with an optional "root" oracle which will be used
345// to look up any relations not found in the list.
346// This allows the client to walk paths starting at some block and register
347// and query relations along that path, ignoring other edges.
348//
349// For registering a relation, a query if made of the root oracle if there is
350// any known relationship at block BB, and it is combined with this new
351// relation and entered in the list.
352//
353// Queries are resolved by looking first in the list, and only if nothing is
354// found is the root oracle queried at block BB.
355//
356// reset_path is used to clear all locally registered paths to initial state.
357
359{
360public:
361 path_oracle (relation_oracle *oracle = NULL);
362 ~path_oracle ();
363 const_bitmap equiv_set (tree, basic_block) final override;
364 bool record (basic_block, relation_kind, tree, tree) final override;
365 void killing_def (tree);
366 relation_kind query (basic_block, tree, tree) final override;
368 void reset_path (relation_oracle *oracle = NULL);
369 void set_root_oracle (relation_oracle *oracle) { m_root = oracle; }
370
371 void clear (tree name) override;
372
373 void dump (FILE *, basic_block) const final override;
374 void dump (FILE *) const final override;
375private:
376 bool register_equiv (basic_block bb, tree ssa1, tree ssa2);
381
383 struct obstack m_chain_obstack;
384};
385
386// Used to assist with iterating over the equivalence list.
388public:
390 bool full = true, bool partial = false);
391 void next ();
393protected:
398 unsigned m_y;
400};
401
402#define FOR_EACH_EQUIVALENCE(oracle, bb, name, equiv_name) \
403 for (equiv_relation_iterator iter (oracle, bb, name, true, false); \
404 ((equiv_name) = iter.get_name ()); \
405 iter.next ())
406
407#define FOR_EACH_PARTIAL_EQUIV(oracle, bb, name, equiv_name, equiv_rel) \
408 for (equiv_relation_iterator iter (oracle, bb, name, false, true); \
409 ((equiv_name) = iter.get_name (&equiv_rel)); \
410 iter.next ())
411
412#define FOR_EACH_PARTIAL_AND_FULL_EQUIV(oracle, bb, name, equiv_name, \
413 equiv_rel) \
414 for (equiv_relation_iterator iter (oracle, bb, name, true, true); \
415 ((equiv_name) = iter.get_name (&equiv_rel)); \
416 iter.next ())
417
418// -----------------------------------------------------------------------
419
420// Range-ops deals with a LHS and 2 operands. A relation trio is a set of
421// 3 potential relations packed into a single unsigned value.
422// 1 - LHS relation OP1
423// 2 - LHS relation OP2
424// 3 - OP1 relation OP2
425// VREL_VARYING is a value of 0, and is the default for each position.
444
445// Default VREL_VARYING for all 3 relations.
446#define TRIO_VARYING relation_trio ()
447
448#define TRIO_SHIFT 4
449#define TRIO_MASK 0x000F
450
451// These 3 classes are shortcuts for when a caller has a single relation to
452// pass as a trio, it can simply construct the appropriate one. The other
453// unspecified relations will be VREL_VARYING.
454
456{
458 m_val = 0;
459}
460
464{
466 unsigned i1 = (unsigned) lhs_op1;
467 unsigned i2 = ((unsigned) lhs_op2) << TRIO_SHIFT;
468 unsigned i3 = ((unsigned) op1_op2) << (TRIO_SHIFT * 2);
469 m_val = i1 | i2 | i3;
470}
471
472inline relation_trio
477inline relation_trio
482inline relation_trio
487
488inline relation_kind
493
494inline relation_kind
499
500inline relation_kind
502{
503 return (relation_kind) ((m_val >> (TRIO_SHIFT * 2)) & TRIO_MASK);
504}
505
506inline relation_trio
511
512// -----------------------------------------------------------------------
513
514// The value-relation class is used to encapsulate the representation of an
515// individual relation between 2 ssa-names, and to facilitate operating on
516// the relation.
517
519{
520public:
523 void set_relation (relation_kind kind, tree n1, tree n2);
524
525 inline relation_kind kind () const { return related; }
526 inline tree op1 () const { return name1; }
527 inline tree op2 () const { return name2; }
528
530 bool union_ (value_relation &p);
531 bool intersect (value_relation &p);
532 void swap ();
533 bool apply_transitive (const value_relation &rel);
534
535 void dump (FILE *f) const;
536private:
539};
540
541// Set relation R between ssa_name N1 and N2.
542
543inline void
545{
546 gcc_checking_assert (TREE_CODE (n1) == SSA_NAME
547 && TREE_CODE (n2) == SSA_NAME);
548 related = r;
549 name1 = n1;
550 name2 = n2;
551}
552
553// Default constructor.
554
555inline
562
563// Constructor for relation R between SSA version N1 and N2.
564
565inline
570
571
583
584#define FOR_EACH_RELATION_BB(oracle, bb, vr) \
585 for (block_relation_iterator iter (oracle, bb, vr); \
586 !iter.m_done; \
587 iter.get_next_relation (vr))
588
589#define FOR_EACH_RELATION_NAME(oracle, bb, name, vr) \
590 for (block_relation_iterator iter (oracle, bb, vr, name); \
591 !iter.m_done; \
592 iter.get_next_relation (vr))
593
594
595// Return the number of bits associated with partial equivalency T.
596// Return 0 if this is not a supported partial equivalency relation.
597
598inline int
600{
601 switch (t)
602 {
603 case VREL_PE8:
604 return 8;
605 case VREL_PE16:
606 return 16;
607 case VREL_PE32:
608 return 32;
609 case VREL_PE64:
610 return 64;
611 default:
612 return 0;
613 }
614}
615
616// Return the partial equivalency code associated with the number of BITS.
617// return VREL_VARYING if there is no exact match.
618
619inline relation_kind
620bits_to_pe (int bits)
621{
622 switch (bits)
623 {
624 case 8:
625 return VREL_PE8;
626 case 16:
627 return VREL_PE16;
628 case 32:
629 return VREL_PE32;
630 case 64:
631 return VREL_PE64;
632 default:
633 return VREL_VARYING;
634 }
635}
636
637// Given partial equivalencies T1 and T2, return the smallest kind.
638
639inline relation_kind
641{
644 // VREL_PE are declared small to large, so simple min will suffice.
645 return MIN (t1, t2);
646}
647#endif /* GCC_VALUE_RELATION_H */
const relation_oracle * m_oracle
Definition value-relation.h:577
basic_block m_bb
Definition value-relation.h:578
void get_next_relation(value_relation &vr)
Definition value-relation.cc:1158
block_relation_iterator(const relation_oracle *oracle, basic_block bb, value_relation &, tree name=NULL)
Definition value-relation.cc:1137
bool m_done
Definition value-relation.h:580
tree m_name
Definition value-relation.h:581
relation_chain * m_ptr
Definition value-relation.h:579
vec< struct related > m_near
Definition value-relation.h:313
frontier_data m_rhs_search
Definition value-relation.h:316
relation_chain * create_relation_in_bb(basic_block bb, relation_kind k, tree op1, tree op2)
Definition value-relation.cc:1459
void cache_relation(basic_block, relation_kind, tree, tree)
Definition value-relation.cc:1883
bool record(basic_block bb, relation_kind k, tree op1, tree op2) final override
Definition value-relation.cc:1421
bitmap m_tmp2
Definition value-relation.h:286
basic_block nearest_relations(tree name, basic_block bb)
Definition value-relation.cc:1829
virtual relation_chain * next_relation(basic_block, relation_chain *, tree) const override
Definition value-relation.cc:1110
relation_chain * search_and_merge_relation(basic_block bb, relation_kind k, tree op1, tree op2)
Definition value-relation.cc:1508
unsigned m_wl_ix
Definition value-relation.h:332
void dump(FILE *f, basic_block bb) const final override
Definition value-relation.cc:2145
void start_search(frontier_data &side, tree root, const_bitmap equiv, basic_block bb)
Definition value-relation.cc:1900
vec< struct frontier_element > m_worklist
Definition value-relation.h:331
vec< bitmap > m_block_list
Definition value-relation.h:289
frontier_data m_lhs_search
Definition value-relation.h:315
void record_relation_block(unsigned v, unsigned bbi)
Definition value-relation.cc:1443
void clear(tree name) override
Definition value-relation.cc:1319
relation_kind find_relation_dom(basic_block bb, tree ssa1, tree ssa2) const
Definition value-relation.cc:1803
relation_kind relation_search(basic_block, tree, const_bitmap, tree, const_bitmap)
Definition value-relation.cc:2034
bitmap m_relation_set
Definition value-relation.h:287
relation_kind query(basic_block bb, tree ssa1, tree ssa2) final override
Definition value-relation.cc:2111
relation_kind find_relation_block(unsigned bb, const_bitmap b1, const_bitmap b2) const
Definition value-relation.cc:1558
bitmap m_tmp
Definition value-relation.h:286
dom_oracle()
Definition value-relation.cc:1260
relation_kind recomputed_relation(basic_block, tree, tree) const
Definition value-relation.cc:1641
bool expand_frontier(frontier_element w, basic_block bb, relation_kind &result)
Definition value-relation.cc:1958
vec< relation_chain_head > m_relations
Definition value-relation.h:288
void add_to_frontier(frontier_data &side, tree name, relation_kind rel, basic_block bb)
Definition value-relation.cc:1929
Definition value-relation.h:146
void dump(FILE *f) const
Definition value-relation.cc:364
equiv_chain * find(unsigned ssa)
Definition value-relation.cc:347
equiv_chain * m_next
Definition value-relation.h:150
bitmap m_names
Definition value-relation.h:148
basic_block m_bb
Definition value-relation.h:149
Definition value-relation.h:195
bitmap m_block_list
Definition value-relation.h:198
bitmap m_self_equiv
Definition value-relation.h:197
relation_kind partial_equiv(tree ssa1, tree ssa2, tree *base=NULL) const
Definition value-relation.cc:510
bool has_equiv_p(unsigned v)
Definition value-relation.h:188
equiv_chain * find_equiv_dom(tree name, basic_block bb) const
Definition value-relation.cc:616
const_bitmap equiv_set(tree ssa, basic_block bb) final override
Definition value-relation.cc:555
void register_equiv_block(unsigned v, unsigned bbi)
Definition value-relation.cc:530
bool record(basic_block bb, relation_kind k, tree ssa1, tree ssa2) override
Definition value-relation.cc:776
vec< pe_slice > m_partial
Definition value-relation.h:201
bitmap m_equiv_set
Definition value-relation.h:192
bitmap_obstack m_bitmaps
Definition value-relation.h:189
void limit_check(basic_block bb=NULL)
Definition value-relation.cc:868
struct obstack m_chain_obstack
Definition value-relation.h:190
vec< name_info > m_name_info
Definition value-relation.h:200
equiv_oracle()
Definition value-relation.cc:387
bool add_partial_equiv(relation_kind, tree, tree)
Definition value-relation.cc:420
void dump(FILE *f, basic_block bb) const override
Definition value-relation.cc:878
relation_kind query(basic_block, tree, tree) override
Definition value-relation.cc:578
equiv_chain * find_equiv_block(unsigned ssa, int bb) const
Definition value-relation.cc:604
vec< equiv_chain * > m_equiv
Definition value-relation.h:193
const pe_slice * partial_equiv_set(tree name) final override
Definition value-relation.cc:497
void add_equiv_to_block(basic_block bb, bitmap equiv)
Definition value-relation.cc:835
void register_initial_def(tree ssa)
Definition value-relation.cc:714
bitmap register_equiv(basic_block bb, unsigned v, equiv_chain *equiv_1)
Definition value-relation.cc:638
void clear(tree name) override
Definition value-relation.cc:735
const pe_slice * m_pe
Definition value-relation.h:396
tree get_name(relation_kind *rel=NULL)
Definition value-relation.cc:2493
tree m_name
Definition value-relation.h:399
relation_oracle * m_oracle
Definition value-relation.h:394
unsigned m_y
Definition value-relation.h:398
bitmap_iterator m_bi
Definition value-relation.h:397
const_bitmap m_bm
Definition value-relation.h:395
void next()
Definition value-relation.cc:2484
equiv_relation_iterator(relation_oracle *oracle, basic_block bb, tree name, bool full=true, bool partial=false)
Definition value-relation.cc:2465
Definition value-relation.h:240
tree m_root
Definition value-relation.h:252
bitmap m_visited
Definition value-relation.h:250
void clear_search()
Definition value-relation.cc:1244
relation_kind known_relation(unsigned v) const
Definition value-relation.cc:1233
bool m_rhs
Definition value-relation.h:253
bool visited_p(unsigned v) const
Definition value-relation.h:246
void set_known(unsigned v, relation_kind rel)
Definition value-relation.cc:1223
frontier_data(bitmap_obstack *obstack, bool rhs)
Definition value-relation.cc:1212
~frontier_data()
Definition value-relation.h:243
vec< relation_kind > m_known
Definition value-relation.h:251
equiv_chain m_equiv
Definition value-relation.h:377
relation_kind query(basic_block, tree, tree) final override
Definition value-relation.cc:2395
relation_oracle * m_root
Definition value-relation.h:379
void reset_path(relation_oracle *oracle=NULL)
Definition value-relation.cc:2420
void dump(FILE *, basic_block) const final override
Definition value-relation.cc:2433
void killing_def(tree)
Definition value-relation.cc:2272
struct obstack m_chain_obstack
Definition value-relation.h:383
bitmap_obstack m_bitmaps
Definition value-relation.h:382
path_oracle(relation_oracle *oracle=NULL)
Definition value-relation.cc:2183
bitmap m_killed_defs
Definition value-relation.h:380
void set_root_oracle(relation_oracle *oracle)
Definition value-relation.h:369
bool record(basic_block, relation_kind, tree, tree) final override
Definition value-relation.cc:2319
const_bitmap equiv_set(tree, basic_block) final override
Definition value-relation.cc:2224
void clear(tree name) override
Definition value-relation.cc:2207
bool register_equiv(basic_block bb, tree ssa1, tree ssa2)
Definition value-relation.cc:2245
relation_chain_head m_relations
Definition value-relation.h:378
Definition value-relation.h:156
tree ssa_base
Definition value-relation.h:158
relation_kind code
Definition value-relation.h:159
bitmap members
Definition value-relation.h:160
Definition value-relation.h:221
relation_kind find_relation(const_bitmap b1, const_bitmap b2) const
Definition value-relation.cc:1183
bitmap m_names
Definition value-relation.h:223
int m_num_relations
Definition value-relation.h:225
void clear(tree name)
Definition value-relation.cc:1288
class relation_chain * m_head
Definition value-relation.h:224
Definition value-relation.cc:1099
Definition value-relation.h:98
relation_kind query(gimple *s, tree ssa1, tree ssa2)
Definition value-relation.cc:305
virtual void clear(tree)
Definition value-relation.h:114
virtual void dump(FILE *, basic_block) const
Definition value-relation.h:116
bitmap m_lhs_equiv_set_p
Definition value-relation.h:136
virtual ~relation_oracle()
Definition value-relation.h:101
virtual relation_kind query(basic_block, tree, tree)
Definition value-relation.h:111
friend class path_oracle
Definition value-relation.h:134
virtual void dump(FILE *) const
Definition value-relation.h:117
virtual const class pe_slice * partial_equiv_set(tree)
Definition value-relation.h:129
void valid_equivs(bitmap b, const_bitmap equivs, basic_block bb)
Definition value-relation.cc:284
virtual relation_kind query(basic_block, const_bitmap, const_bitmap)
Definition value-relation.h:132
bool record(gimple *, relation_kind, tree, tree)
Definition value-relation.cc:1344
friend class block_relation_iterator
Definition value-relation.h:121
virtual const_bitmap equiv_set(tree, basic_block)
Definition value-relation.h:127
virtual bool record(basic_block, relation_kind, tree, tree)
Definition value-relation.h:106
relation_oracle()
Definition value-relation.h:100
virtual class relation_chain * next_relation(basic_block, relation_chain *, tree) const
Definition value-relation.h:122
friend class equiv_relation_iterator
Definition value-relation.h:120
Definition value-relation.h:427
relation_kind op1_op2()
Definition value-relation.h:501
relation_kind lhs_op2()
Definition value-relation.h:495
unsigned m_val
Definition value-relation.h:442
relation_trio swap_op1_op2()
Definition value-relation.h:507
relation_trio()
Definition value-relation.h:455
relation_kind lhs_op1()
Definition value-relation.h:489
Definition value-relation.h:519
tree name1
Definition value-relation.h:538
relation_trio create_trio(tree lhs, tree op1, tree op2)
Definition value-relation.cc:1048
tree name2
Definition value-relation.h:538
bool union_(value_relation &p)
Definition value-relation.cc:962
void set_relation(relation_kind kind, tree n1, tree n2)
Definition value-relation.h:544
void dump(FILE *f) const
Definition value-relation.cc:1082
value_relation()
Definition value-relation.h:556
relation_kind kind() const
Definition value-relation.h:525
relation_kind related
Definition value-relation.h:537
bool apply_transitive(const value_relation &rel)
Definition value-relation.cc:981
tree op1() const
Definition value-relation.h:526
void swap()
Definition value-relation.cc:932
tree op2() const
Definition value-relation.h:527
bool intersect(value_relation &p)
Definition value-relation.cc:944
Definition value-range.h:88
bool debug
Definition collect-utils.cc:34
struct basic_block_def * basic_block
Definition coretypes.h:351
class edge_def * edge
Definition coretypes.h:348
const class bitmap_head * const_bitmap
Definition coretypes.h:52
class bitmap_head * bitmap
Definition coretypes.h:51
union tree_node * tree
Definition coretypes.h:97
int i2
Definition fp-test.cc:66
int i1
Definition fp-test.cc:66
#define bitmap_bit_p(bitstring, bitno)
Definition genautomata.cc:3429
poly_int< N, C > r
Definition poly-int.h:774
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Definition bitmap.h:519
Definition bitmap.h:293
Definition value-relation.h:321
basic_block bb
Definition value-relation.h:324
bool rhs
Definition value-relation.h:325
relation_kind rel
Definition value-relation.h:322
tree name
Definition value-relation.h:323
Definition value-relation.h:308
relation_kind rel
Definition value-relation.h:309
basic_block bb
Definition value-relation.h:311
tree name
Definition value-relation.h:310
Definition gimple.h:224
Definition vec.h:450
#define NULL
Definition system.h:58
#define MIN(X, Y)
Definition system.h:410
#define STATIC_ASSERT(X)
Definition system.h:869
#define gcc_checking_assert(EXPR)
Definition system.h:826
#define TREE_CODE(NODE)
Definition tree.h:325
#define NULL_TREE
Definition tree.h:318
relation_oracle default_relation_oracle
Definition value-query.cc:233
void adjust_equivalence_range(vrange &range)
Definition value-relation.cc:266
relation_kind relation_intersect(relation_kind r1, relation_kind r2)
Definition value-relation.cc:133
relation_kind relation_union(relation_kind r1, relation_kind r2)
Definition value-relation.cc:192
void print_relation(FILE *f, relation_kind rel)
Definition value-relation.cc:42
relation_kind relation_swap(relation_kind r)
Definition value-relation.cc:70
relation_kind relation_negate(relation_kind r)
Definition value-relation.cc:56
#define TRIO_MASK
Definition value-relation.h:449
enum relation_kind_t relation_kind
#define TRIO_SHIFT
Definition value-relation.h:448
int pe_to_bits(relation_kind t)
Definition value-relation.h:599
relation_kind_t
Definition value-relation.h:64
@ VREL_PE8
Definition value-relation.h:73
@ VREL_PE16
Definition value-relation.h:74
@ VREL_GT
Definition value-relation.h:69
@ VREL_LT
Definition value-relation.h:67
@ VREL_LE
Definition value-relation.h:68
@ VREL_LAST
Definition value-relation.h:77
@ VREL_NE
Definition value-relation.h:72
@ VREL_EQ
Definition value-relation.h:71
@ VREL_PE32
Definition value-relation.h:75
@ VREL_VARYING
Definition value-relation.h:65
@ VREL_UNDEFINED
Definition value-relation.h:66
@ VREL_GE
Definition value-relation.h:70
@ VREL_PE64
Definition value-relation.h:76
relation_kind pe_min(relation_kind t1, relation_kind t2)
Definition value-relation.h:640
bool relation_partial_equiv_p(relation_kind r)
Definition value-relation.h:87
relation_kind bits_to_pe(int bits)
Definition value-relation.h:620
bool relation_equiv_p(relation_kind r)
Definition value-relation.h:89
relation_kind relation_swap(relation_kind r)
Definition value-relation.cc:70
bool relation_lt_le_gt_ge_p(relation_kind r)
Definition value-relation.h:85