PIPS
translation.c File Reference
#include <stdio.h>
#include <string.h>
#include <setjmp.h>
#include "boolean.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
#include "sommet.h"
#include "ray_dte.h"
#include "sg.h"
#include "polyedre.h"
#include "union.h"
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "constants.h"
#include "ri-util.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "workspace-util.h"
#include "resources.h"
#include "misc.h"
#include "text.h"
#include "text-util.h"
#include "transformer.h"
#include "preprocessor.h"
#include "properties.h"
#include "prettyprint.h"
#include "effects-generic.h"
#include "effects-convex.h"
+ Include dependency graph for translation.c:

Go to the source code of this file.

Data Structures

struct  Common_Dimension_Stat
 translation More...
 
struct  Linearization_Stat
 
struct  Remaining_Dimension_Stat
 
struct  Beta_Elimination_Stat
 
struct  Phi_Elimination_Stat
 
struct  Predicate_Translation
 

Macros

#define BACKWARD   true
 Package regions : Be'atrice Creusillet 11/95. More...
 
#define FORWARD   false
 
#define min(a, b)   (((a)<(b))?(a):(b))
 
#define max(a, b)   (((a)>(b))?(a):(b))
 
#define IS_EG   true
 
#define NOT_EG   false
 
#define PHI_FIRST   true
 
#define NOT_PHI_FIRST   false
 

Functions

static void reg_v_debug (Pvecteur v)
 
static void reg_sc_debug (Psysteme sc)
 
void region_translation_statistics_init (bool stat_p)
 initialization and closing More...
 
void region_translation_statistics_close (const char *mod_name, const char *prefix)
 
static bool dims_array_init (entity array, dimension *dims, int dim_array)
 
static Psysteme entity_assumed_declaration_sc (dimension *dims, int ndim)
 
void region_translation_init (entity ent_1, reference rf_1, entity ent_2, reference rf_2, Value offset_1_m_2)
 
static void region_translation_close ()
 
static bool some_phi_variable (Pcontrainte c)
 
void append_declaration_sc_if_exact_without_constraints (region r)
 if we have a region like: <A(PHI)-EXACT-{}> it means that all declared elements are touched, although this is implicit. More...
 
static void region_translation_of_predicate (region reg, entity to_func)
 
static Psysteme array_translation_sc (bool *p_exact_translation_p)
 
region region_translation (region reg_1, entity func_1, reference rf_1, entity ent_2, entity func_2, reference rf_2, Value offset_1_m_2, bool backward_p)
 region region_translation(region reg1, entity mod1, reference ref1, entity ent2, entity mod2, reference ref2, Pvecteur offset_1_m_2, bool offset_undef_p) input : a region reg1, from module mod1; a target entity ent2 in module mod2 (it is possible to have mod1 = mod2 for equivalences); references ref1 and ref2 and offset_1_m_2 are provided to represent the offset between the index of the initial and target entity; if both entities are in a common or are equivalenced, then we can only provide offset_1_m_2; when translating from a formal to a real parameter or from a real to a formal one, we only know the real reference, the other one being undefined. More...
 

Variables

static bool statistics_p
 STATISTICS
More...
 
static int mat_dim_stat [8][8]
 inputs More...
 
static int vect_size_ratio_stat [4]
 correspondances between source and target array number of dimensions More...
 
static int zero_offset_stat
 size ratio after normalization More...
 
static int scalar_to_scalar_stat
 number cases in which the offset is nul More...
 
static int scalar_to_array_stat
 
static int array_to_array_stat
 
static struct Common_Dimension_Stat common_dimension_stat
 
static struct Linearization_Stat linearization_stat
 
static struct Remaining_Dimension_Stat remaining_dimension_stat
 
static struct Beta_Elimination_Stat beta_elimination_stat
 
static struct Phi_Elimination_Stat phi_elimination_stat
 
static struct Predicate_Translation predicate_translation_stat
 
static entity array_1
 Local variables and functions to avoid multiple computations
More...
 
static entity array_2
 
static reference ref_1
 
static reference ref_2
 
static bool reference_p
 
static Value offset
 
static int dim_1
 
static int dim_2
 
static Value size_elt_1
 
static Value size_elt_2
 
static dimension dims_1 [NB_MAX_ARRAY_DIM]
 
static dimension dims_2 [NB_MAX_ARRAY_DIM]
 
static bool dim_1_assumed
 
static bool dim_2_assumed
 

Macro Definition Documentation

◆ BACKWARD

#define BACKWARD   true

Package regions : Be'atrice Creusillet 11/95.

array_translation

This File contains general purpose functions that compute the translation of regions from one array to another (e.g. interprocedural translation).

Definition at line 76 of file translation.c.

◆ FORWARD

#define FORWARD   false

Definition at line 77 of file translation.c.

◆ IS_EG

#define IS_EG   true

Definition at line 339 of file translation.c.

◆ max

#define max (   a,
 
)    (((a)>(b))?(a):(b))

Definition at line 80 of file translation.c.

◆ min

#define min (   a,
 
)    (((a)<(b))?(a):(b))

Definition at line 79 of file translation.c.

◆ NOT_EG

#define NOT_EG   false

Definition at line 340 of file translation.c.

◆ NOT_PHI_FIRST

#define NOT_PHI_FIRST   false

Definition at line 343 of file translation.c.

◆ PHI_FIRST

#define PHI_FIRST   true

Definition at line 342 of file translation.c.

Function Documentation

◆ append_declaration_sc_if_exact_without_constraints()

void append_declaration_sc_if_exact_without_constraints ( region  r)

if we have a region like: <A(PHI)-EXACT-{}> it means that all declared elements are touched, although this is implicit.

this occurs with io effects of "PRINT *, A". in such a case, the declaration constraints MUST be appended before the translation, otherwise the result might be false.

potential bug : if the declaration system cannot be generated, the region should be turned to MAY for the translation?

we have an exact array region

Definition at line 492 of file translation.c.

493 {
495  Psysteme s = region_system(r);
496 
497  if (entity_scalar_p(v) || region_may_p(r)) return;
498  /* we have an exact array region */
499 
500  pips_debug(5, "considering exact region of array %s\n", entity_name(v));
501 
502  if (!some_phi_variable(sc_egalites(s)) &&
503  !some_phi_variable(sc_inegalites(s)))
504  {
505  pips_debug(7, "appending declaration system\n");
507  }
508 }
#define region_any_reference(reg)
To be avoided.
#define region_entity(reg)
#define region_system(reg)
#define region_may_p(reg)
static bool some_phi_variable(Pcontrainte c)
Definition: translation.c:475
void region_sc_append(effect, Psysteme, bool)
Psysteme entity_declaration_sc(entity)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define reference_variable(x)
Definition: ri.h:2326
#define entity_name(x)
Definition: ri.h:2790

References entity_declaration_sc(), entity_name, entity_scalar_p(), pips_debug, reference_variable, region_any_reference, region_entity, region_may_p, region_sc_append(), region_system, and some_phi_variable().

Referenced by region_translation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ array_translation_sc()

static Psysteme array_translation_sc ( bool p_exact_translation_p)
static

Referenced by region_translation().

+ Here is the caller graph for this function:

◆ dims_array_init()

static bool dims_array_init ( entity  array,
dimension dims,
int  dim_array 
)
static

FI: special case for the old Fortran habit of using declarations such as D(1) or E(N,1) to declare a pointer to an array of undefined (last) dimension.

Such declarations cannot be used for array bound checking.

The warning message does not seem to fit the test.

Definition at line 289 of file translation.c.

290 {
291  int i;
292  bool dim_assumed;
293 
294  i = 0;
295  dim_assumed = false;
297  if (i == dim_array -1)
298  {
301 
303  {
304  Pvecteur pvup = normalized_linear(nup);
305  Pvecteur pvlo = normalized_linear(nlo);
306 
307  /* FI: special case for the old Fortran habit of using
308  declarations such as D(1) or E(N,1) to declare a
309  pointer to an array of undefined (last) dimension.
310 
311  Such declarations cannot be used for array bound
312  checking.
313 
314  The warning message does not seem to fit the test. */
315  if(!VECTEUR_NUL_P(pvup) && !VECTEUR_NUL_P(pvlo))
316  if (vect_constant_p(pvup) && value_one_p(val_of(pvup)) &&
317  vect_constant_p(pvlo) && value_one_p(val_of(pvlo)))
318  {
319  pips_user_warning("\nvariable (%s): "
320  "last upper dimension equal to lower;"
321  " assuming unbounded upper bound\n",
322  entity_name(array));
323  dim =
327  NIL);
328  dim_assumed = true;
329  }
330  }
331  }
332  dims[i] = dim;
333  i++;
334  }
335 
336  return dim_assumed;
337 }
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
#define value_one_p(val)
bool vect_constant_p(Pvecteur)
bool vect_constant_p(Pvecteur v): v contains only a constant term, may be zero
Definition: predicats.c:211
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
#define pips_user_warning
Definition: misc-local.h:146
#define UNBOUNDED_DIMENSION_NAME
Definition: ri-util-local.h:74
#define NORMALIZE_EXPRESSION(e)
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
expression MakeNullaryCall(entity f)
Creates a call expression to a function with zero arguments.
Definition: expression.c:331
#define normalized_linear_p(x)
Definition: ri.h:1779
#define dimension_lower(x)
Definition: ri.h:980
#define type_variable(x)
Definition: ri.h:2949
#define dimension_upper(x)
Definition: ri.h:982
#define variable_dimensions(x)
Definition: ri.h:3122
#define entity_type(x)
Definition: ri.h:2792
#define normalized_linear(x)
Definition: ri.h:1781
static entity array
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
#define val_of(varval)
#define VECTEUR_NUL_P(v)

References array, CreateIntrinsic(), DIMENSION, dimension_lower, dimension_upper, entity_name, entity_type, FOREACH, make_dimension(), MakeNullaryCall(), NIL, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_user_warning, type_variable, UNBOUNDED_DIMENSION_NAME, val_of, value_one_p, variable_dimensions, vect_constant_p(), and VECTEUR_NUL_P.

Referenced by region_translation_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entity_assumed_declaration_sc()

static Psysteme entity_assumed_declaration_sc ( dimension dims,
int  ndim 
)
static

Definition at line 345 of file translation.c.

346 {
347  Psysteme sc = sc_new();
348  int dim;
349 
350  for (dim=1; dim<=ndim; dim++)
351  {
352  (void) sc_add_phi_equation(&sc, dimension_lower(dims[dim-1]),
353  dim, NOT_EG, NOT_PHI_FIRST);
354  (void) sc_add_phi_equation(&sc, dimension_upper(dims[dim-1]),
355  dim, NOT_EG, PHI_FIRST);
356  }
357 
358  return sc;
359 }
#define NOT_EG
Definition: translation.c:340
#define NOT_PHI_FIRST
Definition: translation.c:343
#define PHI_FIRST
Definition: translation.c:342
bool sc_add_phi_equation(Psysteme *, expression, int, bool, bool)
Psysteme sc_new(void)
Psysteme sc_new(): alloue un systeme vide, initialise tous les champs avec des valeurs nulles,...
Definition: sc_alloc.c:55

References dimension_lower, dimension_upper, NOT_EG, NOT_PHI_FIRST, PHI_FIRST, sc_add_phi_equation(), and sc_new().

Referenced by region_translation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reg_sc_debug()

static void reg_sc_debug ( Psysteme  sc)
static

Definition at line 91 of file translation.c.

93 {
95 }
const char * pips_region_user_name(entity)
char * pips_region_user_name(entity ent) output : the name of entity.
Definition: prettyprint.c:169
void sc_fprint(FILE *fp, Psysteme ps, get_variable_name_t nom_var)
void sc_fprint(FILE * f, Psysteme ps, char * (*nom_var)()): cette fonction imprime dans le fichier po...
Definition: sc_io.c:220
char *(* get_variable_name_t)(Variable)
Definition: vecteur-local.h:62

References pips_region_user_name(), and sc_fprint().

Referenced by region_translation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reg_v_debug()

static void reg_v_debug ( Pvecteur  v)
static

Definition at line 85 of file translation.c.

87 {
89 }
void vect_fprint(FILE *f, Pvecteur v, get_variable_name_t variable_name)
void vect_fprint(FILE * f, Pvecteur v, char * (*variable_name)()): impression d'un vecteur creux v su...
Definition: io.c:124

References pips_region_user_name(), and vect_fprint().

+ Here is the call graph for this function:

◆ region_translation()

region region_translation ( region  reg_1,
entity  func_1,
reference  rf_1,
entity  ent_2,
entity  func_2,
reference  rf_2,
Value  offset_1_m_2,
bool  backward_p 
)

region region_translation(region reg1, entity mod1, reference ref1, entity ent2, entity mod2, reference ref2, Pvecteur offset_1_m_2, bool offset_undef_p) input : a region reg1, from module mod1; a target entity ent2 in module mod2 (it is possible to have mod1 = mod2 for equivalences); references ref1 and ref2 and offset_1_m_2 are provided to represent the offset between the index of the initial and target entity; if both entities are in a common or are equivalenced, then we can only provide offset_1_m_2; when translating from a formal to a real parameter or from a real to a formal one, we only know the real reference, the other one being undefined.

output : a list of regions corresponding to the translation of reg1. modifies : nothing, reg1 is duplicated. comment :

NW: before calling "region_translation" do

call "set_interprocedural_translation_context_sc" (see comment for "set_interprocedural_translation_context_sc" for what must be done before that is called)

and "set_backward_arguments_to_eliminate" (for translation formals->reals) or "set_forward_arguments_to_eliminate"

like this:

call call_site; entity callee; list real_args; ... (set up call to "set_interprocedural_translation_context_sc" as indicated in its comments) ... real_args = call_arguments(call_site); set_interprocedural_translation_context_sc(callee, real_args); set_backward_arguments_to_eliminate(callee);

(that's it, but after the call to "region_translation", don't forget to do:)

reset_translation_context_sc(); reset_arguments_to_eliminate(); (resets after call to "set_interprocedural_translation_context_sc" as indicated in its comments)

Definition at line 561 of file translation.c.

References append_declaration_sc_if_exact_without_constraints(), array_1, array_2, array_to_array_stat, array_translation_sc(), BACKWARD, Ssysteme::base, BASE_NULLE, beta_elimination_stat, cell_preference, cell_preference_p, cell_reference, copy_action(), debug_off, debug_on, debug_region_consistency, dim_2, dims_2, entity_assumed_declaration_sc(), entity_declaration_sc(), entity_minimal_name(), entity_name, entity_scalar_p(), entity_storage, entity_undefined, entity_whole_region(), Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, free_reference(), get_bool_property(), get_translation_context_sc(), ifdebug, is_approximation_may, make_reference(), make_reference_region(), make_regions_psi_reference(), Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, newgen_Psysteme, NIL, phi_elimination_stat, pips_assert, pips_debug, pips_user_warning, predicate_translation_stat, preference_reference, print_region, psi_to_phi_region(), reference_p, reference_undefined_p, reg_sc_debug(), region, region_action, region_any_reference, region_approximation_tag, region_cell, region_dup(), region_entity, region_exact_p, region_remove_beta_variables(), region_remove_phi_variables(), region_sc_append(), region_sc_append_and_normalize(), region_system, region_system_, region_translation_close(), region_translation_init(), region_translation_of_predicate(), region_undefined, sc_creer_base(), sc_safe_append(), scalar_to_array_stat, scalar_to_scalar_stat, size_elt_1, size_elt_2, statistics_p, storage_formal_p, value_ne, and value_zero_p.

+ Here is the call graph for this function:

◆ region_translation_close()

static void region_translation_close ( )
static

do not free the real declaration

do not free the real declaration

Definition at line 457 of file translation.c.

458 {
459  if (dim_1_assumed)
460  {
461  /* do not free the real declaration */
464  }
465  if (dim_2_assumed)
466  {
467  /* do not free the real declaration */
470  }
471 }
void free_dimension(dimension p)
Definition: ri.c:532
static bool dim_2_assumed
Definition: translation.c:287
static bool dim_1_assumed
Definition: translation.c:287
static int dim_1
Definition: translation.c:284
static dimension dims_2[NB_MAX_ARRAY_DIM]
Definition: translation.c:286
static dimension dims_1[NB_MAX_ARRAY_DIM]
Definition: translation.c:286
static int dim_2
Definition: translation.c:284
#define expression_undefined
Definition: ri.h:1223

References dim_1, dim_1_assumed, dim_2, dim_2_assumed, dimension_lower, dims_1, dims_2, expression_undefined, and free_dimension().

Referenced by region_translation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ region_translation_init()

void region_translation_init ( entity  ent_1,
reference  rf_1,
entity  ent_2,
reference  rf_2,
Value  offset_1_m_2 
)

relative sizes of elements

Parameters
ent_1nt_1
rf_1f_1
ent_2nt_2
rf_2f_2
offset_1_m_2ffset_1_m_2

Definition at line 362 of file translation.c.

365 {
366  array_1 = ent_1;
367  array_2 = ent_2;
368  ref_1 = rf_1;
369  ref_2 = rf_2;
370  reference_p =
372  offset = offset_1_m_2;
373 
376 
378 
383 
384  ifdebug(2)
385  {
386  pips_debug(2,"before conversion:\n");
387  fprint_string_Value(stderr, "size_elt_1 = ", size_elt_1);
388  fprint_string_Value(stderr, ", size_elt_2 = ", size_elt_2);
389  fprintf(stderr, "\n");
390  if(!reference_p)
391  fprint_string_Value(stderr, "offset =", offset),
392  fprintf(stderr, "\n");
393  }
394  /* relative sizes of elements */
397  {
402  }
403  else
406  {
410  if (statistics_p)
411  {
414  else if (value_eq(size_elt_1, VALUE_CONST(2)))
416  else if (value_eq(size_elt_1, VALUE_CONST(4)))
418  }
419  }
420  else
423  {
427  if (statistics_p)
428  {
431  else if (value_eq(size_elt_2, VALUE_CONST(2)))
433  else if (value_eq(size_elt_2, VALUE_CONST(4)))
435  }
436  }
437 
439 
440 
441  ifdebug(2)
442  {
443  pips_debug(2,"after conversion:\n");
444  fprint_string_Value(stderr, "size_elt_1 = ", size_elt_1);
445  fprint_string_Value(stderr, ", size_elt_2 = ", size_elt_2);
446  fprintf(stderr, "\n");
447  if(!reference_p)
448  fprint_string_Value(stderr, "offset =", offset),
449  fprintf(stderr, "\n");
450  }
451 
454 
455 }
#define int_to_value(i)
end LINEAR_VALUE_IS_INT
#define VALUE_CONST(val)
#define value_zero_p(val)
#define value_eq(v1, v2)
bool operators on values
#define value_division(ref, val)
#define VALUE_ONE
#define value_mod(v1, v2)
void fprint_string_Value(FILE *, char *, Value)
Definition: io.c:47
static int mat_dim_stat[8][8]
inputs
Definition: translation.c:104
static reference ref_1
Definition: translation.c:281
static int zero_offset_stat
size ratio after normalization
Definition: translation.c:107
static bool reference_p
Definition: translation.c:282
static int vect_size_ratio_stat[4]
correspondances between source and target array number of dimensions
Definition: translation.c:106
static Value size_elt_1
Definition: translation.c:285
static reference ref_2
Definition: translation.c:281
static entity array_2
Definition: translation.c:280
static entity array_1
Local variables and functions to avoid multiple computations
Definition: translation.c:280
static Value size_elt_2
Definition: translation.c:285
static bool dims_array_init(entity array, dimension *dims, int dim_array)
Definition: translation.c:289
static bool statistics_p
STATISTICS
Definition: translation.c:101
static Value offset
Definition: translation.c:283
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
Definition: size.c:297
int NumberOfDimension(entity)
Definition: size.c:588
#define reference_undefined_p(x)
Definition: ri.h:2303
#define variable_basic(x)
Definition: ri.h:3120
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47

References array_1, array_2, dim_1, dim_1_assumed, dim_2, dim_2_assumed, dims_1, dims_2, dims_array_init(), entity_type, fprint_string_Value(), fprintf(), ifdebug, int_to_value, mat_dim_stat, NumberOfDimension(), offset, pips_debug, ref_1, ref_2, reference_p, reference_undefined_p, size_elt_1, size_elt_2, SizeOfElements(), statistics_p, type_variable, VALUE_CONST, value_division, value_eq, value_mod, VALUE_ONE, value_zero_p, variable_basic, vect_size_ratio_stat, and zero_offset_stat.

Referenced by region_translation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ region_translation_of_predicate()

static void region_translation_of_predicate ( region  reg,
entity  to_func 
)
static

Referenced by region_translation().

+ Here is the caller graph for this function:

◆ region_translation_statistics_close()

void region_translation_statistics_close ( const char *  mod_name,
const char *  prefix 
)

inputs

other ratios

translation

Parameters
mod_nameod_name
prefixrefix

Definition at line 212 of file translation.c.

213 {
214  FILE *fp;
215  string filename;
216  int i,j,total;
217 
218  if (!statistics_p) return;
219 
220  filename = "inter_trans_stat";
222  mod_name, ".", prefix, "_", filename, 0));
223 
224  fp = safe_fopen(filename, "w");
225  fprintf(fp,"%s", mod_name);
226 
227  /* inputs */
230 
231  for (i=0; i<8; i++)
232  for (j=0; j<8; j++)
233  fprintf(fp, " %d", mat_dim_stat[i][j]);
234 
235  for (i=0; i<4; i++)
236  fprintf(fp, " %d", vect_size_ratio_stat[i]);
237 
238  /* other ratios */
239  for (total = 0, i=0; i<4; i++)
240  total = total + vect_size_ratio_stat[i];
241  fprintf(fp, " %d", scalar_to_array_stat + array_to_array_stat - total);
242 
243  /* translation */
244  fprintf(fp, " %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
249 
254 
258 
262 
266 
270 
271  fprintf(fp,"\n");
272  safe_fclose(fp, filename);
273  free(filename);
274 }
static struct Common_Dimension_Stat common_dimension_stat
static struct Remaining_Dimension_Stat remaining_dimension_stat
static struct Phi_Elimination_Stat phi_elimination_stat
static struct Predicate_Translation predicate_translation_stat
static int scalar_to_scalar_stat
number cases in which the offset is nul
Definition: translation.c:109
static int scalar_to_array_stat
Definition: translation.c:110
static struct Linearization_Stat linearization_stat
static struct Beta_Elimination_Stat beta_elimination_stat
static int array_to_array_stat
Definition: translation.c:111
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
void free(void *)
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
static const char * prefix
char * strdup()

References Common_Dimension_Stat::all_similar, array_to_array_stat, beta_elimination_stat, common_dimension_stat, concatenate(), db_get_current_workspace_directory(), Linearization_Stat::exact, Remaining_Dimension_Stat::exact, Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, fprintf(), free(), linearization_stat, mat_dim_stat, Remaining_Dimension_Stat::nb, Common_Dimension_Stat::nb_calls, Linearization_Stat::nb_calls, Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, Common_Dimension_Stat::non_linear_decl, Linearization_Stat::non_linear_decl, Remaining_Dimension_Stat::non_linear_decl_or_offset, Linearization_Stat::non_linear_system, Common_Dimension_Stat::not_same_decl, phi_elimination_stat, predicate_translation_stat, prefix, remaining_dimension_stat, safe_fclose(), safe_fopen(), scalar_to_array_stat, scalar_to_scalar_stat, statistics_p, strdup(), vect_size_ratio_stat, and zero_offset_stat.

Referenced by reset_convex_rw_regions().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ region_translation_statistics_init()

void region_translation_statistics_init ( bool  stat_p)

initialization and closing

translation.c

Parameters
stat_ptat_p

Definition at line 162 of file translation.c.

163 {
164  int i,j;
165 
166  statistics_p = stat_p;
167 
168  if (!statistics_p)
169  return;
170 
171  for (i=0; i<8; i++)
172  for (j=0; j<8; j++)
173  mat_dim_stat[i][j] = 0;
174 
175  for (i=0; i<4; i++)
176  vect_size_ratio_stat[i] = 0;
177 
178  zero_offset_stat = 0;
182 
187 
192 
196 
200 
204 
208 
209 }

References Common_Dimension_Stat::all_similar, array_to_array_stat, beta_elimination_stat, common_dimension_stat, Linearization_Stat::exact, Remaining_Dimension_Stat::exact, Beta_Elimination_Stat::exact, Phi_Elimination_Stat::exact, Predicate_Translation::exact, Beta_Elimination_Stat::exact_input, Phi_Elimination_Stat::exact_input, Predicate_Translation::exact_input, linearization_stat, mat_dim_stat, Remaining_Dimension_Stat::nb, Common_Dimension_Stat::nb_calls, Linearization_Stat::nb_calls, Beta_Elimination_Stat::nb_calls, Phi_Elimination_Stat::nb_calls, Predicate_Translation::nb_calls, Common_Dimension_Stat::non_linear_decl, Linearization_Stat::non_linear_decl, Remaining_Dimension_Stat::non_linear_decl_or_offset, Linearization_Stat::non_linear_system, Common_Dimension_Stat::not_same_decl, phi_elimination_stat, predicate_translation_stat, remaining_dimension_stat, scalar_to_array_stat, scalar_to_scalar_stat, statistics_p, vect_size_ratio_stat, and zero_offset_stat.

Referenced by init_convex_rw_regions().

+ Here is the caller graph for this function:

◆ some_phi_variable()

static bool some_phi_variable ( Pcontrainte  c)
static

Definition at line 475 of file translation.c.

476 {
477  for (; c; c=c->succ)
479  return true;
480  return false;
481 }
bool vect_contains_phi_p(Pvecteur)
bool vect_contains_phi_p(Pvecteur v) input : a vector output : true if v contains a PHI variable,...
Definition: effects.c:1427
Pvecteur vecteur
struct Scontrainte * succ

References Scontrainte::succ, vect_contains_phi_p(), and Scontrainte::vecteur.

Referenced by append_declaration_sc_if_exact_without_constraints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ array_1

entity array_1
static

Local variables and functions to avoid multiple computations

Definition at line 280 of file translation.c.

Referenced by region_translation(), and region_translation_init().

◆ array_2

entity array_2
static

Definition at line 280 of file translation.c.

Referenced by region_translation(), and region_translation_init().

◆ array_to_array_stat

int array_to_array_stat
static

◆ beta_elimination_stat

◆ common_dimension_stat

◆ dim_1

int dim_1
static

Definition at line 284 of file translation.c.

Referenced by region_translation_close(), and region_translation_init().

◆ dim_1_assumed

bool dim_1_assumed
static

Definition at line 287 of file translation.c.

Referenced by region_translation_close(), and region_translation_init().

◆ dim_2

int dim_2
static

◆ dim_2_assumed

bool dim_2_assumed
static

Definition at line 287 of file translation.c.

Referenced by region_translation_close(), and region_translation_init().

◆ dims_1

dimension dims_1[NB_MAX_ARRAY_DIM]
static

Definition at line 286 of file translation.c.

Referenced by region_translation_close(), and region_translation_init().

◆ dims_2

◆ linearization_stat

◆ mat_dim_stat

int mat_dim_stat[8][8]
static

◆ offset

◆ phi_elimination_stat

◆ predicate_translation_stat

◆ ref_1

reference ref_1
static

Definition at line 281 of file translation.c.

Referenced by region_translation_init().

◆ ref_2

reference ref_2
static

Definition at line 281 of file translation.c.

Referenced by region_translation_init().

◆ reference_p

bool reference_p
static

Definition at line 282 of file translation.c.

Referenced by region_translation(), and region_translation_init().

◆ remaining_dimension_stat

◆ scalar_to_array_stat

int scalar_to_array_stat
static

◆ scalar_to_scalar_stat

int scalar_to_scalar_stat
static

number cases in which the offset is nul

Definition at line 109 of file translation.c.

Referenced by region_translation(), region_translation_statistics_close(), and region_translation_statistics_init().

◆ size_elt_1

Value size_elt_1
static

◆ size_elt_2

Value size_elt_2
static

Definition at line 285 of file translation.c.

Referenced by region_translation(), and region_translation_init().

◆ statistics_p

◆ vect_size_ratio_stat

int vect_size_ratio_stat[4]
static

correspondances between source and target array number of dimensions

Definition at line 106 of file translation.c.

Referenced by region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().

◆ zero_offset_stat

int zero_offset_stat
static

size ratio after normalization

Definition at line 107 of file translation.c.

Referenced by region_translation_init(), region_translation_statistics_close(), and region_translation_statistics_init().