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] | |
This patch adds an API suggested by Diego, and fixes alias testing in
tree-data-ref.c.
Bootstrapped and tested on ppc-darwin.
Committed to autovect branch.
Thanks to Diego and Daniel for their help.
Ira
ChangeLog entry:
* tree-data-ref.c (ptr_decl_may_alias_p): New function.
(may_alias_p): New function.
(base_object_differ_p): Call ptr_decl_may_alias_p and may_alias_p
instead of alias_sets_conflict.
(base_addr_differ_p): Likewise.
* tree-flow.h (is_aliased_with): Declare.
* tree-ssa-alias.c (is_aliased_with): New function.
Patch:
(See attached file: alias.diff)
Diego Novillo <dnovillo@redhat.com> wrote on 25/05/2005 16:38:29:
> On Tue, May 24, 2005 at 09:36:35AM +0300, Ira Rosen wrote:
>
> > As a followup patch I'd like to check the type memory tag directly and
not
> > call get_alias_set at all, as suggested by Diego. Is there an API that
gets
> > a type tag (or a symbol) and a declaration and determines whether a
> > declaration is in may alias set of the tag, or do I have to go over the
> > may-aliases of the tag myself? I also need a similar API to decide if
two
> > pointers alias.
> >
> No, there isn't one. But it should not be hard to implement.
> Something along the lines of:
>
> bool
> is_aliased_with (tree tag, tree sym)
> {
> size_t i;
> varray_type aliases;
>
> if (var_ann (sym)->is_alias_tag)
> {
> aliases = var_ann (tag)->may_aliases;
>
> if (aliases == NULL)
> return false;
>
> for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
> if (VARRAY_TREE (aliases, i) == sym)
> return true;
> }
> else
> {
> aliases = var_ann (var)->may_aliases;
>
> if (aliases == NULL)
> return false;
>
> for (i = 0; i < VARRAY_ACTIVE_SIZE (aliases); i++)
> if (VARRAY_TREE (aliases, i) == tag)
> return true;
> }
>
> return false
> }
>
> Coded off the top of my head, so it won't be totally correct.
> Give it two symbols and it will tell you if one is in the alias
> set of the other. In general, normal symbols are in the alias
> sets of tags, but when we have applied grouping heuristics, the
> alias sets are turned inside-out (tags are put in the alias sets
> of symbols).
>
> Is this roughly what you're looking for?
>
>
> Diego.Attachment:
alias.diff
Description: Binary data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |