Commit 11b08ee9 by Richard Guenther Committed by Richard Biener

passes.c (init_optimization_passes): Remove cleanup_cfg1, sdse1 and addressables2 passes.

2008-08-18  Richard Guenther  <rguenther@suse.de>

	* 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
parent 400196f1
2008-08-18 Richard Guenther <rguenther@suse.de> 2008-08-18 Richard Guenther <rguenther@suse.de>
* 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 <rguenther@suse.de>
* tree-sra.c (generate_element_init_1): Deal with NULL constructor * tree-sra.c (generate_element_init_1): Deal with NULL constructor
element index. element index.
(scalarize_init): If we failed to generate some initializers (scalarize_init): If we failed to generate some initializers
......
...@@ -550,25 +550,14 @@ init_optimization_passes (void) ...@@ -550,25 +550,14 @@ init_optimization_passes (void)
struct opt_pass **p = &pass_all_early_optimizations.pass.sub; struct opt_pass **p = &pass_all_early_optimizations.pass.sub;
NEXT_PASS (pass_rebuild_cgraph_edges); NEXT_PASS (pass_rebuild_cgraph_edges);
NEXT_PASS (pass_early_inline); NEXT_PASS (pass_early_inline);
NEXT_PASS (pass_cleanup_cfg);
NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_rename_ssa_copies);
NEXT_PASS (pass_ccp); NEXT_PASS (pass_ccp);
NEXT_PASS (pass_forwprop); NEXT_PASS (pass_forwprop);
NEXT_PASS (pass_update_address_taken); NEXT_PASS (pass_update_address_taken);
NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_sra_early); NEXT_PASS (pass_sra_early);
NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_copy_prop);
NEXT_PASS (pass_merge_phi); NEXT_PASS (pass_merge_phi);
NEXT_PASS (pass_dce); NEXT_PASS (pass_cd_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_simple_dse); NEXT_PASS (pass_simple_dse);
NEXT_PASS (pass_tail_recursion); NEXT_PASS (pass_tail_recursion);
NEXT_PASS (pass_convert_switch); NEXT_PASS (pass_convert_switch);
...@@ -594,14 +583,26 @@ init_optimization_passes (void) ...@@ -594,14 +583,26 @@ init_optimization_passes (void)
NEXT_PASS (pass_all_optimizations); NEXT_PASS (pass_all_optimizations);
{ {
struct opt_pass **p = &pass_all_optimizations.pass.sub; struct opt_pass **p = &pass_all_optimizations.pass.sub;
/* pass_build_alias is a dummy pass that ensures that we /* Initial scalar cleanups before alias computation.
execute TODO_rebuild_alias at this point. */ They ensure memory accesses are not indirect wherever possible. */
NEXT_PASS (pass_build_alias); NEXT_PASS (pass_update_address_taken);
NEXT_PASS (pass_return_slot);
NEXT_PASS (pass_rename_ssa_copies); NEXT_PASS (pass_rename_ssa_copies);
/* Initial scalar cleanups. */
NEXT_PASS (pass_complete_unrolli); NEXT_PASS (pass_complete_unrolli);
NEXT_PASS (pass_ccp); 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_phiprop);
NEXT_PASS (pass_fre); NEXT_PASS (pass_fre);
NEXT_PASS (pass_dce); NEXT_PASS (pass_dce);
......
2008-08-18 Richard Guenther <rguenther@suse.de>
* 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 <burnus@net-b.de> 2008-08-16 Tobias Burnus <burnus@net-b.de>
PR fortran/36825 PR fortran/36825
......
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-fdump-tree-cleanup_cfg1" } */ /* { dg-options "-fdump-tree-cfg" } */
void *alloca (__SIZE_TYPE__); void *alloca (__SIZE_TYPE__);
void link_error (); void link_error ();
...@@ -10,5 +10,5 @@ int main (int argc, char *argv[]) { ...@@ -10,5 +10,5 @@ int main (int argc, char *argv[]) {
link_error (); link_error ();
return 0; return 0;
} }
/* { dg-final { scan-tree-dump-times "link_error" 0 "cleanup_cfg1" } } */ /* { dg-final { scan-tree-dump-times "link_error" 0 "cfg" } } */
/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ /* { dg-final { cleanup-tree-dump "cfg" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cleanup_cfg1" } */ /* { dg-options "-O2 -fdump-tree-cfg" } */
#include <limits.h> #include <limits.h>
...@@ -151,9 +151,9 @@ void bla4ge (int var) ...@@ -151,9 +151,9 @@ void bla4ge (int var)
this_comparison_is_not_decidable (); 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_false" 0 "cfg" } } */
/* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cleanup_cfg1" } } */ /* { dg-final { scan-tree-dump-times "this_comparison_is_true" 6 "cfg" } } */
/* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cleanup_cfg1" } } */ /* { dg-final { scan-tree-dump-times "this_comparison_is_not_decidable" 12 "cfg" } } */
/* { dg-final { scan-tree-dump-times "if " 12 "cleanup_cfg1" } } */ /* { dg-final { scan-tree-dump-times "if " 12 "cfg" } } */
/* { dg-final { cleanup-tree-dump "cleanup_cfg1" } } */ /* { dg-final { cleanup-tree-dump "cfg" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce" } */ /* { dg-options "-O2 -fdump-tree-cddce2" } */
struct rtx_def; struct rtx_def;
typedef struct rtx_def *rtx; typedef struct rtx_def *rtx;
...@@ -41,14 +41,14 @@ get_alias_set (t) ...@@ -41,14 +41,14 @@ get_alias_set (t)
/* There should be precisely one load of ->decl.rtl. If there is /* There should be precisely one load of ->decl.rtl. If there is
more than, then the dominator optimizations failed. */ 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 /* There should be no loads of .rtmem since the complex return statement
is just "return 0". */ 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 /* There should be one IF statement (the complex return statement should
collapse down to a simple return 0 without any conditionals). */ 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" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-cddce" } */ /* { dg-options "-O1 -fdump-tree-cddce2" } */
extern void abort (void); extern void abort (void);
...@@ -33,9 +33,9 @@ delete_dead_jumptables () ...@@ -33,9 +33,9 @@ delete_dead_jumptables ()
/* There should be no loads of ->code. If any exist, then we failed to /* There should be no loads of ->code. If any exist, then we failed to
optimize away all the IF statements and the statements feeding optimize away all the IF statements and the statements feeding
their conditions. */ 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. */ /* 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" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce" } */ /* { dg-options "-O2 -fdump-tree-cddce2" } */
struct rtx_def; struct rtx_def;
typedef struct rtx_def *rtx; typedef struct rtx_def *rtx;
...@@ -37,5 +34,5 @@ com (rtx insn, int blah) ...@@ -37,5 +34,5 @@ com (rtx insn, int blah)
/* Cddce cannot remove possibly infinite loops and there is no way how to /* Cddce cannot remove possibly infinite loops and there is no way how to
determine whether the loop in can_move_up ends. */ determine whether the loop in can_move_up ends. */
/* { dg-final { scan-tree-dump "if " "cddce"} } */ /* { dg-final { scan-tree-dump "if " "cddce2"} } */
/* { dg-final { cleanup-tree-dump "cddce" } } */ /* { dg-final { cleanup-tree-dump "cddce2" } } */
/* { dg-do compile } */ /* { 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 abarney[2];
int afred[1]; int afred[1];
...@@ -28,5 +28,5 @@ void foo(int edx, int eax) ...@@ -28,5 +28,5 @@ void foo(int edx, int eax)
/* After cddce we should have two IF statements remaining as the other /* After cddce we should have two IF statements remaining as the other
two tests can be threaded. */ two tests can be threaded. */
/* { dg-final { scan-tree-dump-times "if " 2 "cddce"} } */ /* { dg-final { scan-tree-dump-times "if " 2 "cddce2"} } */
/* { dg-final { cleanup-tree-dump "cddce" } } */ /* { dg-final { cleanup-tree-dump "cddce2" } } */
...@@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i) ...@@ -15,5 +15,5 @@ void f(struct a * b, __SIZE_TYPE__ i)
c[i] = 1; 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" } } */ /* { dg-final { cleanup-tree-dump "forwprop1" } } */
...@@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i) ...@@ -17,5 +17,5 @@ void f(__SIZE_TYPE__ i)
c[i] = 1; 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?" } } */ /* { dg-final { cleanup-tree-dump "forwprop?" } } */
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-cddce" } */ /* { dg-options "-O2 -fdump-tree-cddce1" } */
int main(void) int main(void)
{ {
...@@ -23,9 +23,9 @@ int main(void) ...@@ -23,9 +23,9 @@ int main(void)
/* We should eliminate the inner condition, but the loop must be preserved /* 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): */ 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): */ /* 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" } } */
...@@ -212,10 +212,6 @@ build_gimple_cfg (gimple_seq seq) ...@@ -212,10 +212,6 @@ build_gimple_cfg (gimple_seq seq)
#ifdef ENABLE_CHECKING #ifdef ENABLE_CHECKING
verify_stmts (); verify_stmts ();
#endif #endif
/* Dump a textual representation of the flowgraph. */
if (dump_file)
gimple_dump_cfg (dump_file, dump_flags);
} }
static unsigned int static unsigned int
...@@ -240,7 +236,8 @@ struct gimple_opt_pass pass_build_cfg = ...@@ -240,7 +236,8 @@ struct gimple_opt_pass pass_build_cfg =
PROP_cfg, /* properties_provided */ PROP_cfg, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 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 */
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment