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]

Re: Fix for semi-latent bug in vectorizer


gcc-patches-owner@gcc.gnu.org wrote on 04/15/2005 11:18:04 AM:

> As discussed late last week we have a semi-latent bug in the vectorizer;
> specifically vectorizing a store can result in an inconsistency between
> the V_MAY_DEFs which appear on the vectorized store and the V_MAY_DEFs
> that would be computed if the store statement was scanned for operands.

I'm not sure what the inconsistency would be.  The aliasing for the vector
replacement should be identical to that of the original statement.  If 
it's
not then there's a bug.  I believe that the added comment:

!   /* The new vectorized statement will have better aliasing
!      information, so some of the virtual definitions of the old
!      statement will likely disappear from the IL.  Mark them to have
!      their SSA form updated.  */

is incorrect.  If someone found an inconsistency then I'd like to see it
because the other calls to copy_virtual_operands in the vectorizer should
also be changed.

> 
> This is a patch from Diego which addresses this problem.  It basically
> does two things:
> 
> First, any objects in the vectorized statement which are not already 
> SSA_NAMEs are marked for rewriting into SSA form.
> 
> Second, all the V_MAY_DEFs in the original statement are marked as
> needing their SSA graph updated.
> 
> I've bootstrapped and regression tested these changes for Diego on
> i686-pc-linux-gnu.  I'm not checking in Diego's testcase since it's
> just a reduction of an existing test.
> 
> 
> 

The vectorizer needs to be able to call loop_version which for trees means
calling tree_duplicate_loop_to_header_edge in tree_ssa_loop_manip.c.  That
routine calls verify_ssa.  With this patch it means that update_ssa is
going to have to be called after each loop is updated; it's not good
enough to just call update_ssa at the end of vectorization.  The purpose
of the original copy_virtual_operands was to keep the ssa form updated
rather than do repeated calls to update_ssa.

I see that Zdenek found a problem with the vectorizer when he changed
verify_ssa, but I haven't seen the problem yet in my testing so I'm not
sure what the problem is.  In any case, I don't think that this is the
right fix.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]