This is the mail archive of the
mailing list for the GCC project.
[patch] tree-cfg.c: Speed up thread_jumps () - Part 2
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 04 Oct 2004 12:59:24 -0400 (EDT)
- Subject: [patch] tree-cfg.c: Speed up thread_jumps () - Part 2
Attached is a patch to speed up thread_jumps().
When we thread a jump, it is important to notice an infinite loop so
that we won't end up following forwarder blocks forever.
thread_jumps() in tree.cfg.c precisely checks for that case, except
that it does so twice in a row for nothing.
Consider the "for" loop shown in the patch. When we get into the
loop, we have
tree_forwarder_block_p (dest) == true
bb_ann (dest)->forwardable == 1
implying that the "if" statment
if (!bb_ann (dest)->forwardable)
will never trigger.
The patch removes the "if" statement that never triggers.
Tested on i686-pc-linux-gnu on top of
OK to apply?
2004-10-04 Kazu Hirata <email@example.com>
* tree-cfg.c (thread_jumps): Remove a duplicate check for
an infinite loop.
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.64
diff -U5 -r2.64 tree-cfg.c
--- tree-cfg.c 2 Oct 2004 12:47:10 -0000 2.64
+++ tree-cfg.c 3 Oct 2004 15:50:31 -0000
@@ -3893,15 +3893,10 @@
for (dest = EDGE_SUCC (e->dest, 0)->dest;
last = EDGE_SUCC (dest, 0),
dest = EDGE_SUCC (dest, 0)->dest)
- /* An infinite loop detected. We redirect the edge anyway, so
- that the loop is shrunk into single basic block. */
- if (!bb_ann (dest)->forwardable)
if (EDGE_SUCC (dest, 0)->dest == EXIT_BLOCK_PTR)
bb_ann (dest)->forwardable = 0;