[PATCH GCC]Rename and make remove_dead_inserted_code a simple dce interface

Richard Biener richard.guenther@gmail.com
Wed Nov 29 10:11:00 GMT 2017


On Tue, Nov 28, 2017 at 3:48 PM, Bin Cheng <Bin.Cheng@arm.com> wrote:
> Hi,
> This patch renames remove_dead_inserted_code to simple_dce_from_worklist, moves it to tree-ssa-dce.c
> and makes it a simple public DCE interface.  Bootstrap and test along with loop interchange.  It's required
> for interchange pass.  Is it OK?

+  /* ???  Re-use seeds as worklist not only as initial set.  This may end up
+     removing more code as well.  If we keep seeds unchanged we could restrict
+     new worklist elements to members of seed.  */

Please remove this comment, while it applies to PRE when one takes
remove_dead_inserted_code
literally it doesn't apply to a seeded DCE.

Please also rename 'seeds' to 'worklist' directly and document that
worklist is consumed by the function.
The function has linear complexity in the number of dead stmts, the
constant factor is the number of
SSA use operands in those stmts (so 2 on average I'd say).

Ok with that change.

Thanks,
Richard.

> BTW, I will push this along with interchange to branch: gcc.gnu.org/svn/gcc/branches/gimple-linterchange.
>
> Thanks,
> bin
> 2017-11-27  Bin Cheng  <bin.cheng@arm.com>
>
>         * tree-ssa-dce.c (simple_dce_from_worklist): Move and rename from
>         tree-ssa-pre.c::remove_dead_inserted_code.
>         * tree-ssa-dce.h: New file.
>         * tree-ssa-pre.c (tree-ssa-dce.h): Include new header file.
>         (remove_dead_inserted_code): Move and rename to function
>         tree-ssa-dce.c::simple_dce_from_worklist.
>         (pass_pre::execute): Update use.



More information about the Gcc-patches mailing list