[PATCH] Simplified alias-export (final)

Richard Guenther rguenther@suse.de
Tue Jul 14 14:34:00 GMT 2009


On Tue, 14 Jul 2009, H.J. Lu wrote:

> On Mon, Jul 13, 2009 at 7:16 AM, Richard Guenther<rguenther@suse.de> wrote:
> >
> > This is the final version of a simplified alias-export.  Alias-export
> > in the sense that points-to information is transitioned over to RTL
> > by means of keeping all base objects in MEM_EXPR, including INDIRECT_REFs
> > of pointer SSA_NAMEs.  In another sense the patch opens the path to
> > remove overlapping parts of the RTL and the tree alias-oracles as
> > it simply queries the tree alias-oracle with the information from the
> > MEM_EXPRs after the RTL oracle is finished.
> >
> > The patch consistently improves SPEC 2006 on x86_64 for me
> > (to my surprise), not by a large margin though.  It is a wash for Itanium
> > where I expected a much bigger effect.
> >
> > The patch fixes the regression I introduced while "fixing" restrict.
> > The fix caused restrict information to no longer be available on RTL.
> >
> > The worst-case memory and compile-time effects on our regular testers
> > was on tramp3d with -fprofile-generate, so I re-checked that numbers
> > after this final cleanup.  Numbers now show a (probably in the noise)
> > improvement in compile-time and a 0.0004% increase in peak VM memory
> > usage.  A memory usage increase is expected as we now keep SSA operands
> > and points-to sets over the whole RTL compilation and because as
> > the MEM_EXPRs retain all their base information mem-attr sharing should
> > be less efficient.  But as RTL is function-at-a-time I choose to care
> > less.
> >
> > Re-bootstrapped and tested on x86_64-unknown-linux-gnu.  If there are
> > no comments I'll apply this somewhen tomorrow.
> >
> > Thanks,
> > Richard.
> >
> > 2009-07-13  Richard Guenther  <rguenther@suse.de>
> >        Andrey Belevantsev <abel@ispras.ru>
> >
> >        * tree-ssa-alias.h (refs_may_alias_p_1): Declare.
> >        (pt_solution_set): Likewise.
> >        * tree-ssa-alias.c (refs_may_alias_p_1): Export.
> >        * tree-ssa-structalias.c (pt_solution_set): New function.
> >        * final.c (rest_of_clean_state): Free SSA data structures.
> >        * print-rtl.c (print_decl_name): Remove.
> >        (print_mem_expr): Implement in terms of print_generic_expr.
> >        * alias.c (ao_ref_from_mem): New function.
> >        (rtx_refs_may_alias_p): Likewise.
> >        (true_dependence): Query alias-export info.
> >        (canon_true_dependence): Likewise.
> >        (write_dependence_p): Likewise.
> >        * tree-dfa.c (get_ref_base_and_extent): For void types leave
> >        size unknown.
> >        * emit-rtl.c (component_ref_for_mem_expr): Remove.
> >        (mem_expr_equal_p): Use operand_equal_p.
> >        (set_mem_attributes_minus_bitpos): Do not use
> >        component_ref_for_mem_expr.
> >        * cfgexpand.c (add_partitioned_vars_to_ptset): New function.
> >        (update_alias_info_with_stack_vars): Likewise.
> >        (partition_stack_vars): Call update_alias_info_with_stack_vars.
> >        * tree-ssa.c (delete_tree_ssa): Do not release SSA names
> >        explicitly nor clear stmt operands.
> >        Free the decl-to-pointer map.
> >        * tree-optimize.c (execute_free_datastructures): Do not free
> >        SSA data structures here.
> >        * tree-flow.h (struct gimple_df): Add decls_to_pointers member.
> >        * Makefile.in (emit-rtl.o): Add pointer-set.h dependency.
> >        (alias.o): Add tree-ssa-alias.h, pointer-set.h and $(TREE_FLOW_H)
> >        dependencies.
> >        (print-rtl.o): Add $(DIAGNOSTIC_H) dependency.
> >
> 
> This caused:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40745

The following obvious patch fixes this.  The issue is that at -O0
we keep unused variables, parition them but do not bother to record
them in referenced_vars.

Richard.

2009-07-14  Richard Guenther  <rguenther@suse.de>

	PR middle-end/40745
	* cfgexpand.c (partition_stack_vars): Do not bother to update
	alias information when not optimizing.

Index: gcc/cfgexpand.c
===================================================================
*** gcc/cfgexpand.c	(revision 149624)
--- gcc/cfgexpand.c	(working copy)
*************** partition_stack_vars (void)
*** 1031,1037 ****
  	}
      }
  
!   update_alias_info_with_stack_vars ();
  }
  
  /* A debugging aid for expand_used_vars.  Dump the generated partitions.  */
--- 1031,1038 ----
  	}
      }
  
!   if (optimize)
!     update_alias_info_with_stack_vars ();
  }
  
  /* A debugging aid for expand_used_vars.  Dump the generated partitions.  */


More information about the Gcc-patches mailing list