This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[3.3/mainline] Speed up nonoptimizing compilation II
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at redaht dot com
- Date: Fri, 21 Feb 2003 13:35:13 +0100
- Subject: [3.3/mainline] Speed up nonoptimizing compilation II
Hi,
tidy_fallthru_edges is subset of cfg_cleanup(0) and yet it is slower. I
believe it is useless at both places it is called - we always
cleanup_cfg after find_basic_blocks and delete_unreachable_block is
either called from cfgcleanup or to avoid dataflow to crash on
unreachable blocks so both is OK.
I am installing this to rtlopt branch so we see if it makes any
implications on code quality, but I would be really surprised.
Honza
Fri Feb 21 13:32:35 CET 2003 Jan Hubicka <jh at suse dot cz>
* basic-block.h (tidy_fallthru_edges): Kill.
* cfgrtl.c (tidy_fallthru_edges): Kill.
* cfgbuild.c (find_basic_blocks): Do not call tidy_fallthru_edges.
* cfgcleanup.c (delete_unreachable_blocks): Likewise.
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.169
diff -c -3 -p -r1.169 basic-block.h
*** basic-block.h 6 Feb 2003 10:02:31 -0000 1.169
--- basic-block.h 21 Feb 2003 12:31:36 -0000
*************** extern void clear_bb_flags PARAMS ((voi
*** 361,367 ****
extern void merge_blocks_nomove PARAMS ((basic_block, basic_block));
extern void tidy_fallthru_edge PARAMS ((edge, basic_block,
basic_block));
- extern void tidy_fallthru_edges PARAMS ((void));
extern void flow_reverse_top_sort_order_compute PARAMS ((int *));
extern int flow_depth_first_order_compute PARAMS ((int *, int *));
extern void flow_preorder_transversal_compute PARAMS ((int *));
--- 361,366 ----
Index: cfgbuild.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgbuild.c,v
retrieving revision 1.32
diff -c -3 -p -r1.32 cfgbuild.c
*** cfgbuild.c 6 Feb 2003 10:02:32 -0000 1.32
--- cfgbuild.c 21 Feb 2003 12:31:36 -0000
*************** find_basic_blocks (f, nregs, file)
*** 649,658 ****
/* Discover the edges of our cfg. */
make_edges (label_value_list, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
- /* Do very simple cleanup now, for the benefit of code that runs between
- here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns. */
- tidy_fallthru_edges ();
-
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
--- 649,654 ----
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 cfgcleanup.c
*** cfgcleanup.c 15 Feb 2003 21:06:16 -0000 1.73
--- cfgcleanup.c 21 Feb 2003 12:31:36 -0000
*************** delete_unreachable_blocks ()
*** 1751,1759 ****
changed = true;
}
}
-
- if (changed)
- tidy_fallthru_edges ();
return changed;
}
--- 1751,1756 ----
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
retrieving revision 1.65
diff -c -3 -p -r1.65 cfgrtl.c
*** cfgrtl.c 21 Feb 2003 10:06:44 -0000 1.65
--- cfgrtl.c 21 Feb 2003 12:31:36 -0000
*************** tidy_fallthru_edge (e, b, c)
*** 1131,1178 ****
e->flags |= EDGE_FALLTHRU;
}
-
- /* Fix up edges that now fall through, or rather should now fall through
- but previously required a jump around now deleted blocks. Simplify
- the search by only examining blocks numerically adjacent, since this
- is how find_basic_blocks created them. */
-
- void
- tidy_fallthru_edges ()
- {
- basic_block b, c;
-
- if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR)
- return;
-
- FOR_BB_BETWEEN (b, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, next_bb)
- {
- edge s;
-
- c = b->next_bb;
-
- /* We care about simple conditional or unconditional jumps with
- a single successor.
-
- If we had a conditional branch to the next instruction when
- find_basic_blocks was called, then there will only be one
- out edge for the block which ended with the conditional
- branch (since we do not create duplicate edges).
-
- Furthermore, the edge will be marked as a fallthru because we
- merge the flags for the duplicate edges. So we do not want to
- check that the edge is not a FALLTHRU edge. */
-
- if ((s = b->succ) != NULL
- && ! (s->flags & EDGE_COMPLEX)
- && s->succ_next == NULL
- && s->dest == c
- /* If the jump insn has side effects, we can't tidy the edge. */
- && (GET_CODE (b->end) != JUMP_INSN
- || onlyjump_p (b->end)))
- tidy_fallthru_edge (s, b, c);
- }
- }
/* Helper function for split_edge. Return true in case edge BB2 to BB1
is back edge of syntactic loop. */
--- 1131,1136 ----