On Wed, Nov 29, 2017 at 10:02 AM, Richard Biener wrote: > On Tue, Nov 28, 2017 at 3:48 PM, Bin Cheng 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. Updated, will commit new patch as attached. Thanks, bin > > 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 >> >> * 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.