public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [lno] "no flow-sensitive alias info" warning to vectorizer
@ 2004-02-24 16:18 Dorit Naishlos
  2004-02-24 16:51 ` Diego Novillo
  0 siblings, 1 reply; 9+ messages in thread
From: Dorit Naishlos @ 2004-02-24 16:18 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

I've noticed a new warning is being generated against the vectorizer (I
think it appeared after the recent merge with tree-ssa):

"NOTE: no flow-sensitive alias info for vect_pX.5_14 in *vect_pX.5_14 =
vect_cst_.6;"

for the following vectorized tree sequence:

1  vect_pX.1_11 = &X;
2  vect_iv_.3_12 = vect_iv_.2_15;
3  vect_iv_.4_13 = vect_iv_.3_12 * 16;
4  vect_pX.5_14 = vect_pX.1_11 + vect_iv_.4_13;
5  *vect_pX.5_14 = vect_cst_.6_18;

Currently, I only set 'type_mem_tag' to vectorizer generated pointers,
using:

get_var_ann (ptr)->type_mem_tag = array_base;

(in this case 'ptr' is vect_pX.1_11 and 'array_base' is X).

Can I (and should I) do something in order to not get this new warning?
Should I set a 'name_mem_tag' as well? which API should I use?

thanks,
dorit

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-24 16:18 [lno] "no flow-sensitive alias info" warning to vectorizer Dorit Naishlos
@ 2004-02-24 16:51 ` Diego Novillo
  2004-02-24 22:13   ` Zdenek Dvorak
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Novillo @ 2004-02-24 16:51 UTC (permalink / raw)
  To: Dorit Naishlos; +Cc: gcc

On Tue, 2004-02-24 at 10:59, Dorit Naishlos wrote:
> I've noticed a new warning is being generated against the vectorizer (I
> think it appeared after the recent merge with tree-ssa):
> 
> "NOTE: no flow-sensitive alias info for vect_pX.5_14 in *vect_pX.5_14 =
> vect_cst_.6;"
> 
These are mostly harmless.  They just inform you that a given SSA_NAME
has no alias information.

> for the following vectorized tree sequence:
> 
> 1  vect_pX.1_11 = &X;
> 2  vect_iv_.3_12 = vect_iv_.2_15;
> 3  vect_iv_.4_13 = vect_iv_.3_12 * 16;
> 4  vect_pX.5_14 = vect_pX.1_11 + vect_iv_.4_13;
> 5  *vect_pX.5_14 = vect_cst_.6_18;
> 
> Currently, I only set 'type_mem_tag' to vectorizer generated pointers,
> using:
> 
> get_var_ann (ptr)->type_mem_tag = array_base;
> 
Hmm, it would be better if you can call the alias analyzer to set memory
tags.  Ideally, only the alias analyzer should be assigning memory
tags.  In this case, I expect 'vect_pX.5_14' to have 'X' as its only
alias.

The net effect should be that you will only get virtual operands for 'X'
every time you emit a dereference of vect_pX.5.


> Can I (and should I) do something in order to not get this new warning?
> Should I set a 'name_mem_tag' as well? which API should I use?
> 
Try scheduling a compute_may_aliases pass right after the vectorizer.
Oh, and try not to create memory tags manually.


Diego.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-24 16:51 ` Diego Novillo
@ 2004-02-24 22:13   ` Zdenek Dvorak
  2004-02-24 23:44     ` Diego Novillo
  0 siblings, 1 reply; 9+ messages in thread
From: Zdenek Dvorak @ 2004-02-24 22:13 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Dorit Naishlos, gcc

Hello,

> > for the following vectorized tree sequence:
> > 
> > 1  vect_pX.1_11 = &X;
> > 2  vect_iv_.3_12 = vect_iv_.2_15;
> > 3  vect_iv_.4_13 = vect_iv_.3_12 * 16;
> > 4  vect_pX.5_14 = vect_pX.1_11 + vect_iv_.4_13;
> > 5  *vect_pX.5_14 = vect_cst_.6_18;
> > 
> > Currently, I only set 'type_mem_tag' to vectorizer generated pointers,
> > using:
> > 
> > get_var_ann (ptr)->type_mem_tag = array_base;
> > 
> Hmm, it would be better if you can call the alias analyzer to set memory
> tags.

how exactly?  I also use similar hacks on about two places.

Zdenek

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-24 22:13   ` Zdenek Dvorak
@ 2004-02-24 23:44     ` Diego Novillo
  2004-02-25  0:42       ` Zdenek Dvorak
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Novillo @ 2004-02-24 23:44 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: Dorit Naishlos, gcc

On Tue, 2004-02-24 at 17:03, Zdenek Dvorak wrote:
> Hello,
> 
> > > for the following vectorized tree sequence:
> > > 
> > > 1  vect_pX.1_11 = &X;
> > > 2  vect_iv_.3_12 = vect_iv_.2_15;
> > > 3  vect_iv_.4_13 = vect_iv_.3_12 * 16;
> > > 4  vect_pX.5_14 = vect_pX.1_11 + vect_iv_.4_13;
> > > 5  *vect_pX.5_14 = vect_cst_.6_18;
> > > 
> > > Currently, I only set 'type_mem_tag' to vectorizer generated pointers,
> > > using:
> > > 
> > > get_var_ann (ptr)->type_mem_tag = array_base;
> > > 
> > Hmm, it would be better if you can call the alias analyzer to set memory
> > tags.
> 
> how exactly?  I also use similar hacks on about two places.
> 
As I said at the end of my message, by scheduling another
compute_may_aliases pass.  Let me know if you run into trouble or things
don't work as expected.  In theory it should just work, but I still
haven't tested multiple passes of the alias analyzer.


Diego.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-25  0:42       ` Zdenek Dvorak
@ 2004-02-25  0:42         ` Diego Novillo
  2004-02-25  9:10           ` Zdenek Dvorak
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Novillo @ 2004-02-25  0:42 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: Dorit Naishlos, gcc

On Tue, 2004-02-24 at 18:44, Zdenek Dvorak wrote:

> would not there be some simpler possibility?  I do not really change
> anything that should concern aliasing, I just change the way the address
> of the memory reference is computed (in strength reduction).
> 
Show me where?  If you're just copying tags from one pointer to the
other, then I agree, it's not necessary.


Diego.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-24 23:44     ` Diego Novillo
@ 2004-02-25  0:42       ` Zdenek Dvorak
  2004-02-25  0:42         ` Diego Novillo
  0 siblings, 1 reply; 9+ messages in thread
From: Zdenek Dvorak @ 2004-02-25  0:42 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Dorit Naishlos, gcc

Hello,

> > > > for the following vectorized tree sequence:
> > > > 
> > > > 1  vect_pX.1_11 = &X;
> > > > 2  vect_iv_.3_12 = vect_iv_.2_15;
> > > > 3  vect_iv_.4_13 = vect_iv_.3_12 * 16;
> > > > 4  vect_pX.5_14 = vect_pX.1_11 + vect_iv_.4_13;
> > > > 5  *vect_pX.5_14 = vect_cst_.6_18;
> > > > 
> > > > Currently, I only set 'type_mem_tag' to vectorizer generated pointers,
> > > > using:
> > > > 
> > > > get_var_ann (ptr)->type_mem_tag = array_base;
> > > > 
> > > Hmm, it would be better if you can call the alias analyzer to set memory
> > > tags.
> > 
> > how exactly?  I also use similar hacks on about two places.
> > 
> As I said at the end of my message, by scheduling another
> compute_may_aliases pass.  Let me know if you run into trouble or things
> don't work as expected.  In theory it should just work, but I still
> haven't tested multiple passes of the alias analyzer.

would not there be some simpler possibility?  I do not really change
anything that should concern aliasing, I just change the way the address
of the memory reference is computed (in strength reduction).

Zdenek

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-25  0:42         ` Diego Novillo
@ 2004-02-25  9:10           ` Zdenek Dvorak
  2004-02-26 17:36             ` Diego Novillo
  0 siblings, 1 reply; 9+ messages in thread
From: Zdenek Dvorak @ 2004-02-25  9:10 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Dorit Naishlos, gcc

Hello,

> > would not there be some simpler possibility?  I do not really change
> > anything that should concern aliasing, I just change the way the address
> > of the memory reference is computed (in strength reduction).
> > 
> Show me where?  If you're just copying tags from one pointer to the
> other, then I agree, it's not necessary.

currently I do this (in tree-ssa-loop-ivopts.c:rewrite_use_address).

  if (TREE_CODE (op) == SSA_NAME)
    {
      /* We need to add a memory tag for the variable.  But we do not want
         to add it to the temporary used for the computations, since this leads
         to problems in redundancy elimination when there are common parts
         in two computations refering to the different arrays.  So we rewrite
         the base variable of the ssa name to a new temporary.  */
      tmp_var = create_tmp_var (TREE_TYPE (op), "ruatmp");
      add_referenced_tmp_var (tmp_var);
      SSA_NAME_VAR (op) = tmp_var;

      var = get_base_decl (*use->op_p);
      if (var_ann (var)->type_mem_tag)
        var = var_ann (var)->type_mem_tag;
      var_ann (tmp_var)->type_mem_tag = var;

      name = get_base_var (*use->op_p);
      if (name && TREE_CODE (name) == SSA_NAME)
        {
          ssa_name_ann_t ann = ssa_name_ann (name), new_ann;

          if (ann && ann->name_mem_tag)
            {
              new_ann = get_ssa_name_ann (op);
              new_ann->name_mem_tag = ann->name_mem_tag;
            }
        }
    }

Zdenek

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-25  9:10           ` Zdenek Dvorak
@ 2004-02-26 17:36             ` Diego Novillo
  2004-02-26 20:39               ` law
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Novillo @ 2004-02-26 17:36 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: Dorit Naishlos, gcc

On Wed, 2004-02-25 at 02:22, Zdenek Dvorak wrote:

>   if (TREE_CODE (op) == SSA_NAME)
>     {
>       /* We need to add a memory tag for the variable.  But we do not want
>          to add it to the temporary used for the computations, since this leads
>          to problems in redundancy elimination when there are common parts
>          in two computations refering to the different arrays.  So we rewrite
>          the base variable of the ssa name to a new temporary.  */
>       tmp_var = create_tmp_var (TREE_TYPE (op), "ruatmp");
>       add_referenced_tmp_var (tmp_var);
>       SSA_NAME_VAR (op) = tmp_var;
> 
>       var = get_base_decl (*use->op_p);
>       if (var_ann (var)->type_mem_tag)
>         var = var_ann (var)->type_mem_tag;
>       var_ann (tmp_var)->type_mem_tag = var;
> 
>       name = get_base_var (*use->op_p);
>       if (name && TREE_CODE (name) == SSA_NAME)
>         {
>           ssa_name_ann_t ann = ssa_name_ann (name), new_ann;
> 
>           if (ann && ann->name_mem_tag)
>             {
>               new_ann = get_ssa_name_ann (op);
>               new_ann->name_mem_tag = ann->name_mem_tag;
>             }
>         }
>     }
> 
So, you're replacing all the VAR_DECLs inside SSA_NAMEs with something
new?  Yeah, I guess you need to do all this.


Diego.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [lno] "no flow-sensitive alias info" warning to vectorizer
  2004-02-26 17:36             ` Diego Novillo
@ 2004-02-26 20:39               ` law
  0 siblings, 0 replies; 9+ messages in thread
From: law @ 2004-02-26 20:39 UTC (permalink / raw)
  To: Diego Novillo; +Cc: Zdenek Dvorak, Dorit Naishlos, gcc

In message <1077816117.16194.446.camel@localhost.localdomain>, Diego Novillo wr
ites:
 >On Wed, 2004-02-25 at 02:22, Zdenek Dvorak wrote:
 >
 >>   if (TREE_CODE (op) == SSA_NAME)
 >>     {
 >>       /* We need to add a memory tag for the variable.  But we do not want
 >>          to add it to the temporary used for the computations, since this l
 >eads
 >>          to problems in redundancy elimination when there are common parts
 >>          in two computations refering to the different arrays.  So we rewri
 >te
 >>          the base variable of the ssa name to a new temporary.  */
 >>       tmp_var = create_tmp_var (TREE_TYPE (op), "ruatmp");
 >>       add_referenced_tmp_var (tmp_var);
 >>       SSA_NAME_VAR (op) = tmp_var;
 >> 
 >>       var = get_base_decl (*use->op_p);
 >>       if (var_ann (var)->type_mem_tag)
 >>         var = var_ann (var)->type_mem_tag;
 >>       var_ann (tmp_var)->type_mem_tag = var;
 >> 
 >>       name = get_base_var (*use->op_p);
 >>       if (name && TREE_CODE (name) == SSA_NAME)
 >>         {
 >>           ssa_name_ann_t ann = ssa_name_ann (name), new_ann;
 >> 
 >>           if (ann && ann->name_mem_tag)
 >>             {
 >>               new_ann = get_ssa_name_ann (op);
 >>               new_ann->name_mem_tag = ann->name_mem_tag;
 >>             }
 >>         }
 >>     }
 >> 
 >So, you're replacing all the VAR_DECLs inside SSA_NAMEs with something
 >new?  Yeah, I guess you need to do all this.
It would be good if this code could be moved into tree-ssa-copy.c
since it deals with keeping this kind of stuff up-to-date.

jeff

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-02-26 19:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-24 16:18 [lno] "no flow-sensitive alias info" warning to vectorizer Dorit Naishlos
2004-02-24 16:51 ` Diego Novillo
2004-02-24 22:13   ` Zdenek Dvorak
2004-02-24 23:44     ` Diego Novillo
2004-02-25  0:42       ` Zdenek Dvorak
2004-02-25  0:42         ` Diego Novillo
2004-02-25  9:10           ` Zdenek Dvorak
2004-02-26 17:36             ` Diego Novillo
2004-02-26 20:39               ` law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).