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: Diego Novillo <dnovillo at redhat dot com>
- To: Dorit Naishlos <DORIT at il dot ibm dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 31 Dec 2003 12:31:35 -0500
- Subject: Re: [tree-ssa] vdefs question (to make vectorizer pass verify ssa)
- Organization: Red Hat Canada
- References: <OF4E6E42BE.5B82427A-ONC2256E0D.00428DE7-C2256E0D.00488A68@il.ibm.com>
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.