Author: rguenth Date: Wed Sep 26 11:55:17 2007 New Revision: 128810 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128810 Log: 2007-09-26 Richard Guenther <rguenther@suse.de> PR tree-optimization/30375 PR tree-optimization/33560 ... * gcc.dg/tree-ssa/complex-4.c: XFAIL. * gcc.dg/tree-ssa/complex-5.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-9.c: Likewise.
* gcc.dg/tree-ssa/complex-4.c: XFAIL. is a regression then because the testcase was added back in 2006-02-18 (by me).
Subject: Re: [4.3 Regression] aggregate DSE disabled On Wed, 26 Sep 2007, pinskia at gcc dot gnu dot org wrote: > ------- Comment #1 from pinskia at gcc dot gnu dot org 2007-09-26 19:04 ------- > * gcc.dg/tree-ssa/complex-4.c: XFAIL. > is a regression then because the testcase was added back in 2006-02-18 > (by me). I did wonder what optimized that before... (maybe a separate bug for this is more appropriate) Richard.
Subject: Re: [4.3 Regression] aggregate DSE disabled On 27 Sep 2007 09:08:17 -0000, rguenther at suse dot de <gcc-bugzilla@gcc.gnu.org> wrote: > I did wonder what optimized that before... (maybe a separate bug for > this is more appropriate) Must_def cause the optimization to work IIRC. In fact this is the reason why aggregate DSE was added was specifically to fix this testcase. See http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01115.html which specifically mentions this. I am still trying to understand why we removed must_def anyways. Everything points to the removal of must_def caused many different regressions. Thanks, Andrew Pinski
Created attachment 14254 [details] restore DCE of killing defs some ssa updating is broken in dce though: /space/rguenther/src/svn/pointer_plus/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c: In function 'f': /space/rguenther/src/svn/pointer_plus/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c:5: error: type mismatch between an SSA_NAME and its symbol /space/rguenther/src/svn/pointer_plus/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c:5: error: in statement # SFT.1_12 = VDEF <SFT.1_11> { SFT.1 } REALPART_EXPR <t> = 2; /space/rguenther/src/svn/pointer_plus/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c:5: internal compiler error: verify_ssa failed Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. but dceloop now removes the dead store and we get: f () { complex int t; int D.1551; <bb 2>: # SFT.1_12 = VDEF <SFT.1_11> REALPART_EXPR <t> = 2; # SFT.0_13 = VDEF <SFT.0_10> IMAGPART_EXPR <t> = 2; # SFT.0_14 = VDEF <SFT.0_13> # SFT.1_15 = VDEF <SFT.1_12> D.1551_5 = g (&t); return D.1551_5; }
Created attachment 14256 [details] more complete patch to resture DCE of killing defs It still breaks in some cases. With the unfortunate fact that we need the VMAYUSEs even for killing defs we might end up to need to do a two-phase DCE for those :/ (See the special casing of PHI_NODEs in the patch, it seems some more special casing is missing)
Diego, it sucks that we need to jump through hoops to get V_MUST_DEF "back".
Subject: Re: [4.3 Regression] aggregate DSE disabled On 27 Sep 2007 13:42:11 -0000, rguenth at gcc dot gnu dot org <gcc-bugzilla@gcc.gnu.org> wrote: > Diego, it sucks that we need to jump through hoops to get V_MUST_DEF "back". Unless we can prove that it is impossible to implement DSE any other way, I would prefer to keep virtual SSA as simple as possible. It's meant as a safety net and a "good enough" UD web for passes that do not care for being too aggressive.
Subject: Re: [4.3 Regression] aggregate DSE disabled On Thu, 27 Sep 2007, dnovillo at google dot com wrote: > ------- Comment #7 from dnovillo at google dot com 2007-09-27 13:48 ------- > Subject: Re: [4.3 Regression] aggregate DSE disabled > > On 27 Sep 2007 13:42:11 -0000, rguenth at gcc dot gnu dot org > <gcc-bugzilla@gcc.gnu.org> wrote: > > > Diego, it sucks that we need to jump through hoops to get V_MUST_DEF "back". > > Unless we can prove that it is impossible to implement DSE any other > way, I would prefer to keep virtual SSA as simple as possible. It's > meant as a safety net and a "good enough" UD web for passes that do > not care for being too aggressive. I sort-of agree. Still DCE was able to handle tree-ssa/complex-4.c before we removed V_MUST_DEF. Which is what I'm trying to get back. As "good enough" UD web it would be nice to have only single VDEFs on stores (I don't care for clobbers at call sites). Though finding the optimal static partitioning to ensure this is probably hard? Richard.
Subject: Re: [4.3 Regression] aggregate DSE disabled On 27 Sep 2007 14:01:18 -0000, rguenther at suse dot de <gcc-bugzilla@gcc.gnu.org> wrote: > I sort-of agree. Still DCE was able to handle tree-ssa/complex-4.c > before we removed V_MUST_DEF. Which is what I'm trying to get back. Yeah, it is somewhat tempting to make the infrastructure more powerful because you suddenly get more out of seemingly innocent passes. However, a more powerful infrastructure creates problems of its own, it needs to be maintained and it causes slowdowns even in passes that do not need all the expressive power. > As "good enough" UD web it would be nice to have only single VDEFs on > stores (I don't care for clobbers at call sites). Though finding the > optimal static partitioning to ensure this is probably hard? Yeah, that is the whole motivation behind the dynamic aspects of mem-ssa, but getting it right has proven tricky. Unfortunately, I have not had time to come back to that idea in some time.
Last patch before I stopped working on enhancing DCE: http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01978.html
We won't fix this on the 4.3 branch.
Neither for GCC 4.4. Re-targeting for GCC 4.5.
GCC 4.5.0 is being released. Deferring to 4.5.1.
GCC 4.5.1 is being released, adjusting target milestone.
GCC 4.5.2 is being released, adjusting target milestone.
GCC 4.5.3 is being released, adjusting target milestone.
The 4.5 branch is being closed, adjusting target milestone.
GCC 4.6.4 has been released and the branch has been closed.
The 4.7 branch is being closed, moving target milestone to 4.8.4.
GCC 4.8.4 has been released.
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
GCC 4.9.3 has been released.
Pushing this to a P4 given that the regression, while real, is very rare in real world code. A fix for the regression as well as further enhancements to DSE is queued for gcc-7.
(In reply to Jeffrey A. Law from comment #23) > Pushing this to a P4 given that the regression, while real, is very rare in > real world code. > > A fix for the regression as well as further enhancements to DSE is queued > for gcc-7. Please leave such kind of bugs at P2, they are not blocking the release and criteria for prioritization are here: https://gcc.gnu.org/bugs/management.html
Author: law Date: Fri Jan 13 15:37:09 2017 New Revision: 244441 URL: https://gcc.gnu.org/viewcvs?rev=244441&root=gcc&view=rev Log: PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * sbitmap.h (bitmap_count_bits): Prototype. (bitmap_clear_range, bitmap_set_range): Likewise. * sbitmap.c (bitmap_clear_range): New function. (bitmap_set_range, sbitmap_popcount, bitmap_count_bits): Likewise. Modified: trunk/gcc/ChangeLog trunk/gcc/sbitmap.c trunk/gcc/sbitmap.h
Author: law Date: Fri Jan 13 15:42:08 2017 New Revision: 244442 URL: https://gcc.gnu.org/viewcvs?rev=244442&root=gcc&view=rev Log: PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * doc/invoke.texi: Document new dse-max-object-size param. * params.def (PARM_DSE_MAX_OBJECT_SIZE): New PARAM. * tree-ssa-dse.c: Include params.h. (dse_store_status): New enum. (initialize_ao_ref_for_dse): New, partially extracted from dse_optimize_stmt. (valid_ao_ref_for_dse, normalize_ref): New. (setup_live_bytes_from_ref, compute_trims): Likewise. (clear_bytes_written_by, maybe_trim_complex_store): Likewise. (maybe_trim_partially_dead_store): Likewise. (maybe_trim_complex_store): Likewise. (dse_classify_store): Renamed from dse_possibly_dead_store_p. Track what bytes live from the original store. Return tri-state for dead, partially dead or live. (dse_dom_walker): Add constructor, destructor and new private members. (delete_dead_call, delete_dead_assignment): New extracted from dse_optimize_stmt. (dse_optimize_stmt): Make a member of dse_dom_walker. Use initialize_ao_ref_for_dse. PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * gcc.dg/tree-ssa/complex-4.c: Remove xfail. * gcc.dg/tree-ssa/complex-5.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-9.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-18.c: New test. * gcc.dg/tree-ssa/ssa-dse-19.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-20.c: Likewise. * gcc.dg/tree-ssa/ssa-dse-21.c: Likewise. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-18.c - copied, changed from r244441, trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-19.c - copied, changed from r244441, trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-20.c - copied, changed from r244441, trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-21.c - copied, changed from r244441, trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c Modified: trunk/gcc/ChangeLog trunk/gcc/doc/invoke.texi trunk/gcc/params.def trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-4.c trunk/gcc/testsuite/gcc.dg/tree-ssa/complex-5.c trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-9.c trunk/gcc/tree-ssa-dse.c
Fixed on the trunk. No plans to backport.
Based on comment #26 and comment #27 it sounds as though this is resolved.
It's still a regression for 5/6, so it should stay open until those releases are no longer supported. Note the "7" in the regression marker is gone.
Author: law Date: Sat Jan 14 06:16:23 2017 New Revision: 244461 URL: https://gcc.gnu.org/viewcvs?rev=244461&root=gcc&view=rev Log: PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * tree-ssa-dse.c (delete_dead_call): Accept gsi rather than a statement. (delete_dead_assignment): Likewise. (dse_dom_walker::dse_optimize_stmt): Pass in the gsi rather than statement to delete_dead_call and delete_dead_assignment. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-ssa-dse.c
(In reply to Jeffrey A. Law from comment #29) > It's still a regression for 5/6, so it should stay open until those releases > are no longer supported. Note the "7" in the regression marker is gone. Sorry, I didn't know about this policy.
Author: law Date: Mon Jan 16 23:43:05 2017 New Revision: 244509 URL: https://gcc.gnu.org/viewcvs?rev=244509&root=gcc&view=rev Log: 2017-01-16 Jeff Law <law@redhat.com> PR tree-optimization/79090 PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * tree-ssa-dse.c (compute_trims): Accept STMT argument. Dump STMT and computed trims into the dump file. PR tree-optimization/79090 PR tree-optimization/33562 PR tree-optimization/61912 PR tree-optimization/77485 * tree-ssa-dse.c (compute_trims): Accept STMT argument. Dump STMT and computed trims into the dump file. Added: trunk/gcc/testsuite/g++.dg/tree-ssa/ssa-dse-2.C trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-29.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-dse.c
GCC 7.1 has been released.
GCC 7.3 is being released, adjusting target milestone.
We're not going to backport this any of the release branches.