Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-ssa-threadupdate.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 | b7f97abdc517 |
comparison
equal
deleted
inserted
replaced
52:c156f1bd5cd9 | 55:77e2b8dfacca |
---|---|
323 to them. The argument should have the same value as the argument | 323 to them. The argument should have the same value as the argument |
324 associated with the outgoing edge stored in RD. */ | 324 associated with the outgoing edge stored in RD. */ |
325 for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi)) | 325 for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi)) |
326 { | 326 { |
327 gimple phi = gsi_stmt (gsi); | 327 gimple phi = gsi_stmt (gsi); |
328 | 328 source_location locus; |
329 int indx = rd->outgoing_edge->dest_idx; | 329 int indx = rd->outgoing_edge->dest_idx; |
330 add_phi_arg (phi, gimple_phi_arg_def (phi, indx), e); | 330 |
331 locus = gimple_phi_arg_location (phi, indx); | |
332 add_phi_arg (phi, gimple_phi_arg_def (phi, indx), e, locus); | |
331 } | 333 } |
332 } | 334 } |
333 | 335 |
334 /* Hash table traversal callback routine to create duplicate blocks. */ | 336 /* Hash table traversal callback routine to create duplicate blocks. */ |
335 | 337 |
474 | 476 |
475 /* Advance to the first executable statement. */ | 477 /* Advance to the first executable statement. */ |
476 gsi = gsi_start_bb (bb); | 478 gsi = gsi_start_bb (bb); |
477 while (!gsi_end_p (gsi) | 479 while (!gsi_end_p (gsi) |
478 && (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL | 480 && (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL |
481 || is_gimple_debug (gsi_stmt (gsi)) | |
479 || gimple_nop_p (gsi_stmt (gsi)))) | 482 || gimple_nop_p (gsi_stmt (gsi)))) |
480 gsi_next (&gsi); | 483 gsi_next (&gsi); |
481 | 484 |
482 /* Check if this is an empty block. */ | 485 /* Check if this is an empty block. */ |
483 if (gsi_end_p (gsi)) | 486 if (gsi_end_p (gsi)) |
484 return true; | 487 return true; |
485 | 488 |
486 /* Test that we've reached the terminating control statement. */ | 489 /* Test that we've reached the terminating control statement. */ |
630 thread_single_edge (edge e) | 633 thread_single_edge (edge e) |
631 { | 634 { |
632 basic_block bb = e->dest; | 635 basic_block bb = e->dest; |
633 edge eto = (edge) e->aux; | 636 edge eto = (edge) e->aux; |
634 struct redirection_data rd; | 637 struct redirection_data rd; |
635 struct local_info local_info; | |
636 | 638 |
637 e->aux = NULL; | 639 e->aux = NULL; |
638 | 640 |
639 thread_stats.num_threaded_edges++; | 641 thread_stats.num_threaded_edges++; |
640 | 642 |
652 } | 654 } |
653 | 655 |
654 /* Otherwise, we need to create a copy. */ | 656 /* Otherwise, we need to create a copy. */ |
655 update_bb_profile_for_threading (bb, EDGE_FREQUENCY (e), e->count, eto); | 657 update_bb_profile_for_threading (bb, EDGE_FREQUENCY (e), e->count, eto); |
656 | 658 |
657 local_info.bb = bb; | |
658 rd.outgoing_edge = eto; | 659 rd.outgoing_edge = eto; |
659 | 660 |
660 create_block_for_threading (bb, &rd); | 661 create_block_for_threading (bb, &rd); |
661 create_edge_and_update_destination_phis (&rd); | 662 create_edge_and_update_destination_phis (&rd); |
662 | 663 |
904 gcc_assert (tgt_bb != NULL); | 905 gcc_assert (tgt_bb != NULL); |
905 } | 906 } |
906 else | 907 else |
907 tgt_bb = split_edge (tgt_edge); | 908 tgt_bb = split_edge (tgt_edge); |
908 } | 909 } |
909 | 910 |
910 if (latch->aux) | 911 if (latch->aux) |
911 { | 912 { |
912 /* First handle the case latch edge is redirected. */ | 913 /* First handle the case latch edge is redirected. */ |
913 loop->latch = thread_single_edge (latch); | 914 loop->latch = thread_single_edge (latch); |
914 gcc_assert (single_succ (loop->latch) == tgt_bb); | 915 gcc_assert (single_succ (loop->latch) == tgt_bb); |
946 loop->header = mfb_kj_edge->dest; | 947 loop->header = mfb_kj_edge->dest; |
947 latch = make_forwarder_block (tgt_bb, mfb_keep_just, NULL); | 948 latch = make_forwarder_block (tgt_bb, mfb_keep_just, NULL); |
948 loop->header = latch->dest; | 949 loop->header = latch->dest; |
949 loop->latch = latch->src; | 950 loop->latch = latch->src; |
950 } | 951 } |
951 | 952 |
952 return true; | 953 return true; |
953 | 954 |
954 fail: | 955 fail: |
955 /* We failed to thread anything. Cancel the requests. */ | 956 /* We failed to thread anything. Cancel the requests. */ |
956 FOR_EACH_EDGE (e, ei, header->preds) | 957 FOR_EACH_EDGE (e, ei, header->preds) |