Lines Matching refs:occ

62 set_depth (struct et_occ *occ, int d)  in set_depth()  argument
64 if (!occ) in set_depth()
67 occ->min += d - occ->depth; in set_depth()
68 occ->depth = d; in set_depth()
74 set_depth_add (struct et_occ *occ, int d) in set_depth_add() argument
76 if (!occ) in set_depth_add()
79 occ->min += d; in set_depth_add()
80 occ->depth += d; in set_depth_add()
86 set_prev (struct et_occ *occ, struct et_occ *t) in set_prev() argument
89 gcc_assert (occ != t); in set_prev()
92 occ->prev = t; in set_prev()
94 t->parent = occ; in set_prev()
100 set_next (struct et_occ *occ, struct et_occ *t) in set_next() argument
103 gcc_assert (occ != t); in set_next()
106 occ->next = t; in set_next()
108 t->parent = occ; in set_next()
114 et_recomp_min (struct et_occ *occ) in et_recomp_min() argument
116 struct et_occ *mson = occ->prev; in et_recomp_min()
119 || (occ->next in et_recomp_min()
120 && mson->min > occ->next->min)) in et_recomp_min()
121 mson = occ->next; in et_recomp_min()
125 occ->min = mson->min + occ->depth; in et_recomp_min()
126 occ->min_occ = mson->min_occ; in et_recomp_min()
130 occ->min = occ->depth; in et_recomp_min()
131 occ->min_occ = occ; in et_recomp_min()
139 et_check_occ_sanity (struct et_occ *occ) in et_check_occ_sanity() argument
141 if (!occ) in et_check_occ_sanity()
144 gcc_assert (occ->parent != occ); in et_check_occ_sanity()
145 gcc_assert (occ->prev != occ); in et_check_occ_sanity()
146 gcc_assert (occ->next != occ); in et_check_occ_sanity()
147 gcc_assert (!occ->next || occ->next != occ->prev); in et_check_occ_sanity()
149 if (occ->next) in et_check_occ_sanity()
151 gcc_assert (occ->next != occ->parent); in et_check_occ_sanity()
152 gcc_assert (occ->next->parent == occ); in et_check_occ_sanity()
155 if (occ->prev) in et_check_occ_sanity()
157 gcc_assert (occ->prev != occ->parent); in et_check_occ_sanity()
158 gcc_assert (occ->prev->parent == occ); in et_check_occ_sanity()
161 gcc_assert (!occ->parent in et_check_occ_sanity()
162 || occ->parent->prev == occ in et_check_occ_sanity()
163 || occ->parent->next == occ); in et_check_occ_sanity()
169 et_check_sanity (struct et_occ *occ) in et_check_sanity() argument
171 et_check_occ_sanity (occ); in et_check_sanity()
172 if (occ->prev) in et_check_sanity()
173 et_check_sanity (occ->prev); in et_check_sanity()
174 if (occ->next) in et_check_sanity()
175 et_check_sanity (occ->next); in et_check_sanity()
181 et_check_tree_sanity (struct et_occ *occ) in et_check_tree_sanity() argument
183 while (occ->parent) in et_check_tree_sanity()
184 occ = occ->parent; in et_check_tree_sanity()
186 et_check_sanity (occ); in et_check_tree_sanity()
202 record_path_before_1 (struct et_occ *occ, int depth) in record_path_before_1() argument
206 depth += occ->depth; in record_path_before_1()
209 if (occ->prev) in record_path_before_1()
211 m = record_path_before_1 (occ->prev, depth); in record_path_before_1()
216 fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth); in record_path_before_1()
221 datas[len] = occ->of; in record_path_before_1()
224 if (occ->next) in record_path_before_1()
226 m = record_path_before_1 (occ->next, depth); in record_path_before_1()
231 gcc_assert (mn == occ->min + depth - occ->depth); in record_path_before_1()
239 record_path_before (struct et_occ *occ) in record_path_before() argument
241 while (occ->parent) in record_path_before()
242 occ = occ->parent; in record_path_before()
245 record_path_before_1 (occ, 0); in record_path_before()
253 check_path_after_1 (struct et_occ *occ, int depth) in check_path_after_1() argument
257 depth += occ->depth; in check_path_after_1()
260 if (occ->next) in check_path_after_1()
262 m = check_path_after_1 (occ->next, depth); in check_path_after_1()
268 gcc_assert (depths[len] == depth && datas[len] == occ->of); in check_path_after_1()
270 if (occ->prev) in check_path_after_1()
272 m = check_path_after_1 (occ->prev, depth); in check_path_after_1()
277 gcc_assert (mn == occ->min + depth - occ->depth); in check_path_after_1()
286 check_path_after (struct et_occ *occ) in check_path_after() argument
288 while (occ->parent) in check_path_after()
289 occ = occ->parent; in check_path_after()
291 check_path_after_1 (occ, 0); in check_path_after()
300 et_splay (struct et_occ *occ) in et_splay() argument
306 record_path_before (occ); in et_splay()
307 et_check_tree_sanity (occ); in et_splay()
310 while (occ->parent) in et_splay()
312 occ_depth = occ->depth; in et_splay()
314 f = occ->parent; in et_splay()
321 set_depth_add (occ, f_depth); in et_splay()
322 occ->min_occ = f->min_occ; in et_splay()
323 occ->min = f->min; in et_splay()
325 if (f->prev == occ) in et_splay()
328 set_prev (f, occ->next); in et_splay()
329 set_next (occ, f); in et_splay()
335 set_next (f, occ->prev); in et_splay()
336 set_prev (occ, f); in et_splay()
340 occ->parent = NULL; in et_splay()
344 et_check_tree_sanity (occ); in et_splay()
345 check_path_after (occ); in et_splay()
352 set_depth_add (occ, f_depth + gf_depth); in et_splay()
353 occ->min_occ = gf->min_occ; in et_splay()
354 occ->min = gf->min; in et_splay()
360 if (f->prev == occ) in et_splay()
364 set_prev (f, occ->next); in et_splay()
365 set_next (occ, f); in et_splay()
376 set_prev (gf, occ->next); in et_splay()
377 set_next (f, occ->prev); in et_splay()
378 set_prev (occ, f); in et_splay()
379 set_next (occ, gf); in et_splay()
389 if (f->prev == occ) in et_splay()
392 set_next (gf, occ->prev); in et_splay()
393 set_prev (f, occ->next); in et_splay()
394 set_prev (occ, gf); in et_splay()
395 set_next (occ, f); in et_splay()
406 set_next (f, occ->prev); in et_splay()
407 set_prev (occ, f); in et_splay()
417 occ->parent = ggf; in et_splay()
421 ggf->prev = occ; in et_splay()
423 ggf->next = occ; in et_splay()
429 et_check_tree_sanity (occ); in et_splay()
434 et_check_sanity (occ); in et_splay()
435 check_path_after (occ); in et_splay()
763 struct et_occ *occ = node->rightmost_occ, *r; in et_root() local
767 et_splay (occ); in et_root()
768 for (r = occ; r->next; r = r->next) in et_root()