[PATCH, take 2] Fix PR tree-optimization/49960 ,Fix self data dependence
Razya Ladelsky
RAZYA@il.ibm.com
Mon Nov 21 17:25:00 GMT 2011
Jakub Jelinek <jakub@redhat.com> wrote on 21/11/2011 05:07:54 PM:
> From: Jakub Jelinek <jakub@redhat.com>
> To: Razya Ladelsky/Haifa/IBM@IBMIL
> Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Richard Guenther
> <richard.guenther@gmail.com>
> Date: 21/11/2011 05:08 PM
> Subject: Re: [PATCH, take 2] Fix PR tree-optimization/49960 ,Fix
> self data dependence
>
> On Mon, Nov 21, 2011 at 04:54:09PM +0200, Razya Ladelsky wrote:
> > Although compute_affine_dependence() can't do anything meaningful for
the
> > gather data refs,
> > it may still be assigning values to the dependence relation structure,
if
> > you need to use them.
> > Therefore I did not skip the call to compute_self_dependence(), which
> > indeed calls
> > compute_affine_depepndence().
> >
> >
> > If you think it's redundant, we can remove it.
>
> It is not just redundant, but harmful. compute_affine_dependence
assumes
> that base and offset are simple IVs, that is not true for gather deps.
> So please do remove it.
>
> Jakub
>
Jakub,
I have some non-affine cases for which compute_affine_dependence is called
(as it is called for
ALL dependences from compte_all_depepndences()), and no harm is done.
I looked a little bit closer into the code, and this is what happens for
non affine accesses:
initialize_data_dependence_relation() assigns
DDR_ARE_DEPENDENT (res) = chrec_dont_know for the dr.
Then, compute_affine_depepndence()
tests if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE), and does nothing
otherwise.
Since the dr was initialized with chrec_dont_know, no harm is done.
Anyway, since it is useless for your gather case, I'll just remove it,
along with compute_self_dependence().
OK?
Thanks,
Razya
More information about the Gcc-patches
mailing list