Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.72
 
1.73
 
MAIN:ragge:20100512150757
 
optim2.c
_>164164 /*              remunreach(p2e); */
 165165                 
 166166                 /*
<>167 -                 Recalculate basic blocks and cfg that was destroyed
 168 -                 by removephi
  167+                 * Recalculate basic blocks and cfg that was destroyed
  168+                 * by removephi
169169                  */
 170170                 /* first, clean up all what deljumps should have done, and more */
 171171 
<>172 -                /*TODO: add the basic blocks done by the ssa code by hand.
 173 -                 * The trace scheduler should not change the order in which blocks
 174 -                 * are executed or what data is calculated. Thus, the BBlock order
 175 -                 * should remain correct.
  172+                /* TODO: add the basic blocks done by the ssa code by hand.
  173+                 * The trace scheduler should not change the order in
  174+                 * which blocks are executed or what data is calculated.
  175+                 * Thus, the BBlock order should remain correct.
176176                  */
 177177 
 178178 #ifdef ENABLE_NEW
     
 !
719719                 printf("Basic blocks in func: %d, low %d, high %d\n",
 720720                     count, low, high);
 721721                 DLIST_FOREACH(bb, &p2e->bblocks, bbelem) {
<>722 -                        printf("bb %p: first %p last %p\n", bb,
  722+                        printf("bb(%d) %p: first %p last %p\n", bb->bbnum, bb,
723723                             bb->first, bb->last);
 724724                 }
 725725         }
     
 !
13181318                                         
 13191319                                         if (bb==labinfo->arr[label - p2e->ipp->ip_lblnum])
 13201320                                                 complex = pred_cond ;
<>1321 -                                        else
 1322 -                                                complex = pred_falltrough ;
  1321+                                        else
  1322+                                                complex = pred_falltrough ;
13231323 
<>1324 -                                        } else if (DLIST_PREV(bb, bbelem) == bbparent) {
 1325 -                                                complex = pred_falltrough ;
 1326 -                                        } else {
 1327 -                                            /* PANIC */
 1328 -                                            comperr("Assumption blown in rem-phi") ;
 1329 -                                        }
  1324+                                } else if (DLIST_PREV(bb, bbelem) == bbparent) {
  1325+                                        complex = pred_falltrough ;
  1326+                                } else {
  1327+                                            /* PANIC */
  1328+                                        comperr("Assumption blown in rem-phi") ;
  1329+                                }
13301330       
<>1331 -                                        BDEBUG((" Complex: %d\n",complex)) ;
  1331+                                BDEBUG((" Complex: %d ",complex)) ;
13321332 
<>1333 -                                        switch (complex) {
 1334 -                                          case pred_goto:
 1335 -                                                /* gotos can only go to this place. No bounce tab needed */
 1336 -                                                SLIST_FOREACH(phi,&bb->phi,phielem) {
 1337 -                                                        if (phi->intmpregno[i]>0) {
 1338 -                                                                n_type=phi->n_type;
 1339 -                                                                ip = ipnode(mkbinode(ASSIGN,
 1340 -                                                                     mktemp(phi->newtmpregno, n_type),
 1341 -                                                                     mktemp(phi->intmpregno[i],n_type),
 1342 -                                                                     n_type));
 1343 -                                        
 1344 -                                                                DLIST_INSERT_BEFORE((bbparent->last), ip, qelem);
 1345 -                                                        }
 1346 -                                                }
 1347 -                                            break ;
 1348 -                                          case pred_cond:
 1349 -                                                /* Here, we need a jump pad */
 1350 -                                                newlabel=getlab2();
  1333+                                switch (complex) {
  1334+                                  case pred_goto:
  1335+                                        /* gotos can only go to this place. No bounce tab needed */
  1336+                                        SLIST_FOREACH(phi,&bb->phi,phielem) {
  1337+                                                if (phi->intmpregno[i]>0) {
  1338+                                                        n_type=phi->n_type;
  1339+                                                        ip = ipnode(mkbinode(ASSIGN,
  1340+                                                             mktemp(phi->newtmpregno, n_type),
  1341+                                                             mktemp(phi->intmpregno[i],n_type),
  1342+                                                             n_type));
  1343+                                                        BDEBUG(("(%p, %d -> %d) ", ip, phi->intmpregno[i], phi->newtmpregno));
13511344                                 
<>1352 -                                                ip = tmpalloc(sizeof(struct interpass));
 1353 -                                                ip->type = IP_DEFLAB;
 1354 -                                                /* Line number?? ip->lineno; */
 1355 -                                                ip->ip_lbl = newlabel;
 1356 -                                                DLIST_INSERT_BEFORE((bb->first), ip, qelem);
  1345+                                                        DLIST_INSERT_BEFORE((bbparent->last), ip, qelem);
  1346+                                                }
  1347+                                        }
  1348+                                        break ;
  1349+                                  case pred_cond:
  1350+                                        /* Here, we need a jump pad */
  1351+                                        newlabel=getlab2();
  1352+                        
  1353+                                        ip = tmpalloc(sizeof(struct interpass));
  1354+                                        ip->type = IP_DEFLAB;
  1355+                                        /* Line number?? ip->lineno; */
  1356+                                        ip->ip_lbl = newlabel;
  1357+                                        DLIST_INSERT_BEFORE((bb->first), ip, qelem);
13571358 
<> 1359+                                        SLIST_FOREACH(phi,&bb->phi,phielem) {
  1360+                                                if (phi->intmpregno[i]>0) {
  1361+                                                        n_type=phi->n_type;
  1362+                                                        ip = ipnode(mkbinode(ASSIGN,
  1363+                                                             mktemp(phi->newtmpregno, n_type),
  1364+                                                             mktemp(phi->intmpregno[i],n_type),
  1365+                                                             n_type));
13581366 
<>1359 -                                                SLIST_FOREACH(phi,&bb->phi,phielem) {
 1360 -                                                        if (phi->intmpregno[i]>0) {
 1361 -                                                                n_type=phi->n_type;
 1362 -                                                                ip = ipnode(mkbinode(ASSIGN,
 1363 -                                                                     mktemp(phi->newtmpregno, n_type),
 1364 -                                                                     mktemp(phi->intmpregno[i],n_type),
 1365 -                                                                     n_type));
 1366 -                                        
 1367 -                                                                DLIST_INSERT_BEFORE((bb->first), ip, qelem);
 1368 -                                                        }
 1369 -                                                }
 1370 -                                                /* add a jump to us */
 1371 -                                                ip = ipnode(mkunode(GOTO, mklnode(ICON, label, 0, INT), 0, INT));
 1372 -                                                DLIST_INSERT_BEFORE((bb->first), ip, qelem);
 1373 -                                                pip->ip_node->n_right->n_lval=newlabel;
 1374 -                                            break ;
 1375 -                                          case pred_falltrough:
 1376 -                                                if (bb->first->type == IP_DEFLAB) {
 1377 -                                                    label = bb->first->ip_lbl;
 1378 -                                                    BDEBUG(("falltrough label %d\n", label));
 1379 -                                                } else {
 1380 -                                                    comperr("BBlock has no label?") ;
 1381 -                                                }
  1367+                                                        BDEBUG(("(%p, %d -> %d) ", ip, phi->intmpregno[i], phi->newtmpregno));
  1368+                                                        DLIST_INSERT_BEFORE((bb->first), ip, qelem);
  1369+                                                }
  1370+                                        }
  1371+                                        /* add a jump to us */
  1372+                                        ip = ipnode(mkunode(GOTO, mklnode(ICON, label, 0, INT), 0, INT));
  1373+                                        DLIST_INSERT_BEFORE((bb->first), ip, qelem);
  1374+                                        pip->ip_node->n_right->n_lval=newlabel;
  1375+                                        break ;
  1376+                                  case pred_falltrough:
  1377+                                        if (bb->first->type == IP_DEFLAB) {
  1378+                                                label = bb->first->ip_lbl;
  1379+                                                BDEBUG(("falltrough label %d\n", label));
  1380+                                        } else {
  1381+                                                comperr("BBlock has no label?") ;
  1382+                                        }
13821383 
<>1383 -                                                /*
 1384 -                                                 * add a jump to us. We _will_ be, or already have, added code in between.
 1385 -                                                 * The code is created in the wrong order and switched at the insert, thus
 1386 -                                                 * comming out correctly
 1387 -                                                 */
  1384+                                        /*
  1385+                                         * add a jump to us. We _will_ be, or already have, added code in between.
  1386+                                         * The code is created in the wrong order and switched at the insert, thus
  1387+                                         * comming out correctly
  1388+                                         */
13881389 
<>1389 -                                                ip = ipnode(mkunode(GOTO, mklnode(ICON, label, 0, INT), 0, INT));
 1390 -                                                DLIST_INSERT_AFTER((bbparent->last), ip, qelem);
  1390+                                        ip = ipnode(mkunode(GOTO, mklnode(ICON, label, 0, INT), 0, INT));
  1391+                                        DLIST_INSERT_AFTER((bbparent->last), ip, qelem);
13911392 
<>1392 -                                                /* Add the code to the end, add a jump to us. */
 1393 -                                                SLIST_FOREACH(phi,&bb->phi,phielem) {
 1394 -                                                        if (phi->intmpregno[i]>0) {
 1395 -                                                                n_type=phi->n_type;
 1396 -                                                                ip = ipnode(mkbinode(ASSIGN,
 1397 -                                                                        mktemp(phi->newtmpregno, n_type),
 1398 -                                                                        mktemp(phi->intmpregno[i],n_type),
 1399 -                                                                        n_type));
 1400 -        
 1401 -                                                                DLIST_INSERT_AFTER((bbparent->last), ip, qelem);
 1402 -                                                        }
 1403 -                                                }
 1404 -                                            break ;
 1405 -                                          default:
 1406 -                                            comperr("assumption blown, complex is %d\n", complex) ;
 1407 -                                }
  1393+                                        /* Add the code to the end, add a jump to us. */
  1394+                                        SLIST_FOREACH(phi,&bb->phi,phielem) {
  1395+                                                if (phi->intmpregno[i]>0) {
  1396+                                                        n_type=phi->n_type;
  1397+                                                        ip = ipnode(mkbinode(ASSIGN,
  1398+                                                                mktemp(phi->newtmpregno, n_type),
  1399+                                                                mktemp(phi->intmpregno[i],n_type),
  1400+                                                                n_type));
14081401 
<> 1402+                                                        BDEBUG(("(%p, %d -> %d) ", ip, phi->intmpregno[i], phi->newtmpregno));
  1403+                                                        DLIST_INSERT_AFTER((bbparent->last), ip, qelem);
  1404+                                                }
  1405+                                        }
  1406+                                        break ;
  1407+                                default:
  1408+                                        comperr("assumption blown, complex is %d\n", complex) ;
  1409+                                }
  1410+                                BDEBUG(("\n"));
14091411                                 i++;
 14101412                         }
 14111413                         break;
     
 !
16761678 {
 16771679         struct interpass *ipole = &p2e->ipole;
 16781680         struct interpass *ip ;
<>1679 -        if (0 != type) {
 1680 -                DLIST_FOREACH(ip, ipole, qelem) {
 1681 -                        if (ip->type == IP_NODE && ip->ip_node->n_op == type)
 1682 -                                walkf(ip->ip_node, f, arg) ;
 1683 -                }
 1684 -        } else {
 1685 -                DLIST_FOREACH(ip, ipole, qelem) {
  1681+        if (0 != type) {
  1682+                DLIST_FOREACH(ip, ipole, qelem) {
  1683+                        if (ip->type == IP_NODE && ip->ip_node->n_op == type)
  1684+                                walkf(ip->ip_node, f, arg) ;
  1685+                }
  1686+        } else {
  1687+                DLIST_FOREACH(ip, ipole, qelem) {
16861688                         if (ip->type == IP_NODE)
<>1687 -                                walkf(ip->ip_node, f, arg) ;
 1688 -                }
 1689 -        }
  1689+                                walkf(ip->ip_node, f, arg) ;
  1690+                }
  1691+        }
16901692 }
 16911693 #if 0
 16921694 static int is_goto_label(struct interpass*g, struct interpass* l)
     
 !
17891791                                                                 block2=cnode->bblock ;
 17901792 #if 1
 17911793                                                                 if (i+1 < count && map[i+1].block == block2)
<>1792 -                                                                        break/* pick that one */
  1794+                                                                        break ; /* pick that one */
17931795 #else
 17941796                                                                 if (block2) break ;
 17951797 #endif
     
 !
18651867         struct interpass *ip ;
 18661868 
 18671869         DLIST_FOREACH(ip, ipole, qelem) {
<>1868 -                if (ip->type == IP_NODE && ip->ip_node->n_op == CBRANCH) {
  1870+                if (ip->type == IP_NODE && ip->ip_node->n_op == CBRANCH) {
18691871                         struct interpass *n = DLIST_NEXT(ip, qelem);
 18701872                         if (n && n->type != IP_DEFLAB) {
 18711873                                 struct interpass* lab;
     
 !
18871889 #ifdef ENABLE_NEW
 18881890 struct node_map {
 18891891         NODE* node ;            /* the node */
<>1890 -        unsigned int node_num/* node is equal to that one */
  1892+        unsigned int node_num ; /* node is equal to that one */
<_18911893         unsigned int var_num ;  /* node computes this variable */
 18921894 } ;
 18931895 
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-11-01 12:54 +0100