]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
passes.c (init_optimization_passes): Remove cleanup_cfg1, sdse1 and addressables2...
authorRichard Guenther <rguenther@suse.de>
Mon, 18 Aug 2008 08:42:57 +0000 (08:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 18 Aug 2008 08:42:57 +0000 (08:42 +0000)
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

13 files changed:
gcc/ChangeLog
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/fold-alloca-1.c
gcc/testsuite/gcc.dg/fold-compare-3.c
gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c
gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c
gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c
gcc/testsuite/gcc.dg/tree-ssa/forwprop-1.c
gcc/testsuite/gcc.dg/tree-ssa/forwprop-2.c
gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c
gcc/tree-cfg.c

index 0f42ce4159dfcd49eab43a230799d7137d8b83d0..48f6ea4eb60bad6d68e14f8cb2fc758be607800b 100644 (file)
@@ -1,3 +1,13 @@
+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
index ee3826b39db36d582cf44e46b7a6491d865702e4..a9af10d1c927ec503ebccf255b93c323d1fef794 100644 (file)
@@ -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);
index fe96594951d6849f1c30235f454df0371f1cd9c8..bd294ade16578e0f3341010e7e2c48ddcbd3d901 100644 (file)
@@ -1,3 +1,15 @@
+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>
 
        PR fortran/36825
index c464536470159da4558066f8b31d872aa009002d..93f28cfa1ae020ba2e75387c6ec801cbc523723a 100644 (file)
@@ -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" } } */
index 011bf47bd6e28f43720e6c8cc551a9af1c4392ef..d38a945aeec27e4248be540f4195040199f2a290 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-cleanup_cfg1" } */
+/* { dg-options "-O2 -fdump-tree-cfg" } */
 
 #include <limits.h>
 
@@ -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" } } */
index 4712a3b9fb3e62d32863a0c0fbe117cbc547439b..f99598d73cf7bd6822b6002d47e1d91734d0717c 100644 (file)
@@ -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" } } */
index f7057bfe822b0cbc8c8c1bf9ee220287c5c701c9..27e2c7105f6a3fdba3a45f0c5585bfbc71d96d0d 100644 (file)
@@ -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" } } */
index aaeab53a2cfc820c1ea7d8cf401cf8ea0e12e063..34a5926796ed05c5ab047a55bd35f216669fecec 100644 (file)
@@ -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" } } */
index acde4b3116cc8dd295c00257b9e75d0a96cabeee..8e9f61da60a775be4bf8a33cac607f66f48d25d9 100644 (file)
@@ -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" } } */
index c1fa43543c14f8393bcac2c8d5f5031c94002b3f..ee3cb0ebfe52320f4be1d157647e4e0689700e75 100644 (file)
@@ -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" } } */
index 434d86c65d5bfd7f2e41339346c94b2fb79a15bf..fe04e66fa1a54b6655341d163edc98bea2815310 100644 (file)
@@ -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?" } } */
index 847d4209b58e217c6223f138ab64cac09769593a..f7645c353def3f265e337428fac0e53b787f54e9 100644 (file)
@@ -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" } } */
index 99978efe35b7b496530ab765a5f6c987260ad162..c1344a75ab30dc4b4876280cb406f93a011f5c33 100644 (file)
@@ -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 */
  }
 };