]> git.ipfire.org Git - thirdparty/gcc.git/commit
Use simple_dce_from_worklist in phiprop
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 23 May 2024 16:56:37 +0000 (09:56 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 24 May 2024 06:52:57 +0000 (23:52 -0700)
commit3e06763a695d97aa46c9de71573ec6a43bb92449
treed714e98ab5eb19ebee91fb985d0acec336f98175
parentc71886f2ca2e46ce1449c7064d6f1b447d02fcba
Use simple_dce_from_worklist in phiprop

I noticed that phiprop leaves around phi nodes which
defines a ssa name which is unused. This just adds a
bitmap to mark those ssa names and then calls
simple_dce_from_worklist at the very end to remove
those phi nodes and all of the dependencies if there
was any. This might allow us to optimize something earlier
due to the removal of the phi which was taking the address
of the variables.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

gcc/ChangeLog:

* tree-ssa-phiprop.cc (phiprop_insert_phi): Add
dce_ssa_names argument. Add the phi's result to it.
(propagate_with_phi): Add dce_ssa_names argument.
Update call to phiprop_insert_phi.
(pass_phiprop::execute): Update call to propagate_with_phi.
Call simple_dce_from_worklist if there was a change.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/tree-ssa-phiprop.cc