]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/99912 - schedule another TODO_remove_unused_locals
authorRichard Biener <rguenther@suse.de>
Tue, 27 Apr 2021 12:27:40 +0000 (14:27 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 27 Apr 2021 13:17:34 +0000 (15:17 +0200)
This makes sure to remove unused locals and prune CLOBBERs after
the first scalar cleanup phase after IPA optimizations.  On the
testcase in the PR this results in 8000 CLOBBERs removed which
in turn unleashes more DSE which otherwise hits its walking limit
of 256 too early on this testcase.

2021-04-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99912
* passes.def: Add comment about new TODO_remove_unused_locals.
* tree-stdarg.c (pass_data_stdarg): Run TODO_remove_unused_locals
at start.

gcc/passes.def
gcc/tree-stdarg.c

index 61fe9fdc42c48e3a39aecbd2635a9863509a2f8b..f7c42897f43a6adcd5dfc2691df4c8876692fc12 100644 (file)
@@ -212,6 +212,9 @@ along with GCC; see the file COPYING3.  If not see
       NEXT_PASS (pass_vrp, true /* warn_array_bounds_p */);
       NEXT_PASS (pass_dse);
       NEXT_PASS (pass_dce);
+      /* pass_stdarg is always run and at this point we execute
+         TODO_remove_unused_locals to prune CLOBBERs of dead
+        variables which are otherwise a churn on alias walkings.  */
       NEXT_PASS (pass_stdarg);
       NEXT_PASS (pass_call_cdce);
       NEXT_PASS (pass_cselim);
index ef21c125651eacd9203586dd290fd53df5027cd0..2f77a613df03d590f24d5d92a21b4bfcab9409a6 100644 (file)
@@ -1114,7 +1114,7 @@ const pass_data pass_data_stdarg =
   ( PROP_cfg | PROP_ssa ), /* properties_required */
   PROP_gimple_lva, /* properties_provided */
   0, /* properties_destroyed */
-  0, /* todo_flags_start */
+  TODO_remove_unused_locals, /* todo_flags_start */
   0, /* todo_flags_finish */
 };