Defines | Functions

ddv.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <candl/candl.h>
#include <assert.h>
Include dependency graph for ddv.c:

Defines

#define min(x, y)   (x < y ? x : y)
#define max(x, y)   (x > y ? x : y)

Functions

CandlDDVcandl_ddv_malloc ()
CandlDDVcandl_ddv_alloc (int size)
void candl_ddv_free (CandlDDV *dv)
void candl_ddv_set_type_at (CandlDDV *dv, e_dv_type type, int pos)
void candl_ddv_set_value_at (CandlDDV *dv, int value, int pos)
void candl_ddv_print (FILE *out, CandlDDV *dv)
static int candl_ddv_has_point (CandlMatrix *system)
static int count_quast_leaves (PipQuast *q)
static void get_quast_leaves (PipQuast *q, PipList **leaves)
static int candl_ddv_constant_val (CandlMatrix *system, int *val, int nb_par)
static CandlDDVcandl_ddv_create_from_dep (CandlDependence *dep, int loop_id, int ddv_size)
CandlDDVcandl_ddv_extract_in_loop (CandlProgram *program, CandlDependence *deps, int loop_id)

Detailed Description

------ ( ----------------------------------------------------------** )\ CAnDL ** ----- / ) --------------------------------------------------------** ( * ( ddv.c ** ---- #/ --------------------------------------------------------** .-"#'-. 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 Lesser General Public License as published by the Free * Software Foundation; either version 3 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 Lesser 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

Define Documentation

#define max (   x,
  y 
)    (x > y ? x : y)
#define min (   x,
  y 
)    (x < y ? x : y)

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_ddv::data, candl_ddv::length, dv_descriptor::type, and dv_descriptor::value.

Referenced by candl_ddv_create_from_dep().

static int candl_ddv_constant_val ( CandlMatrix system,
int *  val,
int  nb_par 
) [static]

candl_ddv_constant_val: returns true iff all possible values of the minimization of the first variable of the system is a scalar constant (not parametric), and has the same value for all conditions of the QUAST. The scalar constant is put in the 'val' argument.

References CANDL_get_si, candl_matrix_free(), candl_matrix_malloc(), count_quast_leaves(), and get_quast_leaves().

Referenced by candl_ddv_create_from_dep().

static CandlDDV* candl_ddv_create_from_dep ( CandlDependence dep,
int  loop_id,
int  ddv_size 
) [static]
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(), candl_ddv_print(), candlstatement::depth, candlstatement::index, min, candl_ddv::next, candldependence::next, candldependence::source, and candldependence::target.

void candl_ddv_free ( CandlDDV dv  ) 

candl_ddv_free: Free a ddv.

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

static int candl_ddv_has_point ( CandlMatrix system  )  [static]

Integer emptiness test on a given polyhedron.

Referenced by candl_ddv_create_from_dep().

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_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().

static int count_quast_leaves ( PipQuast *  q  )  [static]

Recursively count the number of leaves in a QUAST.

Referenced by candl_ddv_constant_val().

static void get_quast_leaves ( PipQuast *  q,
PipList **  leaves 
) [static]

Recursively traverse a QUAST, and put all leaves into a flat array.

Referenced by candl_ddv_constant_val().