This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] vdefs question (to make vectorizer pass verify ssa)
- From: Dorit Naishlos <DORIT at il dot ibm dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 31 Dec 2003 21:08:37 +0200
- Subject: Re: [tree-ssa] vdefs question (to make vectorizer pass verify ssa)
> > 4 _vect_a.117_35 = _vect_var.116_34 + _vect_a.114_32;
> >
> I'd prefer if you emitted the PLUS_EXPR with the pointer as the first
> operand. It's an unwritten convention, but I believe a call to fold()
> will switch it around for you.
ok, I'll change that.
> Question: is your transformation removing *all* references to variable
> 'a'?
not necessarily, just those that are vectorized. Within the loop that is
vectorized all the references to 'a' are replaced with references via
pointers.
> If so, then all you need to do is mark 'a' for renaming and call
> rewrite_into_ssa, which will DTRT.
> If 'a' is still referenced somewhere in the code, then you ought to add
> 'a' to the may-alias set for the memory tag of _vect_a.117 (I assume it
> has one, right?).
So how do I add a memory tag to a pointer and a variable to its may-alias
set? basically, what are the things I need to do when I'm creating a new
pointer? is there an example somewhere?
thanks,
dorit
Diego Novillo
<dnovillo@redhat. To: Dorit Naishlos/Haifa/IBM@IBMIL
com> cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: [tree-ssa] vdefs question (to make vectorizer pass verify ssa)
31/12/2003 19:31
On Wed, 2003-12-31 at 08:12, Dorit Naishlos wrote:
> The problem I have is with vectorizing a store operation, like the one
> below:
>
> a_2 = PHI <a_21(0), a_25(1)>;
>
> # a_25 = VDEF <a_2>
> a[i] = x;
>
> The vector store that replaces it is of the form
> "*(_vect_a + 16 * i) = vx"
> where _vect_a is a pointer that points to the base of array a (stmt 5
> below):
> 1 _vect_a.114_32 = &a;
> 2 _vect_var.115_33 = (<unnamed type>)i_1;
> 3 _vect_var.116_34 = _vect_var.115_33 * 16;
> 4 _vect_a.117_35 = _vect_var.116_34 + _vect_a.114_32;
>
I'd prefer if you emitted the PLUS_EXPR with the pointer as the first
operand. It's an unwritten convention, but I believe a call to fold()
will switch it around for you.
> 5 *_vect_a.117_35 = _vect_var.109_31;
>
> The scalar store is removed, and the vector store does not have a vdef,
so
> I fail on:
>
As it should. You have seemingly removed all references to variable
'a', but have not marked it for renaming. In the current scheme, we do
not manipulate virtual operands directly. These are added/removed by
get_stmt_operands when a statement is marked modified.
Question: is your transformation removing *all* references to variable
'a'? If so, then all you need to do is mark 'a' for renaming and call
rewrite_into_ssa, which will DTRT.
If 'a' is still referenced somewhere in the code, then you ought to add
'a' to the may-alias set for the memory tag of _vect_a.117 (I assume it
has one, right?).
Diego.