This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve DSE to handle redundant zero initializations.


On 8/12/19 2:14 PM, Matthew Beliveau wrote:
> This patch improves DSE to handle missing optimizations for zero
> initializations.
> 
> Thank you,
> Matthew Beliveau
> 
> 
> DSE.patch
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
> 
> 2019-08-12  Matthew Beliveau  <mbelivea@redhat.com>
> 
> 	PR c++/DSE.patch
> 	* tree-ssa-dse.c (dse_optimize_redundant_stores): Improved check to
> 	catch more redundant zero initalization cases.
> 	(dse_dom_walker::dse_optimize_stmt): Improved check to catch more
> 	redundant zero initialization cases.
> 
> 	* gcc.dg/tree-ssa/redundant-assign-zero-1.c: New test.
> 	* gcc.dg/tree-ssa/redundant-assign-zero-2.c: New test.
> 
> @@ -1027,15 +1024,13 @@ dse_dom_walker::dse_optimize_stmt (gimple_stmt_iterator *gsi)
>      {
>        bool by_clobber_p = false;
>  
> -      /* First see if this store is a CONSTRUCTOR and if there
> -	 are subsequent CONSTRUCTOR stores which are totally
> -	 subsumed by this statement.  If so remove the subsequent
> -	 CONSTRUCTOR store.
> +      /* Check if this store initalizes zero, or some aggregate of zeros,
> +	 and check if there are subsequent stores which are subsumed by this
> +	 statement.  If so, remove the subsequent store.
Perhaps...

/* Check if this statement stores zero to a memory location
   and if there is a subsequent store of zero to the same
   memory location.  If so delete the subsequent store.  */


With the ChangeLog nits noted by Marek and the comment fix this is fine
for the trunk.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]