On Wed, Dec 7, 2011 at 3:32 PM, Eric Botcazou <ebotca...@adacore.com> wrote:
>> You are basically (but non-optimally) locally re-implementing
>> what expr.c:get_object_or_type_alignment does, for the
>> bare MEM_REF case (you don't consider offsets that
>> do not change the alignment, nor alignment information
>> present on the SSA name).
>
> Adjusted version attached, regression-tested on SPARC/Solaris.  I'll do a full
> testing cycle if it is OK for mainline.

Yes, the patch is ok for mainline.

> get_object_or_type_alignment doesn't exist on the 4.6 branch, the expanders 
> for
> MEM_REF and TARGET_MEM_REF do:
>
>  MAX (TYPE_ALIGN (TREE_TYPE (exp)),
>       get_object_alignment (exp, BIGGEST_ALIGNMENT)))
>
> instead, so I presume I should do the same for them in tree_non_aligned_mem_p?

Yeah, you can do that.

Thanks,
Richard.

>
> 2011-12-07  Eric Botcazou  <ebotca...@adacore.com>
>
>        PR tree-optimization/51315
>        * tree.h (get_object_or_type_alignment): Declare.
>        * expr.c (get_object_or_type_alignment): Move to...
>        * builtins.c (get_object_or_type_alignment): ...here.  Add assertion.
>        * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to...
>        (tree_non_aligned_mem_p): ...this.  Add ALIGN parameter.  Look into
>        MEM_REFs and use get_object_or_type_alignment for them.
>        (build_accesses_from_assign): Adjust for above change.
>        (access_precludes_ipa_sra_p): Likewise.
>
>
>
> --
> Eric Botcazou

Reply via email to