]> git.ipfire.org Git - people/ms/gcc.git/commit
Use simple_dce_from_worklist with match_simplify_replacement.
authorAndrew Pinski <apinski@marvell.com>
Thu, 27 Oct 2022 04:37:01 +0000 (04:37 +0000)
committerAndrew Pinski <apinski@marvell.com>
Thu, 27 Oct 2022 18:37:12 +0000 (18:37 +0000)
commit1c2b53ce8bbf5bbe1ddb13bb6005f432726518ae
treefc2510ab303f796544e3f2de3f61fb77afaea017
parenta33d623d2d3a78f5ef6f9e854946303e063eef63
Use simple_dce_from_worklist with match_simplify_replacement.

This is a simple patch to do some DCE after a successful
match and simplify replacement in PHI-OPT. match and simplify
likes to generate some extra statements which should be cleaned
up.

OK? Bootstrapped and tested on x86_64-linux with no regressions.

Thanks,
Andrew Pinski

gcc/ChangeLog:

* tree-ssa-phiopt.cc: Include tree-ssa-dce.h
(replace_phi_edge_with_variable):
New argument, dce_ssa_names. Call simple_dce_from_worklist.
(match_simplify_replacement): If we inserted a sequence,
mark the lhs of the new sequence to be possible dce.
Always move the statement and mark the lhs (if it is a name)
as possible to remove.
gcc/tree-ssa-phiopt.cc