From 11b08ee9118d107d2222a47f1994b43ddbd29ab8 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 18 Aug 2008 08:42:57 +0000 Subject: [PATCH] passes.c (init_optimization_passes): Remove cleanup_cfg1, sdse1 and addressables2 passes. 2008-08-18 Richard Guenther * passes.c (init_optimization_passes): Remove cleanup_cfg1, sdse1 and addressables2 passes. Replace dce1 with cddce1. Move call_cdce before build_alias. Move copyrename2, cunrolli and ccp2 beafore build_alias. Re-add addressable2 right after final inlining. * tree-cfg.c (build_gimple_cfg): Do not dump function here. (pass_build_cfg): But instead via TODO_dump_func. * gcc.dg/fold-alloca-1.c: Scan cfg dump instead of cleanup_cfg1. * gcc.dg/fold-compare-3.c: Likewise. * gcc.dg/tree-ssa/20030709-2.c: Scan cddce2 dump. * gcc.dg/tree-ssa/20030808-1.c: Likewise. * gcc.dg/tree-ssa/20040211-1.c: Likewise. * gcc.dg/tree-ssa/20040305-1.c: Likewise. * gcc.dg/tree-ssa/forwprop-1.c: Adjust pattern. * gcc.dg/tree-ssa/forwprop-2.c: Likewise.. * gcc.dg/tree-ssa/ssa-dce-3.c: Scan cddce1 dump. From-SVN: r139189 --- gcc/ChangeLog | 10 +++++++ gcc/passes.c | 35 +++++++++++----------- gcc/testsuite/ChangeLog | 12 ++++++++ gcc/testsuite/gcc.dg/fold-alloca-1.c | 6 ++-- gcc/testsuite/gcc.dg/fold-compare-3.c | 12 ++++---- gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c | 10 +++---- gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c | 8 ++--- gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c | 9 ++---- gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c | 6 ++-- gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c | 8 ++--- gcc/tree-cfg.c | 7 ++--- 13 files changed, 72 insertions(+), 55 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f42ce4159df..48f6ea4eb60b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2008-08-18 Richard Guenther + + * passes.c (init_optimization_passes): Remove cleanup_cfg1, + sdse1 and addressables2 passes. Replace dce1 with cddce1. + Move call_cdce before build_alias. Move copyrename2, + cunrolli and ccp2 beafore build_alias. Re-add addressable2 + right after final inlining. + * tree-cfg.c (build_gimple_cfg): Do not dump function here. + (pass_build_cfg): But instead via TODO_dump_func. + 2008-08-18 Richard Guenther * tree-sra.c (generate_element_init_1): Deal with NULL constructor diff --git a/gcc/passes.c b/gcc/passes.c index ee3826b39db3..a9af10d1c927 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -550,25 +550,14 @@ init_optimization_passes (void) struct opt_pass **p = &pass_all_early_optimizations.pass.sub; NEXT_PASS (pass_rebuild_cgraph_edges); NEXT_PASS (pass_early_inline); - NEXT_PASS (pass_cleanup_cfg); NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_ccp); NEXT_PASS (pass_forwprop); NEXT_PASS (pass_update_address_taken); - NEXT_PASS (pass_simple_dse); NEXT_PASS (pass_sra_early); NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_merge_phi); - NEXT_PASS (pass_dce); - /* Ideally the function call conditional - dead code elimination phase can be delayed - till later where potentially more opportunities - can be found. Due to lack of good ways to - update VDEFs associated with the shrink-wrapped - calls, it is better to do the transformation - here where memory SSA is not built yet. */ - NEXT_PASS (pass_call_cdce); - NEXT_PASS (pass_update_address_taken); + NEXT_PASS (pass_cd_dce); NEXT_PASS (pass_simple_dse); NEXT_PASS (pass_tail_recursion); NEXT_PASS (pass_convert_switch); @@ -594,14 +583,26 @@ init_optimization_passes (void) NEXT_PASS (pass_all_optimizations); { struct opt_pass **p = &pass_all_optimizations.pass.sub; - /* pass_build_alias is a dummy pass that ensures that we - execute TODO_rebuild_alias at this point. */ - NEXT_PASS (pass_build_alias); - NEXT_PASS (pass_return_slot); + /* Initial scalar cleanups before alias computation. + They ensure memory accesses are not indirect wherever possible. */ + NEXT_PASS (pass_update_address_taken); NEXT_PASS (pass_rename_ssa_copies); - /* Initial scalar cleanups. */ NEXT_PASS (pass_complete_unrolli); NEXT_PASS (pass_ccp); + /* Ideally the function call conditional + dead code elimination phase can be delayed + till later where potentially more opportunities + can be found. Due to lack of good ways to + update VDEFs associated with the shrink-wrapped + calls, it is better to do the transformation + here where memory SSA is not built yet. */ + NEXT_PASS (pass_call_cdce); + /* pass_build_alias is a dummy pass that ensures that we + execute TODO_rebuild_alias at this point. Re-building + alias information also rewrites no longer addressed + locals into SSA form if possible. */ + NEXT_PASS (pass_build_alias); + NEXT_PASS (pass_return_slot); NEXT_PASS (pass_phiprop); NEXT_PASS (pass_fre); NEXT_PASS (pass_dce); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fe96594951d6..bd294ade1657 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,15 @@ +2008-08-18 Richard Guenther + + * gcc.dg/fold-alloca-1.c: Scan cfg dump instead of cleanup_cfg1. + * gcc.dg/fold-compare-3.c: Likewise. + * gcc.dg/tree-ssa/20030709-2.c: Scan cddce2 dump. + * gcc.dg/tree-ssa/20030808-1.c: Likewise. + * gcc.dg/tree-ssa/20040211-1.c: Likewise. + * gcc.dg/tree-ssa/20040305-1.c: Likewise. + * gcc.dg/tree-ssa/forwprop-1.c: Adjust pattern. + * gcc.dg/tree-ssa/forwprop-2.c: Likewise.. + * gcc.dg/tree-ssa/ssa-dce-3.c: Scan cddce1 dump. + 2008-08-16 Tobias Burnus PR fortran/36825 diff --git a/gcc/testsuite/gcc.dg/fold-alloca-1.c b/gcc/testsuite/gcc.dg/fold-alloca-1.c index c46453647015..93f28cfa1ae0 100644 --- a/gcc/testsuite/gcc.dg/fold-alloca-1.c +++ b/gcc/testsuite/gcc.dg/fold-alloca-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fdump-tree-cleanup_cfg1" } */ +/* { dg-options "-fdump-tree-cfg" } */ void *alloca (__SIZE_TYPE__); void link_error (); @@ -10,5 +10,5 @@ int main (int argc, char *argv[]) { link_error (); return 0; } -/* { dg-final { scan-tree-dump-times "link_error" 0 "cleanup_cfg1" } } */ -/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "cfg" } } */ +/* { dg-final { cleanup-tree-dump "cfg" } } */ diff --git a/gcc/testsuite/gcc.dg/fold-compare-3.c b/gcc/testsuite/gcc.dg/fold-compare-3.c index 011bf47bd6e2..d38a945aeec2 100644 --- a/gcc/testsuite/gcc.dg/fold-compare-3.c +++ b/gcc/testsuite/gcc.dg/fold-compare-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cleanup_cfg1" } */ +/* { dg-options "-O2 -fdump-tree-cfg" } */ #include @@ -151,9 +151,9 @@ void bla4ge (int var) this_comparison_is_not_decidable (); } -/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cleanup_cfg1" } } */ -/* { dg-final { scan-tree-dump-times "if " 12 "cleanup_cfg1" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_false" 0 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */ +/* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */ -/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ +/* { dg-final { cleanup-tree-dump "cfg" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c index 4712a3b9fb3e..f99598d73cf7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ +/* { dg-options "-O2 -fdump-tree-cddce2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -41,14 +41,14 @@ get_alias_set (t) /* There should be precisely one load of ->decl.rtl. If there is more than, then the dominator optimizations failed. */ -/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "->decl\\.rtl" 1 "cddce2"} } */ /* There should be no loads of .rtmem since the complex return statement is just "return 0". */ -/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times ".rtmem" 0 "cddce2"} } */ /* There should be one IF statement (the complex return statement should collapse down to a simple return 0 without any conditionals). */ -/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "cddce2"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c index f7057bfe822b..27e2c7105f6a 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-tree-cddce" } */ +/* { dg-options "-O1 -fdump-tree-cddce2" } */ extern void abort (void); @@ -33,9 +33,9 @@ delete_dead_jumptables () /* There should be no loads of ->code. If any exist, then we failed to optimize away all the IF statements and the statements feeding their conditions. */ -/* { dg-final { scan-tree-dump-times "->code" 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "->code" 0 "cddce2"} } */ /* There should be no IF statements. */ -/* { dg-final { scan-tree-dump-times "if " 0 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 0 "cddce2"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c index aaeab53a2cfc..34a5926796ed 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c @@ -1,8 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ - - - +/* { dg-options "-O2 -fdump-tree-cddce2" } */ struct rtx_def; typedef struct rtx_def *rtx; @@ -37,5 +34,5 @@ com (rtx insn, int blah) /* Cddce cannot remove possibly infinite loops and there is no way how to determine whether the loop in can_move_up ends. */ -/* { dg-final { scan-tree-dump "if " "cddce"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { scan-tree-dump "if " "cddce2"} } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c index acde4b3116cc..8e9f61da60a7 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce -fdump-tree-forwprop1-details" } */ +/* { dg-options "-O2 -fdump-tree-cddce2 -fdump-tree-forwprop1-details" } */ int abarney[2]; int afred[1]; @@ -28,5 +28,5 @@ void foo(int edx, int eax) /* After cddce we should have two IF statements remaining as the other two tests can be threaded. */ -/* { dg-final { scan-tree-dump-times "if " 2 "cddce"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { scan-tree-dump-times "if " 2 "cddce2"} } */ +/* { dg-final { cleanup-tree-dump "cddce2" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c index c1fa43543c14..ee3cb0ebfe52 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c @@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c index 434d86c65d5b..fe04e66fa1a5 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c @@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i) c[i] = 1; } -/* { dg-final { scan-tree-dump "t\\\[i.*\\\] = 1;" "forwprop1" } } */ +/* { dg-final { scan-tree-dump-times "t\\\[i.*\\\] =.* 1;" 1 "forwprop1" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c index 847d4209b58e..f7645c353def 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-cddce" } */ +/* { dg-options "-O2 -fdump-tree-cddce1" } */ int main(void) { @@ -23,9 +23,9 @@ int main(void) /* We should eliminate the inner condition, but the loop must be preserved as it is infinite. Therefore there should be just one phi node (for i): */ -/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "PHI " 1 "cddce1"} } */ /* And one if (for the exit condition of the loop): */ -/* { dg-final { scan-tree-dump-times "if " 1 "cddce"} } */ +/* { dg-final { scan-tree-dump-times "if " 1 "cddce1"} } */ -/* { dg-final { cleanup-tree-dump "cddce" } } */ +/* { dg-final { cleanup-tree-dump "cddce1" } } */ diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 99978efe35b7..c1344a75ab30 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -212,10 +212,6 @@ build_gimple_cfg (gimple_seq seq) #ifdef ENABLE_CHECKING verify_stmts (); #endif - - /* Dump a textual representation of the flowgraph. */ - if (dump_file) - gimple_dump_cfg (dump_file, dump_flags); } static unsigned int @@ -240,7 +236,8 @@ struct gimple_opt_pass pass_build_cfg = PROP_cfg, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - TODO_verify_stmts | TODO_cleanup_cfg /* todo_flags_finish */ + TODO_verify_stmts | TODO_cleanup_cfg + | TODO_dump_func /* todo_flags_finish */ } }; -- 2.47.2