This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cfg-branch] bb-reorder fortran90 compatible
- From: Josef Zlomek <zlomj9am at artax dot karlin dot mff dot cuni dot cz>
- To: gcc-pdo at atrey dot karlin dot mff dot cuni dot cz, gcc-patches at gcc dot gnu dot org
- Date: Thu, 9 May 2002 21:59:49 +0200
- Subject: [cfg-branch] bb-reorder fortran90 compatible
Hi,
this patch modifies bb-reorder to handle better the multiple entry points of
function that are introduced in Fortran90.
Bootstrapped i686.
Joe
Thu May 9 21:57:23 CEST 2002 Josef Zlomek <zlomek@matfyz.cz>
* bb-reorder.c (find_traces): Handle multiple entry points of
function.
*** gcc-old/gcc/bb-reorder.c Thu May 9 19:04:37 2002
--- gcc-new/gcc/bb-reorder.c Thu May 9 19:15:27 2002
*************** find_traces ()
*** 125,131 ****
int i;
int n_traces;
struct trace *traces;
! basic_block bb0;
fibheap_t heap;
int *start_of_trace;
bool *connected;
--- 125,132 ----
int i;
int n_traces;
struct trace *traces;
! edge e;
! int max_entry_frequency;
fibheap_t heap;
int *start_of_trace;
bool *connected;
*************** find_traces ()
*** 136,152 ****
traces = xmalloc (n_basic_blocks * sizeof(struct trace));
n_traces = 0;
! /* Find the traces. */
! bb0 = BASIC_BLOCK (0);
heap = fibheap_new();
! fibheap_insert (heap, bb_to_key (bb0), bb0);
for (i = 0; i < N_ROUNDS; i++)
{
if (rtl_dump_file)
fprintf (rtl_dump_file, "STC - round %d\n", i);
find_traces_1_round (branch_threshold[i] * REG_BR_PROB_BASE / 1000,
! exec_threshold[i] * bb0->frequency / 1000,
traces, &n_traces, i, &heap,
!optimize_size && i < N_CODEGROWING_ROUNDS);
}
--- 137,160 ----
traces = xmalloc (n_basic_blocks * sizeof(struct trace));
n_traces = 0;
! /* Insert entry points of function into heap. */
heap = fibheap_new();
! max_entry_frequency = 0;
! for (e = ENTRY_BLOCK_PTR->succ; e; e = e->succ_next)
! {
! fibheap_insert (heap, bb_to_key (e->dest), e->dest);
! if (e->dest->frequency > max_entry_frequency)
! max_entry_frequency = e->dest->frequency;
! }
!
! /* Find the traces. */
for (i = 0; i < N_ROUNDS; i++)
{
if (rtl_dump_file)
fprintf (rtl_dump_file, "STC - round %d\n", i);
find_traces_1_round (branch_threshold[i] * REG_BR_PROB_BASE / 1000,
! exec_threshold[i] * max_entry_frequency / 1000,
traces, &n_traces, i, &heap,
!optimize_size && i < N_CODEGROWING_ROUNDS);
}