This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR69110] Don't return NULL access_fns in dr_analyze_indices
- From: Sebastian Pop <sebpop at gmail dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Sat, 23 Jan 2016 12:44:23 -0600
- Subject: Re: [PATCH, PR69110] Don't return NULL access_fns in dr_analyze_indices
- Authentication-results: sourceware.org; auth=none
- References: <5694CF85 dot 1020708 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1601121218410 dot 31122 at t29 dot fhfr dot qr> <5694F5BA dot 7030207 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1601121404480 dot 31122 at t29 dot fhfr dot qr> <5695436D dot 4000003 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1601130941300 dot 31122 at t29 dot fhfr dot qr> <56A16E1E dot 30304 at mentor dot com> <CAFk3UF9uMs4i4S5S9GdhMOBr-PY-E5PESJUVpCPDEQ2shDCE9Q at mail dot gmail dot com> <56A3C647 dot 2040906 at mentor dot com>
On Sat, Jan 23, 2016 at 12:28 PM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> That was my original patch, and Richard commented: 'I think avoiding a NULL
> access_fns is ok but it should be done unconditionally, not only for the
> DECL_P case'. In order words, he asked me to do the exact opposite of the
> change you now propose.
>
In the case of a DECL_P it is correct to say that it has an access
function of 0.
In the graphite testcase it is not correct to say that the access
function for a given data reference is zero:
we only initialize access_fns in the case of a polynomial chrec:
if (TREE_CODE (ref) == MEM_REF)
{
op = TREE_OPERAND (ref, 0);
access_fn = analyze_scalar_evolution (loop, op);
access_fn = instantiate_scev (before_loop, loop, access_fn);
if (TREE_CODE (access_fn) == POLYNOMIAL_CHREC)
{
[...]
access_fns.safe_push (access_fn);
}
}
In all other cases we may not have a representation of the access functions.
It is incorrect to initialize to "A[0]" all those data references that
cannot be analyzed.
If needed, instead of returning vNULL, one could initialize the vector to empty:
if (access_fns == vNULL)
access_fns.create (0);
and that would be correct, though it would not teach the dependence analysis
how to deal with the global variable access function in pr69110.
I think the fix is to add the zero subscript only for DECL_P (ref).
Sebastian