This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR42897, VTA] fix vectorization of non-PHI DEF used outside loop
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 6 Mar 2010 14:22:17 +0100
- Subject: Re: [PR42897, VTA] fix vectorization of non-PHI DEF used outside loop
- References: <or4om0t30g.fsf@livre.localdomain> <84fc9c001002020253o94aaa44j67e97925e5097a95@mail.gmail.com> <ory6i63bb6.fsf@livre.localdomain>
On Fri, Mar 5, 2010 at 6:53 PM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Feb ?2, 2010, Richard Guenther <richard.guenther@gmail.com> wrote:
>
>> On Tue, Feb 2, 2010 at 10:12 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
>>> I have come up with two patches for this PR. ?Each one by itself would
>>> be enough to fix this particular instance of the problem, but together
>>> they retain the most debug information and avoid similar problems that
>>> might arise in other circumstances.
>>>
>>> The first patch arranges for us to reset debug stmts outside a loop that
>>> refer to a vectorized DEF inside the loop, if there isn't any non-debug
>>> use outside the loop, even if the DEF is regarded as relevant for the
>>> vectorizer. ?We used to do this only for vectorizer-irrelevant DEFs,
>>> which proved to be insufficient.
>>>
>>> The second patch avoids the propagation of PHI nodes when they're
>>> replaced with a non-PHI DEF. ?The patch doesn't actually check that the
>>> replacement is taking place at the right spot, but I expect all
>>> non-permanent removals of PHI DEFs to do this.
>
>> ? if (gimple_code (stmt) != GIMPLE_PHI)
>> ? ? insert_debug_temps_for_defs (i);
>
>> in gsi_remove and instead do whatever makes sense in
>> remove_phi_node?
>
> I did that in the revised version of the second patch. ?Ok to install?
>
> Does it make sense to keep the assertion check I put in for testing, or
> should I drop it before check in?
Please remove it (at some point we might want to release defs just
like remove_phi_node does - in fact we probably should make
remove_phi_node a simple alias of gsi_remove ... not for 4.5 of
course).
Both patches are ok.
Thanks.
Richard.
>
>
> --
> Alexandre Oliva, freedom fighter ? ?http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/ ? FSF Latin America board member
> Free Software Evangelist ? ? ?Red Hat Brazil Compiler Engineer
>
>