On Mon, 14 May 2018, Kugan Vivekanandarajah wrote: > Hi, > > Attached patch handles PR63185 when we reach PHI with temp != NULLL. > We could see the PHI and if there isn't any uses for PHI that is > interesting, we could ignore that ? > > Bootstrapped and regression tested on x86_64-linux-gnu. > Is this OK?
No, as Jeff said we can't do it this way. If we end up with multiple VDEFs in the walk of defvar immediate uses we know we are dealing with a CFG fork. We can't really ignore any of the paths but we have to a) find the merge point (and the associated VDEF) b) verify for each each chain of VDEFs with associated VUSEs up to that merge VDEF that we have no uses of the to classify store and collect (partial) kills c) intersect kill info and continue walking from the merge point in b) there's the optional possibility to find sinking opportunities in case we have kills on some paths but uses on others. This is why DSE should be really merged with (store) sinking. So if we want to enhance DSEs handling of branches then we need to refactor the simple dse_classify_store function. Let me take an attempt at this today. Richard. > Thanks, > Kugan > > > gcc/ChangeLog: > > 2018-05-14 Kugan Vivekanandarajah <kug...@linaro.org> > > * tree-ssa-dse.c (phi_dosent_define_nor_use_p): New. > (dse_classify_store): Use phi_dosent_define_nor_use_p. > > gcc/testsuite/ChangeLog: > > 2018-05-14 Kugan Vivekanandarajah <kug...@linaro.org> > > * gcc.dg/tree-ssa/ssa-dse-33.c: New test. > -- Richard Biener <rguent...@suse.de> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)