[tree-ssa] vdefs question (to make vectorizer pass verify ssa)

Diego Novillo dnovillo@redhat.com
Wed Dec 31 19:56:00 GMT 2003


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.



More information about the Gcc mailing list