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: Tue, 2 Feb 2010 11:53:57 +0100
- Subject: Re: [PR42897, VTA] fix vectorization of non-PHI DEF used outside loop
- References: <or4om0t30g.fsf@livre.localdomain>
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.
>
> Regstrapped on x86_64-linux-gnu. ?Ok to install?
Ok.
I'm a little confused by the 2nd patch - we usually remove
PHI nodes permanently by calling remove_phi_node (gsi, true),
but that will end up calling gsi_remove (gsi, false) - and thus
will not insert debug temps (well, it will, but only through
the call of release_ssa_name from remove_phi_node).
So, why not do
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?
Thanks,
Richard.