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

Go to the source code of this file.

Classes

struct  dv_descriptor
struct  candl_ddv

Typedefs

typedef enum dv_type e_dv_type
typedef struct dv_descriptor s_dv_descriptor
typedef struct candl_ddv CandlDDV

Enumerations

enum  dv_type {
  candl_dv_scalar, candl_dv_plus, candl_dv_minus, candl_dv_star,
  candl_dv_eq
}

Functions

CandlDDVcandl_ddv_malloc ()
CandlDDVcandl_ddv_alloc (int)
void candl_ddv_free (CandlDDV *)
void candl_ddv_set_type_at (CandlDDV *, e_dv_type, int)
void candl_ddv_set_value_at (CandlDDV *, int, int)
void candl_ddv_set_deptype (CandlDDV *, int)
void candl_ddv_print (FILE *, CandlDDV *)
CandlDDVcandl_ddv_extract_in_loop (CandlProgram *, CandlDependence *, int)
int candl_loops_are_permutable (CandlProgram *program, CandlDependence *deps, int loop_id1, int loop_id2)

Detailed Description

------ ( ----------------------------------------------------------** )\ CAnDL ** ----- / ) --------------------------------------------------------** ( * ( ddv.h ** ---- #/ --------------------------------------------------------** .-"#'-. First version: February 4th 2010 ** --- |"-.-"| -------------------------------------------------------** | | | | | | ************************************************************* 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 * *

Author:
Louis-Noel Pouchet

Typedef Documentation

typedef struct candl_ddv CandlDDV
typedef enum dv_type e_dv_type

Enumeration Type Documentation

enum dv_type

A DDV is a vector of elements, each of which has a type and optionally a scalar value.

Ex: DDV1 is ('=', '=', '<') Ex: DDV2 is ('1', '1', '*') Types of elements are defined with the e_dv_type enum. '=' -> candl_dv_eq '>' -> candl_dv_plus '<' -> candl_dv_minus '*' -> candl_dv_star 'x' -> candl_dv_scalar (x is some integer)

Enumerator:
candl_dv_scalar 
candl_dv_plus 
candl_dv_minus 
candl_dv_star 
candl_dv_eq 

Function Documentation

CandlDDV* candl_ddv_alloc ( int  size)

candl_ddv_alloc: Allocate a ddv for a loop of depth 'size'.

References candl_ddv_malloc(), candl_dv_star, candl_ddv::data, candl_ddv::length, dv_descriptor::type, and dv_descriptor::value.

Referenced by candl_ddv_create_from_dep().

CandlDDV* candl_ddv_extract_in_loop ( CandlProgram program,
CandlDependence deps,
int  loop_id 
)

candl_ddv_extract_in_loop: Create a chained list of dependence distance vectors, from the list of polyhedral dependences. Only dependences involving statements surrounded by loop 'loop_id' are considered. One ddv is generated per polyhedral dependence.

References candl_ddv_create_from_dep(), candlstatement::depth, candlstatement::index, min, candl_ddv::next, candldependence::next, candldependence::source, and candldependence::target.

Referenced by candl_loops_are_permutable().

void candl_ddv_free ( CandlDDV dv)

candl_ddv_free: Free a ddv.

References candl_ddv::data, and candl_ddv::next.

Referenced by candl_loops_are_permutable().

CandlDDV* candl_ddv_malloc ( )

candl_ddv_malloc: Allocate an empty ddv.

References candl_ddv::data, candl_ddv::length, and candl_ddv::next.

Referenced by candl_ddv_alloc().

void candl_ddv_print ( FILE *  out,
CandlDDV dv 
)
void candl_ddv_set_deptype ( CandlDDV dv,
int  type 
)

candl_ddv_set_type: Set the type of the dependence in CANDL_UNSET, CANDL_RAW, CANDL_WAR, CANDL_WAW, CANDL_RAR.

References candl_ddv::deptype.

void candl_ddv_set_type_at ( CandlDDV dv,
e_dv_type  type,
int  pos 
)

candl_ddv_set_type_at: Set the type of a ddv component. Type is one of '=', '>', '<', '*' or 'constant' as defined by the enum e_dv_type.

References candl_ddv::data, and dv_descriptor::type.

Referenced by candl_ddv_create_from_dep().

void candl_ddv_set_value_at ( CandlDDV dv,
int  value,
int  pos 
)

candl_ddv_set_value_at: Set the scalar value of a ddv component. This is meaningful only if the type of this component is 'constant'.

References candl_ddv::data, and dv_descriptor::value.

Referenced by candl_ddv_create_from_dep().

int candl_loops_are_permutable ( CandlProgram program,
CandlDependence deps,
int  loop_id1,
int  loop_id2 
)

candl_loops_are_permutable: output 1 if the 2 loops are permutable.

candl_loops_are_permutable: output 1 if the 2 loops are permutable. Assume loop1 and loop2 are nested.

References candl_ddv_extract_in_loop(), candl_ddv_free(), candl_dv_minus, candl_dv_plus, candl_dv_scalar, candl_dv_star, candl_ddv::data, candlstatement::depth, candlstatement::index, candl_ddv::length, candl_program::nb_statements, candl_ddv::next, candl_program::statement, dv_descriptor::type, and dv_descriptor::value.