comparison gcc/cfgloop.c @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children f6334be47118
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
336 { 336 {
337 struct loop *loop = GGC_CNEW (struct loop); 337 struct loop *loop = GGC_CNEW (struct loop);
338 338
339 loop->exits = GGC_CNEW (struct loop_exit); 339 loop->exits = GGC_CNEW (struct loop_exit);
340 loop->exits->next = loop->exits->prev = loop->exits; 340 loop->exits->next = loop->exits->prev = loop->exits;
341 loop->can_be_parallel = false;
342 loop->single_iv = NULL_TREE;
341 343
342 return loop; 344 return loop;
343 } 345 }
344 346
345 /* Initializes loops structure LOOPS, reserving place for NUM_LOOPS loops 347 /* Initializes loops structure LOOPS, reserving place for NUM_LOOPS loops
519 521
520 We do not use guessed profile here, only the measured one. The guessed 522 We do not use guessed profile here, only the measured one. The guessed
521 profile is usually too flat and unreliable for this (and it is mostly based 523 profile is usually too flat and unreliable for this (and it is mostly based
522 on the loop structure of the program, so it does not make much sense to 524 on the loop structure of the program, so it does not make much sense to
523 derive the loop structure from it). */ 525 derive the loop structure from it). */
524 526
525 static edge 527 static edge
526 find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches) 528 find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches)
527 { 529 {
528 unsigned i; 530 unsigned i;
529 edge e, me = NULL; 531 edge e, me = NULL;
652 form_subloop (struct loop *loop, edge latch) 654 form_subloop (struct loop *loop, edge latch)
653 { 655 {
654 edge_iterator ei; 656 edge_iterator ei;
655 edge e, new_entry; 657 edge e, new_entry;
656 struct loop *new_loop; 658 struct loop *new_loop;
657 659
658 mfb_reis_set = pointer_set_create (); 660 mfb_reis_set = pointer_set_create ();
659 FOR_EACH_EDGE (e, ei, loop->header->preds) 661 FOR_EACH_EDGE (e, ei, loop->header->preds)
660 { 662 {
661 if (e != latch) 663 if (e != latch)
662 pointer_set_insert (mfb_reis_set, e); 664 pointer_set_insert (mfb_reis_set, e);
888 } 890 }
889 891
890 /* Gets body of a LOOP sorted via provided BB_COMPARATOR. */ 892 /* Gets body of a LOOP sorted via provided BB_COMPARATOR. */
891 893
892 basic_block * 894 basic_block *
893 get_loop_body_in_custom_order (const struct loop *loop, 895 get_loop_body_in_custom_order (const struct loop *loop,
894 int (*bb_comparator) (const void *, const void *)) 896 int (*bb_comparator) (const void *, const void *))
895 { 897 {
896 basic_block *bbs = get_loop_body (loop); 898 basic_block *bbs = get_loop_body (loop);
897 899
898 qsort (bbs, loop->num_nodes, sizeof (basic_block), bb_comparator); 900 qsort (bbs, loop->num_nodes, sizeof (basic_block), bb_comparator);
979 struct loop_exit *exit = (struct loop_exit *) ex, *next; 981 struct loop_exit *exit = (struct loop_exit *) ex, *next;
980 982
981 for (; exit; exit = next) 983 for (; exit; exit = next)
982 { 984 {
983 next = exit->next_e; 985 next = exit->next_e;
984 986
985 exit->next->prev = exit->prev; 987 exit->next->prev = exit->prev;
986 exit->prev->next = exit->next; 988 exit->prev->next = exit->next;
987 989
988 ggc_free (exit); 990 ggc_free (exit);
989 } 991 }
1033 exit->prev->next = exit; 1035 exit->prev->next = exit;
1034 1036
1035 exit->next_e = exits; 1037 exit->next_e = exits;
1036 exits = exit; 1038 exits = exit;
1037 } 1039 }
1038 } 1040 }
1039 1041
1040 if (!exits && new_edge) 1042 if (!exits && new_edge)
1041 return; 1043 return;
1042 1044
1043 slot = htab_find_slot_with_hash (current_loops->exits, e, 1045 slot = htab_find_slot_with_hash (current_loops->exits, e,
1519 1521
1520 n_exits++; 1522 n_exits++;
1521 exit = get_exit_descriptions (e); 1523 exit = get_exit_descriptions (e);
1522 if (!exit) 1524 if (!exit)
1523 { 1525 {
1524 error ("Exit %d->%d not recorded", 1526 error ("Exit %d->%d not recorded",
1525 e->src->index, e->dest->index); 1527 e->src->index, e->dest->index);
1526 err = 1; 1528 err = 1;
1527 } 1529 }
1528 eloops = 0; 1530 eloops = 0;
1529 for (; exit; exit = exit->next_e) 1531 for (; exit; exit = exit->next_e)
1537 sizes[loop->num]++; 1539 sizes[loop->num]++;
1538 } 1540 }
1539 1541
1540 if (eloops != 0) 1542 if (eloops != 0)
1541 { 1543 {
1542 error ("Wrong list of exited loops for edge %d->%d", 1544 error ("Wrong list of exited loops for edge %d->%d",
1543 e->src->index, e->dest->index); 1545 e->src->index, e->dest->index);
1544 err = 1; 1546 err = 1;
1545 } 1547 }
1546 } 1548 }
1547 } 1549 }