1 /* src/vm/jit/optimizing/lifetimes.c - lifetime anaylsis
3 Copyright (C) 2005, 2006, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
31 #include "mm/memory.h"
33 #include "toolbox/bitvector.h"
34 #include "toolbox/worklist.h"
36 #include "vm/jit/builtin.hpp"
37 #include "vm/resolve.hpp"
38 #include "vm/exceptions.hpp"
39 #include "vm/string.hpp"
41 #include "vm/jit/jit.hpp"
43 #include "vm/jit/optimizing/graph.h"
44 #include "vm/jit/optimizing/lsra.h"
45 #include "vm/jit/optimizing/ssa.h"
46 #include "vm/jit/optimizing/lifetimes.h"
48 #ifdef LT_DEBUG_VERBOSE
49 #include "vm/options.h"
55 /* function prototypes */
56 void _lt_scanlifetimes(jitdata *jd, graphdata *gd, basicblock *bptr, int);
57 void lt_usage(jitdata *, s4 , int , int , int );
60 void lt_lifeoutatblock(lsradata *ls, graphdata *gd, int *M, int b_index,
61 struct lifetime *lt, worklist *W);
62 void lt_lifeatstatement(lsradata *ls, graphdata *gd, int b_index,
63 int iindex, struct lifetime *lt, bool life_in,
66 void lt_lifeinatstatement(lsradata *ls, graphdata *gd, int *M, int b_index,
67 int iindex, struct lifetime *lt);
68 void lt_lifeoutatstatement(lsradata *ls, graphdata *gd, int *M, int b_index,
69 int iindex, struct lifetime *lt);
72 void lt_get_nesting(lsradata *ls, graphdata *gd, dominatordata *dd);
75 void lt_set_use_site(struct lifetime *lt, struct site *use_site) {
78 struct site *lt_get_first_use_site(struct lifetime *lt, lt_iterator *iter) {
79 return ((*iter) = lt->use);
82 struct site *lt_get_next_site(lt_iterator *iter) {
86 return ((*iter) = (*iter)->next);
89 struct site *lt_get_first_def_site(struct lifetime *lt, lt_iterator *iter) {
90 return ((*iter) = lt->def);
93 bool lt_v_is_defined_at_s(lsradata *ls, int b_index, int iindex,
94 struct lifetime * lt) {
95 struct site *def_site;
99 is_defined_at_s = ((def_site->b_index == b_index)
100 && (def_site->iindex == iindex));
101 return is_defined_at_s;
104 /****************************************************************************
106 ****************************************************************************/
107 void lt_scanlifetimes(jitdata *jd, graphdata *gd, dominatordata *dd) {
121 lt_get_nesting(ls, gd, dd);
124 #if defined(LT_DEBUG_VERBOSE)
125 if (compileverbose) {
127 for (i=0; i < ls->basicblockcount; i++) {
130 l = ls->basicblocks[l]->nr;
131 printf("%3i(%3i) ", ls->sorted[i], l);
134 printf("Sorted_rev: ");
135 for (i=0; i < ls->basicblockcount; i++)
136 printf("%3i ", ls->sorted_rev[i]);
141 for(i = ls->basicblockcount - 1; i>= 0; i--)
142 if (ls->sorted[i] != -1)
143 _lt_scanlifetimes(jd, gd, ls->basicblocks[ls->sorted[i]],
146 /* Parameter initialisiation for locals [0 .. paramcount[ */
147 /* -> add local var write access at (bb=0,iindex=0) */
149 for (p = 0, l = 0; p < md->paramcount; p++) {
150 t = md->paramtypes[p].type;
151 i = jd->local_map[l * 5 + t];
153 if (IS_2_WORD_TYPE(t)) /* increment local counter for 2 word types */
158 /* _LT_ASSERT( i < jd->cd->maxlocals); */
159 /* printf("param %3i -> L %3i/%3i\n",p,i,t); */
160 _LT_ASSERT(t == VAR(i)->type);
162 /* Param to Local init happens before normal Code */
164 #ifdef LT_DEBUG_VERBOSE
168 lt_usage(jd, i, 0, 0, LT_DEF);
173 bool lt_is_simple_lt(struct lifetime *lt) {
174 lt_iterator i_def, i_use;
175 struct site *def, *use;
176 bool all_in_same_block;
179 def = lt_get_first_def_site(lt, &i_def);
180 use = lt_get_first_use_site(lt, &i_use);
181 all_in_same_block = true;
182 for (; (all_in_same_block && (use != NULL));
183 use = lt_get_next_site(&i_use)) {
185 (use->iindex >= 0) && (use->b_index == def->b_index);
187 return all_in_same_block;
190 void lt_is_live(lsradata *ls, struct lifetime *lt, int b_index, int iindex) {
193 bb_sorted = ls->sorted_rev[b_index];
195 if ((lt->bb_last_use < bb_sorted) ||
196 ((lt->bb_last_use == bb_sorted) && (lt->i_last_use < iindex))) {
197 lt->bb_last_use = bb_sorted;
198 lt->i_last_use = iindex;
200 if ((lt->bb_first_def > bb_sorted) ||
201 ((lt->bb_first_def == bb_sorted) && (lt->i_first_def > iindex))) {
202 lt->bb_first_def = bb_sorted;
203 lt->i_first_def = iindex;
207 void lt_set_simple_use(lsradata *ls, struct lifetime *lt) {
211 /* SAVEDVAR is nowhere set!!!! */
213 /* Def is first use */
214 /* lt->bb_first_def = ls->sorted_rev[lt->def->b_index]; */
215 /* lt->i_first_def = lt->def->iindex; */
217 lt_is_live(ls, lt, lt->def->b_index, lt->def->iindex);
220 use = lt_get_first_use_site(lt, &i_use);
221 /* lt->bb_last_use = ls->sorted_rev[use->b_index]; */
222 /* lt->i_last_use = use->iindex; */
223 for (; (use != NULL); use = lt_get_next_site(&i_use))
224 lt_is_live(ls, lt, use->b_index, use->iindex);
225 /* if (use->iindex > lt->i_last_use) */
226 /* lt->i_last_use = use->iindex; */
229 void lt_lifeness_analysis(jitdata *jd, graphdata *gd) {
230 int *M; /* bit_vecor of visited blocks */
231 int *use; /* bit_vecor of blocks with use sites visited */
232 worklist *W; /* Worklist of Basic Blocks, where lt is life-out */
234 struct site *use_site, *u_site;
235 lt_iterator iter, iter1;
236 graphiterator pred_iter;
238 int lt_index, i, pred, iindex, iindex1, b_index;
241 /* #define MEASURE_RT */
243 struct timespec time_start,time_end;
254 if (clock_gettime(CLOCK_THREAD_CPUTIME_ID,&(time_start)) != 0) {
255 fprintf(stderr,"could not get time: %s\n",strerror(errno));
260 M = bv_new(ls->basicblockcount);
261 use = bv_new(ls->basicblockcount);
262 W = wl_new(ls->basicblockcount);
264 #ifdef LT_DEBUG_VERBOSE
266 printf("LT_ANALYSE: \n");
268 for(lt_index = 0; lt_index < ls->lifetimecount; lt_index++) {
269 lt = &(ls->lifetime[lt_index]);
272 #ifdef LT_DEBUG_VERBOSE
274 printf("LT: %3i:", lt_index);
279 _LT_ASSERT(lt->def != NULL);
280 _LT_ASSERT(lt->def->next == NULL); /* SSA! */
281 /* _LT_ASSERT(lt->use != NULL); */
283 lt->bb_last_use = -1;
284 lt->bb_first_def = ls->basicblockcount;
286 bv_reset(M, ls->basicblockcount);
287 bv_reset(use, ls->basicblockcount);
288 wl_reset(W, ls->basicblockcount);
290 use_site = lt_get_first_use_site(lt, &iter);
292 /* Make unused Vars life at their Def Site */
294 if (use_site == NULL) {
295 lt_is_live(ls, lt, lt->def->b_index, lt->def->iindex);
296 if (lt->def->iindex < 0) {
298 /* def only in phi function */
300 lt_is_live(ls, lt, lt->def->b_index, 0);
303 for (;use_site != NULL; use_site = lt_get_next_site(&iter)) {
304 iindex = use_site->iindex;
305 if ((lt->def->b_index == use_site->b_index) &&
307 (iindex <= lt->def->iindex)) {
309 /* bv_set_bit(use, use_site->b_index); */
310 /* do normal analysis */
311 /* there is a use in a phi function before def site */
314 else if (bv_get_bit(use, use_site->b_index)) {
318 bv_set_bit(use, use_site->b_index);
320 /* use sites of this basic block not visited till now */
321 /* get use site of this bb with highest iindex lower than */
326 for(iter1= iter; u_site != NULL;
327 u_site = lt_get_next_site(&iter1)) {
328 if ((u_site->b_index == use_site->b_index) &&
329 (lt->def->b_index == use_site->b_index) &&
330 (u_site->iindex >= 0) &&
331 (u_site->iindex < lt->def->iindex) &&
332 (u_site->iindex > iindex1)) {
333 iindex1 = u_site->iindex;
335 if ((u_site->b_index == use_site->b_index) &&
336 (u_site->iindex > iindex))
337 iindex = u_site->iindex;
344 #ifdef LT_DEBUG_VERBOSE
346 printf("(%3i,%3i)", use_site->b_index, iindex);
351 /* use in phi function */
352 /* ls->phi[use_site->b_index][-use_site->iindex-1]*/
354 lt_is_live(ls, lt, use_site->b_index, iindex);
356 phi = ls->phi[use_site->b_index][-iindex-1];
357 _LT_ASSERT(phi != NULL);
359 pred = graph_get_first_predecessor(gd, use_site->b_index,
361 for(i = 1; (pred != -1); i++,pred =
362 graph_get_next(&pred_iter))
363 if (lt->v_index == phi[i]) {
365 /* Add "Life out Basic Blocks to Worklist */
370 else /* lt is live-in at this statement */
371 lt_lifeatstatement(ls, gd, use_site->b_index,
372 iindex, lt, true, W);
373 } /* for (;use_site != NULL; use_site = lt_get_next_site(&iter)) */
375 /* process Worklist */
377 while (!wl_is_empty(W)) {
379 lt_lifeoutatblock(ls, gd, M, b_index, lt, W);
383 #ifdef LT_DEBUG_VERBOSE
388 } /* for(lt_index = 0; lt_index < ls->lifetimecount; lt_index++) */
391 if (clock_gettime(CLOCK_THREAD_CPUTIME_ID,&(time_end)) != 0) {
392 fprintf(stderr,"could not get time: %s\n",strerror(errno));
400 diff = (time_end.tv_nsec - time_start.tv_nsec) / 1000;
401 atime = time_start.tv_sec;
402 while (atime < time_end.tv_sec) {
406 printf("%8li %s.%s.%s\n",diff, m->clazz->name->text, m->name->text,
407 m->descriptor->text);
412 /*******************************************************************************
416 IN: lsradata *ls pointer to worklist created with wl_new
418 int b_index Basic block index of instruction
419 int iindex index of instruction in Basic Block
420 struct lifetime *lt Pointer to lifetime structure
421 bool life_in TRUE lifetime lt is life 'into' that instruction
422 FALSE lifetime lt is life 'out' of that instruction
424 IN/OUT: worklist *W Worklist of Basic Blocks, where lt is life-out
425 *******************************************************************************/
426 void lt_lifeatstatement(lsradata *ls, graphdata *gd, int b_index,
427 int iindex, struct lifetime *lt, bool life_in,
430 int prev_iindex; /* Statement before iindex */
432 graphiterator pred_iter;
437 #ifdef LT_DEBUG_VERBOSE
438 if ((compileverbose) && (iindex >= 0))
439 printf("LO@ST: vi %3i bi %3i ii %3i\n",
440 lt->v_index, b_index, iindex);
443 /* lt->v_index is life-out at statement at (b_index,iindex) */
445 /* Once a interference graph is needed, add here an edge (v,w) */
446 /* to the ig, for each variable w defined at this instruction */
447 /* except v=lt->v_index */
449 if (!lt_v_is_defined_at_s(ls, b_index, iindex, lt)) {
451 /* v is life in at out of statement -> check if the SAVEDVAR */
452 /* flag is needed to be set */
454 if ((iindex >= 0) && (b_index != 0)) {
456 /* real ICMD, no phi-function, no param initialisation */
458 _LT_ASSERT(ls->basicblocks[b_index]->iinstr != NULL);
460 iptr = ls->basicblocks[b_index]->iinstr + iindex;
461 if (icmd_table[iptr->opc].flags & ICMDTABLE_CALLS)
462 lt->savedvar = SAVEDVAR;
465 /* lt stays life-in at statement */
470 /* print LO verbose message only for phi functions, which */
471 /* define this var */
473 #ifdef LT_DEBUG_VERBOSE
474 if ((compileverbose) && (iindex < 0))
475 printf("LO@ST: vi %3i bi %3i ii %3i\n",
476 lt->v_index, b_index, iindex);
477 if ((compileverbose))
478 printf("--> definition\n");
481 lt_is_live(ls, lt, b_index, iindex);
483 /* Stop - lt is defined and not life before this instruction */
491 /* lt->v_index is live-in at statement (b_index,iindex) */
493 #ifdef LT_DEBUG_VERBOSE
494 if ((compileverbose) && (iindex >= 0))
495 printf("LI@ST: vi %3i bi %3i ii %3i\n",
496 lt->v_index, b_index, iindex);
499 lt_is_live(ls, lt, b_index, iindex);
502 if (iindex == -ls->ssavarcount-1) {
504 #ifdef LT_DEBUG_VERBOSE
505 if ((compileverbose))
506 printf("LI@ST: vi %3i bi %3i ii %3i\n",
507 lt->v_index, b_index, iindex);
509 /* iindex is the first statement of b_index */
510 /* Statements -ls->ssavarcounts-1 .. -1 are possible phi functions*/
511 /* lt->v_index is live-in at b_index */
513 pred = graph_get_first_predecessor(gd, b_index, &pred_iter);
515 /* Add "Life out Basic Blocks to Worklist */
517 for(; pred != -1; pred = graph_get_next(&pred_iter))
520 /* Stop here - beginning of Basic Block reached */
525 prev_iindex = iindex - 1;
528 /* look through phi functions */
530 for(; prev_iindex > -ls->ssavarcount-1; prev_iindex--)
531 if (ls->phi[b_index][-prev_iindex-1] != NULL)
534 /* lt is live out at instruction prev_iindex */
536 iindex = prev_iindex;
544 void lt_lifeoutatblock(lsradata *ls, graphdata *gd, int *M, int b_index,
545 struct lifetime *lt, worklist *W) {
547 #if defined(LT_DEBUG_VERBOSE)
548 if (compileverbose) {
549 printf("V %3i LO at BB %3i\n",lt->v_index, b_index);
553 /* lt->v_index is life out of Block b_index */
554 if (!bv_get_bit(M, b_index)) { /* BB b_index not visited till now */
555 bv_set_bit(M, b_index);
557 /* lt->v_index is life out of last Statement of b_index */
561 i = ls->basicblocks[b_index]->icount - 1;
562 for (;((i>0) && (ls->basicblocks[b_index]->iinstr+i == ICMD_NOP));
564 lt_lifeatstatement(ls, gd, b_index, i, lt, false, W);
567 lt_lifeatstatement(ls, gd, b_index, 0, lt, false, W);
571 void lt_move_use_sites(struct lifetime *from, struct lifetime *to) {
575 /* not anymore true for copy propagated lifetimes */
576 _LT_ASSERT(from->use != NULL);
578 if (from->use == NULL)
580 for(s = from->use; s->next != NULL; s = s->next);
587 void lt_add_use_site(struct lifetime *lt, int block, int iindex) {
590 n = DNEW(struct site);
596 /* CFG is analysed from the end to the start -> so first found use site */
597 /* is the last use of the Local Var */
599 if (lt->last_use == NULL)
603 void lt_remove_use_site(struct lifetime *lt, int block, int iindex) {
606 /* check lt->use itself */
608 if ((lt->use->b_index == block) && (lt->use->iindex == iindex)) {
610 lt->use = lt->use->next;
613 /* look through list */
615 for (n = lt->use; (n->next != NULL) && ((n->next->b_index != block) ||
616 (n->next->iindex != iindex)); n = n->next);
618 /* assert, that lt was found */
620 _LT_ASSERT(n->next != NULL);
621 _LT_ASSERT(n->next->b_index == block);
622 _LT_ASSERT(n->next->iindex == iindex);
624 n->next = n->next->next;
628 void lt_add_def_site(struct lifetime *lt, int block, int iindex) {
631 /* SSA <-> only one definition per lifetime! */
633 _LT_ASSERT(lt->def == NULL);
634 n = DNEW(struct site);
641 void lt_usage(jitdata *jd,s4 v_index, int block, int instr,
649 n = ls->lifetime + v_index;
651 if (n->type == -1) { /* new local lifetime */
654 n->type=VAR(v_index)->type;
655 /* TODO: check!!!! */
656 /* All var are SAVEDVARS or this gets reset afterwards???? */
657 n->savedvar = SAVEDVAR;
662 n->bb_first_def = -1;
668 _LT_ASSERT(VAR(v_index)->type == n->type);
670 /* add access at (block, instr) to instruction list */
671 /* remember last USE, so only write, if USE Field is undefined (==-1) */
672 /* count store as use, too -> defined and not used vars would overwrite */
675 if (store == LT_USE) {
677 n->usagecount += ls->nesting[block];
679 lt_add_use_site(n, block, instr);
681 if (store == LT_DEF) {
682 lt_add_def_site(n, block, instr);
686 /***************************************************************************
687 use sites: dead code elemination, LifenessAnalysis
688 def sites: dead code elemination
689 ***************************************************************************/
690 void _lt_scanlifetimes(jitdata *jd, graphdata *gd, basicblock *bptr,
693 /* methodinfo *lm; */
694 builtintable_entry *bte;
697 int iindex/*, b_index*/;
705 #ifdef LT_DEBUG_VERBOSE
707 printf("_lt_scanlifetimes: BB %3i flags %3i\n", b_index, bptr->flags);
710 if (bptr->flags >= BBREACHED) {
712 /* b_index = bptr->nr; */
714 /* get instruction count for BB */
716 iindex = bptr->icount - 1;
718 /* regard not setup new BB with maybe just in and outstack */
723 /* Regard phi_functions (Definition of target, Use of source) */
725 for(i = 0; i < ls->ssavarcount; i++) {
726 if (ls->phi[b_index][i] != NULL) {
727 /* Phi Function for var i at b_index exists */
728 v = ls->phi[b_index][i][0];
729 _LT_ASSERT( v != ls->varcount_with_indices);
732 /* Add definition of target add - phi index -1*/
733 #ifdef LT_DEBUG_VERBOSE
735 printf("_lt_scanlifetimes: phi_def: v: %3i\n i: %3i\n",
738 lt_usage(jd, v, b_index, -i-1, LT_DEF);
740 /* Add Use of sources */
742 for (j = 1; j <= graph_get_num_predecessor(gd, b_index); j++) {
743 if (ls->phi[b_index][i][j] != ls->varcount_with_indices)
744 if (ls->phi[b_index][i][j] != UNUSED)
745 lt_usage(jd, ls->phi[b_index][i][j], b_index,
751 if (bptr->iinstr != NULL) {
752 /* set iptr to last instruction of BB */
753 iptr = bptr->iinstr + iindex;
757 for (;iindex >= 0; iindex--, iptr--) {
761 if (icmd_table[iptr->opc].dataflow >= DF_DST_BASE)
762 v = iptr->dst.varindex;
764 /* check for use (s1, s2, s3 or special (argp) ) */
765 /* and definitions (dst) */
766 switch(icmd_table[iptr->opc].dataflow) {
768 case DF_3_TO_1: /* icmd has s1, s2 and s3 */
769 lt_usage(jd, iptr->sx.s23.s3.varindex, b_index, iindex, LT_USE);
771 /* now "fall through" for handling of s2 and s1 */
774 case DF_2_TO_1: /* icmd has s1 and s2 */
775 lt_usage(jd, iptr->sx.s23.s2.varindex, b_index, iindex, LT_USE);
777 /* now "fall through" for handling of s1 */
782 case DF_COPY: /* icmd has s1 */
783 lt_usage(jd, iptr->s1.varindex, b_index, iindex, LT_USE);
787 INSTRUCTION_GET_METHODDESC(iptr,md);
789 if (md->returntype.type == TYPE_VOID)
794 bte = iptr->sx.s23.s3.bte;
797 if (md->returntype.type == TYPE_VOID)
802 i = iptr->s1.argcount;
808 argp = iptr->sx.s23.s2.args;
810 lt_usage(jd, *argp, b_index, iindex, LT_USE);
816 lt_usage(jd, v, b_index, iindex, LT_DEF);
818 } /* for (;iindex >= 0; iindex--, iptr--) */
819 } /* if (bptr->flags >= BBREACHED) */
820 } /* scan_lifetimes */
824 /*******************************************************************************
825 true, if i dominates j
826 *******************************************************************************/
827 bool dominates(dominatordata *dd, int i, int j) {
828 bool dominates = false;
830 while(!dominates && (dd->idom[j] != -1)) {
831 dominates = (i == dd->idom[j]);
837 /*******************************************************************************
840 Look for loops in the CFG and set the nesting depth of all Basicblocks in
843 The Loop Header BB h is an element of DF[n] for all Basicblocks n of this loop
844 So Look through all x element of DF[n] for a backedge n->x. If this
845 exists, increment nesting for all n with x in DF[n]
846 *******************************************************************************/
847 void lt_get_nesting(lsradata *ls, graphdata *gd, dominatordata *dd) {
849 bitvector loop_header;
850 worklist *loop, *loop1;
860 /* init nesting to 1 and get loop_headers */
861 ls->nesting = DMNEW(long, ls->basicblockcount);
862 loop_header = bv_new(ls->basicblockcount);
863 loop = wl_new(ls->basicblockcount);
865 for(i = 0; i < ls->basicblockcount; i++) {
868 for(succ = graph_get_first_successor(gd, i, &iter); succ != -1;
869 succ = graph_get_next(&iter)) {
870 for (j = 0; j < dd->num_DF[i]; j++) {
871 if (succ == dd->DF[i][j]) {
872 /* There is an edge from i to DF[i][j] */
874 /* look if DF[i][j] dominates i -> backedge */
875 if (dominates(dd, dd->DF[i][j], i)) {
876 /* this edge is a backedge */
877 /* -> DF[i][j] is a loop header */
878 _LT_CHECK_BOUNDS(dd->DF[i][j], 0, ls->basicblockcount);
879 if (!bv_get_bit(loop_header, dd->DF[i][j])) {
880 /* new loop_header found */
882 bv_set_bit(loop_header, dd->DF[i][j]);
883 ls->nesting[dd->DF[i][j]] = 10;
885 wl_add(loop, dd->DF[i][j]);
892 loop_parent = DMNEW(int , ls->basicblockcount);
893 loop1 = wl_new(ls->basicblockcount);
895 /* look for direct parents of nested loopheaders */
896 /* (DF[loop_header[i]] has the element loop_header[j] with i != j */
897 /* TODO: BULLSHIT:unfortunately not such an easy condition ;( */
898 while(!wl_is_empty(loop)) {
902 loop_parent[lh] = -1;
904 for (j = 0; j < dd->num_DF[lh]; j++) {
905 _LT_CHECK_BOUNDS(dd->DF[lh][j], 0, ls->basicblockcount);
906 if (lh != dd->DF[lh][j]) {
907 if (bv_get_bit(loop_header, dd->DF[lh][j])) {
908 #ifdef LT_DEBUG_VERBOSE
910 if (loop_parent[lh] != -1)
911 printf("Warning: LoopHeader has more than one parent\n");
913 /* _LT_ASSERT( loop_parent[lh] == -1); */
914 loop_parent[lh] = dd->DF[lh][j];
920 /* create nesting for loopheaders */
921 while(!wl_is_empty(loop1)) {
923 for (lh_p = lh; lh_p != -1; lh_p = loop_parent[lh_p]) {
924 ls->nesting[lh] *= 10;
929 /* copy loopheader nesting to loop body */
930 for(i = 0; i < ls->basicblockcount; i++) {
931 if (!bv_get_bit(loop_header, i)) {
932 /* Do not touch the nesting of a loopheader itself */
933 for(j = 0; j < dd->num_DF[i]; j++) {
934 _LT_CHECK_BOUNDS(dd->DF[i][j], 0, ls->basicblockcount);
935 if (bv_get_bit(loop_header, dd->DF[i][j])) {
936 /* DF[i][j] is a loop header -> copy nesting for i */
937 #ifdef LT_DEBUG_VERBOSE
939 if (ls->nesting[i] != 1)
940 printf("Warning: More than one loopheader for one BB\n");
941 /* _LT_ASSERT(ls->nesting[i] == 1); */
943 ls->nesting[i] = ls->nesting[dd->DF[i][j]];
949 #ifdef LT_DEBUG_VERBOSE
950 if (compileverbose) {
951 printf("Num Loops: %3i\n",num_loops);
952 for(i = 0; i < ls->basicblockcount; i++)
953 printf("(BB%3i->N%3li) ",i, ls->nesting[i]);
962 * These are local overrides for various environment variables in Emacs.
963 * Please do not remove this and leave it at the end of the file, where
964 * Emacs will automagically detect them.
965 * ---------------------------------------------------------------------
968 * indent-tabs-mode: t