Data references and dependences detectors. Copyright (C) 2003-2013 Free Software Foundation, Inc. Contributed by Sebastian Pop pop@c.nosp@m.ri.e.nosp@m.nsmp..nosp@m.fr
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. This pass walks a given loop structure searching for array references. The information about the array accesses is recorded in DATA_REFERENCE structures.
The basic test for determining the dependences is: given two access functions chrec1 and chrec2 to a same array, and x and y two vectors from the iteration domain, the same element of the array is accessed twice at iterations x and y if and only if: | chrec1 (x) == chrec2 (y).
The goals of this analysis are:
- to determine the independence: the relation between two independent accesses is qualified with the chrec_known (this information allows a loop parallelization),
- to define a knowledge base for storing the data dependence information,
- to define an interface to access this data.
Definitions:
- subscript: given two array accesses a subscript is the tuple composed of the access functions for a given dimension. Example: Given A[f1][f2][f3] and B[g1][g2][g3], there are three subscripts: (f1, g1), (f2, g2), (f3, g3).
- Diophantine equation: an equation whose coefficients and solutions are integer constants, for example the equation | 3*x + 2*y = 1 has an integer solution x = 1 and y = -1.
References:
- "Loop Transformations for Restructuring Compilers - The Foundations" by Utpal Banerjee.