Candl  0.6.1
Classes | Defines | Typedefs | Functions
dependence.h File Reference
#include <stdio.h>
#include <candl/statement.h>
#include <candl/matrix.h>
#include <candl/program.h>
#include <candl/options.h>
Include dependency graph for dependence.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  candldependence

Defines

#define CANDL_ARRAY_BUFF_SIZE   2048
#define CANDL_VAR_UNDEF   1
#define CANDL_VAR_IS_DEF   2
#define CANDL_VAR_IS_USED   3
#define CANDL_VAR_IS_DEF_USED   4

Typedefs

typedef struct candldependence CandlDependence
typedef struct candldependence candl_dependence_t
typedef struct candldependencecandl_dependence_p

Functions

void candl_dependence_print_structure (FILE *, candl_dependence_p, int)
void candl_dependence_print (FILE *, candl_dependence_p)
void candl_dependence_pprint (FILE *, candl_dependence_p)
void candl_dependence_view (candl_dependence_p)
CandlDependencecandl_dependence_read_from_scop (scoplib_scop_p, CandlProgram *)
void candl_dependence_update_scop_with_deps (scoplib_scop_p, CandlDependence *)
void candl_dependence_print_scop (FILE *, FILE *, CandlDependence *)
candl_dependence_p candl_dependence_malloc ()
void candl_dependence_free (candl_dependence_p)
int candl_dependence_gcd_test (CandlStatement *, CandlStatement *, CandlMatrix *, int)
int candl_dependence_check (CandlProgram *, candl_dependence_p, CandlOptions *)
candl_dependence_p candl_dependence (CandlProgram *, CandlOptions *)
int candl_dependence_var_is_scalar (candl_program_p, int)
CandlStatement ** candl_dependence_refvar_chain (candl_program_p, CandlStatement *, int, int)
int candl_dependence_var_is_ref (CandlStatement *, int)
int candl_dependence_check_domain_is_included (CandlStatement *, CandlStatement *, CandlMatrix *, int)
int candl_dependence_scalar_is_privatizable_at (candl_program_p, int, int)
int candl_dependence_is_loop_carried (candl_program_p, CandlDependence *, int)
void candl_dependence_prune_scalar_waw (candl_program_p, CandlOptions *, CandlDependence **)
void candl_dependence_prune_with_privatization (candl_program_p, CandlOptions *, CandlDependence **)
int candl_dependence_scalar_renaming (candl_program_p, CandlOptions *, CandlDependence **)
int candl_dependence_analyze_scalars (candl_program_p, CandlOptions *)
int candl_num_dependences (CandlDependence *candl_deps)
void candl_compute_last_writer (CandlDependence *dep, CandlProgram *prog)
CandlDependencecandl_dependence_prune_transitively_covered (CandlDependence *deps)

Define Documentation

#define CANDL_ARRAY_BUFF_SIZE   2048

------ ( ----------------------------------------------------------** )\ CAnDL ** ----- / ) --------------------------------------------------------** ( * ( dependence.h ** ---- #/ --------------------------------------------------------** .-"#'-. First version: september 18th 2003 ** --- |"-.-"| -------------------------------------------------------** | | | | | | ************************************************************* CAnDL '-._,-' the Chunky Analyzer for Dependences in Loops (experimental) *

* Copyright (C) 2003-2008 Cedric Bastoul * * This 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 2 of the License, or (at your option) any later * version. * * This software 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 software; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * CAnDL, the Chunky Dependence Analyzer * Written by Cedric Bastoul, Cedric.Bastoul@inria.fr * *

#define CANDL_VAR_IS_DEF   2
#define CANDL_VAR_IS_DEF_USED   4
#define CANDL_VAR_IS_USED   3
#define CANDL_VAR_UNDEF   1

Typedef Documentation


Function Documentation

Compute the last writer for each RAW, WAW, and RAR dependence. This will modify the dependence polyhedra. Be careful of any references to the old dependence polyhedra. They are freed and new ones allocated.

References candl_dep_compute_lastwriter(), CANDL_WAR, candldependence::next, and candldependence::type.

Referenced by candl_dependence().

int candl_dependence_check_domain_is_included ( CandlStatement s1,
CandlStatement s2,
CandlMatrix context,
int  level 
)

candl_dependence_check_domain_is_included function: This function checks if the 'level'-first iterators of 2 domains are in such a way that s1 is larger or equal to s2, for the considered iterator dimensions.

References CANDL_assign, CANDL_clear, CANDL_decrement, candl_dependence_compute_lb(), CANDL_get_si, CANDL_init, candl_matrix_check_point(), candl_matrix_free(), candl_matrix_malloc(), CANDL_oppose, CANDL_set_si, candlstatement::depth, candlstatement::domain, and max.

Referenced by candl_dependence_analyze_scalars(), and candl_dependence_scalar_renaming().

int candl_dependence_gcd_test ( CandlStatement source,
CandlStatement target,
CandlMatrix system,
int  level 
)

candl_dependence_gcd_test function: This functions performs a GCD test on a dependence polyhedra represented exactly by a set of constraints 'system' organized in such a way:

  • first lines: iteration domain of 'source'
  • then: iteration domain of 'target'
  • then: array access equality(ies)
  • then (optional): precedence constraint inequality.

The function returns false if the dependence is impossible, true otherwise. A series of simple checks (SIV/ZIV/MIV/bounds checking) are also performed before the actual GCD test.

References candl_dependence_gcd(), candl_dependence_gcd_test_context(), CANDL_get_si, candlstatement::depth, and candlstatement::domain.

Referenced by candl_dependence_system().

int candl_dependence_is_loop_carried ( candl_program_p  program,
CandlDependence dep,
int  loop_index 
)

candl_dependence_malloc function: This function allocates the memory space for a CandlDependence structure and sets its fields with default values. Then it returns a pointer to the allocated space.

  • 07/12/2005: first version.

References CANDL_FAIL, CANDL_UNSET, candldependence::depth, candldependence::domain, candldependence::next, candldependence::ref_source, candldependence::ref_target, candldependence::source, candldependence::target, candldependence::type, and candldependence::usr.

Referenced by candl_dep_compute_lastwriter(), candl_dependence_read_one_dep(), and candl_dependence_system().

void candl_dependence_pprint ( FILE *  ,
candl_dependence_p   
)
void candl_dependence_print ( FILE *  ,
candl_dependence_p   
)

References candl_dependence_print_structure().

Referenced by main().

void candl_dependence_print_scop ( FILE *  input,
FILE *  output,
CandlDependence dependence 
)

Print the scop, containing the list of dependences.

References candl_dependence_update_scop_with_deps().

Referenced by main().

void candl_dependence_print_structure ( FILE *  file,
candl_dependence_p  dependence,
int  level 
)

candl_dependence_print_structure function: Displays a CandlDependence structure (dependence) into a file (file, possibly stdout) in a way that trends to be understandable without falling in a deep depression or, for the lucky ones, getting a headache... It includes an indentation level (level) in order to work with others print_structure functions.

  • 18/09/2003: first version.

References candl_matrix_print_structure(), CANDL_RAR, CANDL_RAW, CANDL_RAW_SCALPRIV, candl_statement_print_structure(), CANDL_UNSET, CANDL_WAR, CANDL_WAW, candldependence::depth, candldependence::domain, candldependence::next, candldependence::source, candldependence::target, and candldependence::type.

Referenced by candl_dependence_print(), and candl_violation_print_structure().

void candl_dependence_prune_scalar_waw ( candl_program_p  program,
CandlOptions options,
CandlDependence **  deps 
)

candl_dependence_prune_scalar_waw function: This function removes all WAW dependences between the same scalar (they are useless dependences).

References candl_dependence_extract_scalar_variables(), candl_dependence_get_array_refs_in_dep(), candl_matrix_free(), CANDL_WAW, candldependence::domain, candldependence::next, candldependence::type, and candloptions::verbose.

Remove somes dependences that are duplicates under transitive closure. In-place modification of the list of dependence polyhedra.

CandlDependence* candl_dependence_read_from_scop ( scoplib_scop_p  scop,
CandlProgram program 
)

Retrieve a CandlDependence list from the option tag in the scop.

References candl_dependence_read_one_dep(), and candldependence::next.

CandlStatement** candl_dependence_refvar_chain ( candl_program_p  program,
CandlStatement dom,
int  var_index,
int  level 
)

candl_dependence_refvar_chain function: This function returns a chain of statements as a feshly allocated array of pointer on statements, of all statements reading or writing the variable 'var_index', surrounded by the 'level' common loops of 'dom'. Output is a NULL-terminated array.

References candl_dependence_var_is_ref(), CANDL_VAR_UNDEF, candlstatement::depth, candlstatement::index, candl_program::nb_statements, and candl_program::statement.

Referenced by candl_dependence_analyze_scalars(), and candl_dependence_scalar_renaming().

int candl_dependence_scalar_is_privatizable_at ( candl_program_p  program,
int  var_index,
int  loop_index 
)

candl_dependence_is_privatizable function: This function checks if a given scalar 'var_index' is privatizable for loop 'loop_index'.

References candl_dependence_analyze_scalars(), candl_options_free(), candl_options_malloc(), candloptions::scalar_privatization, and candl_program::scalars_privatizable.

Referenced by candl_dependence_prune_with_privatization().

void candl_dependence_update_scop_with_deps ( scoplib_scop_p  scop,
CandlDependence dependence 
)

Update the scop option tag with the dependence list.

References CANDL_FAIL, and candl_program_deps_to_string().

Referenced by candl_dependence_print_scop().

int candl_dependence_var_is_ref ( CandlStatement s,
int  var_index 
)

candl_dependence_var_is_ref function: This function checks if a var 'var_index' is referenced (DEF or USE) by the statement.

References CANDL_get_si, CANDL_VAR_IS_DEF, CANDL_VAR_IS_DEF_USED, CANDL_VAR_IS_USED, CANDL_VAR_UNDEF, candlstatement::read, and candlstatement::written.

Referenced by candl_dependence_analyze_scalars(), candl_dependence_refvar_chain(), and candl_dependence_scalar_renaming().

int candl_dependence_var_is_scalar ( candl_program_p  program,
int  var_index 
)

candl_dependence_var_is_scalar function: This function returns true if the variable indexed by 'var_index' is a scalar in the whole program.

References CANDL_get_si, candl_program::nb_statements, candlstatement::read, candl_program::statement, and candlstatement::written.

Referenced by candl_dependence_extract_scalar_variables().

References candl_dependence_pprint(), and CANDL_TEMP_OUTPUT.

Referenced by main().

int candl_num_dependences ( CandlDependence candl_deps)

candl_num_dependences function: This function returns the number of dependences in the dependence list

Parameters:
dependenceThe first dependence of the dependence list.

References candldependence::next.