Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.9
 
1.10
 
MAIN:pj:20050206163156
 
optim2.c
_>414414                         bb->samedom = 0;
 415415                         bb->bucket = NULL;
 416416                         bb->df = NULL;
<> 417+                        bb->dfchildren = NULL;
417418                         CIRCLEQ_INSERT_TAIL(&bblocks, bb, bbelem);
 418419                         leader = 0;
 419420                         count++;
     
 !
449450                         bb->samedom = 0;
 450451                         bb->bucket = NULL;
 451452                         bb->df = NULL;
<> 453+                        bb->dfchildren = NULL;
452454                         CIRCLEQ_INSERT_TAIL(&bblocks, bb, bbelem);
 453455                         count++;
 454456                         continue;
     
 !
517519         }
 518520 #ifdef PCC_DEBUG
 519521         printf("Basic blocks in func: %d\n", count);
<>520 -        printf("Label range in func: %d\n %d", high - low + 1, low);
  522+        printf("Label range in func: %d\n", high - low + 1);
521523 #endif
 522524 
 523525         labinfo->low = low;
     
 !
628630         struct cfgnode *cnode;
 629631         struct basicblock *bb, *y, *v;
 630632         struct basicblock *s, *sprime, *p;
<>631 -        int i;
  633+        int h, i;
632634 
 633635         CIRCLEQ_FOREACH(bb, &bblocks, bbelem) {
 634636                 bb->bucket = tmpalloc((bbinfo->size + 7)/8);
 635637                 memset(bb->bucket, 0, (bbinfo->size + 7)/8);
<> 638+
  639+                bb->df = tmpalloc((bbinfo->size + 7)/8);
  640+                memset(bb->df, 0, (bbinfo->size + 7)/8);
  641+
  642+
  643+                bb->dfchildren = tmpalloc((bbinfo->size + 7)/8);
  644+                memset(bb->dfchildren, 0, (bbinfo->size + 7)/8);
636645         }
 637646 
 638647         dfsnum = 0;
 639648         cfg_dfs(CIRCLEQ_FIRST(&bblocks), 0, bbinfo);
 640649 
<>641 -        CIRCLEQ_FOREACH_REVERSE(bb, &bblocks, bbelem) {
 642 -                if (bb->first->type == IP_PROLOG)
 643 -                        continue;
  650+        for(h = bbinfo->size - 1; h > 1; h--) {
  651+                bb = bbinfo->arr[h];
644652                 p = s = bbinfo->arr[bb->dfparent];
 645653                 SIMPLEQ_FOREACH(cnode, &bb->parents, cfgelem) {
 646654                         if (cnode->bblock->dfnum <= bb->dfnum)
 647655                                 sprime = cnode->bblock;
<>648 -                        else
 649 -                                sprime = ancestorwithlowestsemi(cnode->bblock,
 650 -                                                                bbinfo);
  656+                        else
  657+                                sprime = bbinfo->arr[ancestorwithlowestsemi
  658+                                              (cnode->bblock, bbinfo)->semi];
651659                         if (sprime->dfnum < s->dfnum)
 652660                                 s = sprime;
 653661                 }
 654662                 bb->semi = s->dfnum;
<>655 -                s->bucket[bb->dfnum/8] |= (1 << (bb->dfnum & 3));
  663+                BITSET(s->bucket, bb->dfnum);
656664                 link(p, bb);
 657665                 for (i = 1; i < bbinfo->size; i++) {
<>658 -                        if(p->bucket[i/8] & (1 << (i & 3))) {
  666+                        if(TESTBIT(p->bucket, i)) {
659667                                 v = bbinfo->arr[i];
<>660 -                                y = ancestorwithlowestsemi(bbinfo->arr[i], bbinfo);
 661 -                                if (y->semi == v->semi)
  668+                                y = ancestorwithlowestsemi(v, bbinfo);
  669+                                if (y->semi == v->semi)
662670                                         v->idom = p->dfnum;
 663671                                 else
 664672                                         v->samedom = y->dfnum;
 665673                         }
 666674                 }
 667675                 memset(p->bucket, 0, (bbinfo->size + 7)/8);
 668676         }
<> 677+#if 0
  678+        printf("Num\tSemi\tAncest\tidom\n");
669679         CIRCLEQ_FOREACH(bb, &bblocks, bbelem) {
<>670 -                if (bb->first->type == IP_PROLOG)
 671 -                        continue;
 672 -                if (bb->samedom != 0)
  680+                printf("%d\t%d\t%d\t%d\n", bb->dfnum, bb->semi, bb->ancestor, bb->idom);
  681+        }
  682+#endif
  683+        for(h = 2; h < bbinfo->size; h++) {
  684+                bb = bbinfo->arr[h];
  685+                if (bb->samedom != 0) {
673686                         bb->idom = bbinfo->arr[bb->samedom]->idom;
<> 687+                }
674688         }
<> 689+        CIRCLEQ_FOREACH(bb, &bblocks, bbelem) {
  690+                if (bb->idom != 0 && bb->idom != bb->dfnum) {
  691+#if 0
  692+
  693+                        printf("Setting child %d of %d\n", bb->dfnum, bbinfo->arr[bb->idom]->dfnum);
  694+#endif
  695+
  696+                        BITSET(bbinfo->arr[bb->idom]->dfchildren, bb->dfnum);
  697+                }
  698+        }
675699 }
 676700 
 677701 
     
 !
683707 
 684708         while (v->ancestor != 0) {
 685709                 if (bbinfo->arr[v->semi]->dfnum <
<>686 -                    bbinfo->arr[u->semi]->dfnum)
  710+                    bbinfo->arr[u->semi]->dfnum)
687711                         u = v;
 688712                 v = bbinfo->arr[v->ancestor];
 689713         }
     
 !
700724 computeDF(struct basicblock *bblock, struct bblockinfo *bbinfo)
 701725 {
 702726         struct cfgnode *cnode;
<>703 -        int i;
  727+        int h, i;
704728         
<>705 -        if (bblock->df)
 706 -                comperr("Har redan DF, hm");
 707 -        
 708 -        if (!bblock->df) {
 709 -                bblock->df = tmpalloc((bbinfo->size + 7)/8);
 710 -                memset(bblock->df, 0, (bbinfo->size + 7)/8);
 711 -        }
 712 -
 713 -
714729         SIMPLEQ_FOREACH(cnode, &bblock->children, cfgelem) {
 715730                 if (cnode->bblock->idom != bblock->dfnum)
 716731                         BITSET(bblock->df, cnode->bblock->dfnum);
 717732         }
<>718 -        /* XXX succ != children? */
 719 -        SIMPLEQ_FOREACH(cnode, &bblock->children, cfgelem) {
 720 -                computeDF(cnode->bblock, bbinfo);
  733+        for (h = 1; h < bbinfo->size; h++) {
  734+                if (!TESTBIT(bblock->dfchildren, h))
  735+                        continue;
  736+                computeDF(bbinfo->arr[h], bbinfo);
721737                 for (i = 1; i < bbinfo->size; i++) {
<>722 -                        if (TESTBIT(cnode->bblock->df, i) &&
 723 -                            (cnode->bblock == bblock ||
 724 -                             (bblock->idom != cnode->bblock->dfnum)))
  738+                        if (TESTBIT(bbinfo->arr[h]->df, i) &&
  739+                            (bbinfo->arr[h] == bblock ||
  740+                             (bblock->idom != bbinfo->arr[h]->dfnum)))
<_725741                             BITSET(bblock->df, i);
 726742                 }
 727743         }
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-19 07:51 +0200