[patch] passes.c: Don't call cleanup_cfg from rest_of_handle_loop_optimize.
Kazu Hirata
kazu@cs.umass.edu
Mon Feb 14 19:49:00 GMT 2005
Hi,
Attached is a patch to remove a call to cleanup_cfg at the beginning
of rest_of_handle_loop_optimize.
Both rest_of_handle_cse and rest_of_handle_gcse call cleanup_cfg if
they change CFG. Also, rest_of_handle_jump2 unconditoinally calls
cleanup_cfg, so rest_of_handle_loop does not need to call cleanup_cfg
at its beginning. Since cleanup_cfg is a fixed point operation,
calling it twice in a row doesn't do any good. Since
delete_dead_jumptables is part of cleanup_cfg, it doesn't make sense
to call it right after calling cleanup_cfg.
The patch removes the two calls delete_dead_jumptables and cleanup_cfg
at the beginning of rest_of_handle_loop_optimize.
Here is a timing in second for five runs of ./cc1 -quiet -O2 -o
/dev/null.
original patched diff%
c-common.i 17.955 17.940 -0.083%
combine.i 17.049 17.027 -0.129%
fold-const.i 37.434 37.398 -0.096%
insn-attrtab.i 46.702 46.281 -0.901%
reload1.i 13.321 13.267 -0.405%
reload.i 12.231 12.213 -0.147%
cc1-i files 216.464 216.327 -0.063%
I also confirmed that this patch makes no difference in the generated
code for cc1-i files, Linux kernel, generate-3.4.ii, tramp3d-v3.ii,
MICO, and POOMA.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
* passes.c (rest_of_handle_loop_optimize): Remove calls to
delete_dead_jumptables and cleanup_cfg.
Index: passes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/passes.c,v
retrieving revision 2.67
diff -u -d -p -r2.67 passes.c
--- passes.c 13 Feb 2005 03:58:21 -0000 2.67
+++ passes.c 14 Feb 2005 14:35:22 -0000
@@ -1075,8 +1075,6 @@ rest_of_handle_loop_optimize (void)
int do_prefetch;
timevar_push (TV_LOOP);
- delete_dead_jumptables ();
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
open_dump_file (DFI_loop, current_function_decl);
/* CFG is no longer maintained up-to-date. */
More information about the Gcc-patches
mailing list