Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.31
 
1.32
 
MAIN:ragge:20050721150029
 
optim2.c
_>109109         if (xssaflag) {
 110110                 DLIST_INIT(&bblocks, bbelem);
 111111                 bblocks_build(&labinfo, &bbinfo);
<> 112+                BDEBUG(("Calling cfg_build\n"));
112113                 cfg_build(&labinfo);
<> 114+                BDEBUG(("Calling dominators\n"));
113115                 dominators(&bbinfo);
<> 116+                BDEBUG(("Calling computeDF\n"));
114117                 computeDF(DLIST_NEXT(&bblocks, bbelem), &bbinfo);
<> 118+                BDEBUG(("Calling remunreach\n"));
115119                 remunreach();
 116120 #if 0
 117121                 dfg = dfg_build(cfg);
     
 !
345349 {
 346350         struct interpass *ip;
 347351         struct basicblock *bb = NULL;
<>348 -//      int leader = 1;
349352         int low, high;
 350353         int count = 0;
 351354         int i;
     
 !
360363          * Any statement that immediately follows a jump is a leader.
 361364          */
 362365         DLIST_FOREACH(ip, &ipole, qelem) {
<> 366+                /* ignore stackoff in beginning or end of bblocks */
  367+                if (ip->type == IP_STKOFF && bb == NULL)
  368+                        continue;
  369+
363370                 if (bb == NULL || (ip->type == IP_EPILOG) ||
 364371                     (ip->type == IP_DEFLAB) || (ip->type == IP_DEFNAM)) {
 365372                         bb = tmpalloc(sizeof(struct basicblock));
     
 !
387394                 if (ip->type == IP_PROLOG)
 388395                         bb = NULL;
 389396         }
<>390 -#if 0
 391 -        DLIST_FOREACH(ip, &ipole, qelem) {
 392 -                /* Garbage, skip it */
 393 -                if (leader) {
 394 -                        bb = tmpalloc(sizeof(struct basicblock));
 395 -                        bb->first = bb->last = ip;
 396 -                        SLIST_INIT(&bb->children);
 397 -                        SLIST_INIT(&bb->parents);
 398 -                        bb->dfnum = 0;
 399 -                        bb->dfparent = 0;
 400 -                        bb->semi = 0;
 401 -                        bb->ancestor = 0;
 402 -                        bb->idom = 0;
 403 -                        bb->samedom = 0;
 404 -                        bb->bucket = NULL;
 405 -                        bb->df = NULL;
 406 -                        bb->dfchildren = NULL;
 407 -                        bb->Aorig = NULL;
 408 -                        bb->Aphi = NULL;
 409 -                        DLIST_INSERT_BEFORE(&bblocks, bb, bbelem);
 410 -                        leader = 0;
 411 -                        count++;
 412 -                }
 413 -                
 414 -                /* Prologue and epilogue in their own bblock */
 415 -                if ((ip->type == IP_PROLOG) || (ip->type == IP_EPILOG)) {
 416 -                        bb->last = ip;
 417 -                        leader = 1;
 418 -                        continue;
 419 -                }
 420 -                
 421 -                /* Make sure each label is in a unique bblock */
 422 -                if (((ip->type == IP_DEFLAB) || (ip->type == IP_DEFNAM)) &&
 423 -                    bb->first != ip) {
 424 -                        bb = tmpalloc(sizeof(struct basicblock));
 425 -                        bb->first = bb->last = ip;
 426 -                        SLIST_INIT(&bb->children);
 427 -                        SLIST_INIT(&bb->parents);
 428 -                        bb->dfnum = 0;
 429 -                        bb->dfparent = 0;
 430 -                        bb->semi = 0;
 431 -                        bb->ancestor = 0;
 432 -                        bb->idom = 0;
 433 -                        bb->samedom = 0;
 434 -                        bb->bucket = NULL;
 435 -                        bb->df = NULL;
 436 -                        bb->dfchildren = NULL;
 437 -                        bb->Aorig = NULL;
 438 -                        bb->Aphi = NULL;
 439 -                        DLIST_INSERT_BEFORE(&bblocks, bb, bbelem);
 440 -                        count++;
 441 -                        continue;
 442 -                }
443397 
<>444 -                if (ip->type == IP_NODE) {
 445 -                        switch(ip->ip_node->n_op) {
 446 -                        case CBRANCH:
 447 -                        case GOTO:
 448 -                        case RETURN:
 449 -                                /* Jumps, last in bblock. */
 450 -                                leader = 1;
 451 -                                break;
 452 -
 453 -                        case NAME:
 454 -                        case ICON:
 455 -                        case FCON:
 456 -                        case REG:
 457 -                        case OREG:
 458 -                        case MOVE:
 459 -                        case PLUS:
 460 -                        case MINUS:
 461 -                        case DIV:
 462 -                        case MOD:
 463 -                        case MUL:
 464 -                        case AND:
 465 -                        case OR:
 466 -                        case ER:
 467 -                        case LS:
 468 -                        case COMPL:
 469 -                        case INCR:
 470 -                        case DECR:
 471 -                        case UMUL:
 472 -                        case UMINUS:
 473 -                        case EQ:
 474 -                        case NE:
 475 -                        case LE:
 476 -                        case GE:
 477 -                        case GT:
 478 -                        case ULE:
 479 -                        case ULT:
 480 -                        case UGE:
 481 -                        case UGT:
 482 -                        case ASSIGN:
 483 -                        case FORCE:
 484 -                        case FUNARG:
 485 -                        case CALL:
 486 -                        case UCALL:
 487 -                        case FORTCALL:
 488 -                        case UFORTCALL:
 489 -                        case STCALL:
 490 -                        case USTCALL:
 491 -                                /* Not jumps, continue with bblock. */
 492 -                                break;
 493 -
 494 -                        default:
 495 -                                comperr("optim2:bblocks_build() %d",ip->ip_node->n_op );
 496 -                                break;
 497 -                        }
 498 -                }
 499 -
 500 -                bb->last = ip;
 501 -        }
 502 -#endif
 503 -
504398         if (b2debug) {
<>505 -                printf("Basic blocks in func: %d\n", count);
  399+                printf("Basic blocks in func: %d, low %d, high %d\n",
  400+                    count, low, high);
506401                 DLIST_FOREACH(bb, &bblocks, bbelem) {
 507402                         printf("bb %p: first %p last %p\n", bb,
 508403                             bb->first, bb->last);
     
 !
522417                 bbinfo->arr[i] = NULL;
 523418         }
 524419 
<> 420+        /* Build the label table */
525421         DLIST_FOREACH(bb, &bblocks, bbelem) {
<>526 -                /* Build the label table */
 527 -                if (bb->first->type == IP_DEFLAB) {
  422+                if (bb->first->type == IP_DEFLAB)
528423                         labinfo->arr[bb->first->ip_lbl - low] = bb;
<>529 -                }
 530 -                if (bb->first->type == IP_EPILOG) {
 531 -                        labinfo->arr[bb->first->ip_lbl - low] = bb;
 532 -                }
533424         }
<> 425+
  426+        if (b2debug) {
  427+                printf("Label table:\n");
  428+                for (i = 0; i < labinfo->size; i++)
  429+                        if (labinfo->arr[i])
  430+                                printf("Label %d bblock %p\n", i+low,
  431+                                    labinfo->arr[i]);
  432+        }
534433 }
 535434 
 536435 /*
     
 !
547446         
 548447         DLIST_FOREACH(bb, &bblocks, bbelem) {
 549448 
<>550 -printf("bb: %p\n", bb);
<_551449                 if (bb->first->type == IP_EPILOG) {
 552450                         break;
 553451                 }
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-02 06:21 +0200