PIPS
debug.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "database.h"
#include "ri-util.h"
#include "effects-util.h"
#include "constants.h"
#include "misc.h"
#include "text-util.h"
#include "text.h"
#include "effects-generic.h"
#include "effects-convex.h"
+ Include dependency graph for debug.c:

Go to the source code of this file.

Macros

#define MY_MAX_CHECK   VALUE_CONST(100000000)
 

Functions

bool region_consistent_p (region reg)
 
bool regions_consistent_p (list l_reg)
 

Macro Definition Documentation

◆ MY_MAX_CHECK

#define MY_MAX_CHECK   VALUE_CONST(100000000)

Function Documentation

◆ region_consistent_p()

bool region_consistent_p ( region  reg)

FI->BC: it might be better to use descriptors even for regions linked to store and type declarations. Not much time to think about it now.

the system must be defined

check the Psysteme consistency

the TCST variable must not belong to the base

and there must be no high coefficient (or it should have raised an exception before

Definition at line 50 of file debug.c.

51 {
52 #define MY_MAX_CHECK VALUE_CONST(100000000)
53  bool consistent = true;
54  Psysteme sc;
55  Pbase b, t;
56  Pcontrainte c;
57 
58  pips_assert("it is a region", effect_consistent_p(reg));
59 
60  /* FI->BC: it might be better to use descriptors even for regions
61  linked to store and type declarations. Not much time to think
62  about it now. */
64  pips_assert("the descriptor is defined", !descriptor_none_p(effect_descriptor(reg)));
65 
66  /* the system must be defined */
67  consistent = consistent && !SC_UNDEFINED_P(region_system(reg));
68  pips_assert("the region system is defined", consistent);
69 
70  /* check the Psysteme consistency */
71  sc = region_system(reg);
72  consistent = consistent && sc_weak_consistent_p(sc);
73  pips_assert("the region system is consitent", consistent);
74 
75  /* the TCST variable must not belong to the base */
76  b = sc_base(sc);
77  for( t = b; !BASE_UNDEFINED_P(t) && consistent; t = t->succ)
78  {
79  consistent = consistent && !term_cst(t);
80  }
81  pips_assert("no TCST variable in the base", consistent);
82 
83 
84  /* and there must be no high coefficient (or it should have raised an
85  * exception before
86  */
87  c = sc_egalites(sc);
88  while (c != (Pcontrainte) NULL)
89  {
90  Pvecteur v;
91  for(v = c->vecteur; !VECTEUR_NUL_P(v); v = v->succ)
92  {
94  pips_assert("no high coefficient for PHI variables in region system.\n",
96  }
97  c = c->succ;
98  }
99  c = sc_inegalites(sc);
100  while (c != (Pcontrainte) NULL)
101  {
102  Pvecteur v;
103  for(v = c->vecteur; !VECTEUR_NUL_P(v); v = v->succ)
104  {
106  pips_assert("no high coefficient for PHI variables in region system.\n",
108  }
109  c = c->succ;
110  }
111  }
112  return consistent;
113 }
bool effect_consistent_p(effect p)
Definition: effects.c:457
#define value_lt(v1, v2)
#define region_system(reg)
#define MY_MAX_CHECK
#define variable_phi_p(e)
true if e is a phi variable PHI entities have a name like: REGIONS:PHI#, where # is a number.
#define effect_descriptor(x)
Definition: effects.h:646
#define descriptor_none_p(x)
Definition: effects.h:602
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
bool sc_weak_consistent_p(Psysteme sc)
check that sc is well defined, that the numbers of equalities and inequalities are consistent with th...
Definition: sc.c:362
Pvecteur vecteur
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
struct Svecteur * succ
Definition: vecteur-local.h:92
#define vecteur_val(v)
#define vecteur_var(v)
#define BASE_UNDEFINED_P(b)
#define VECTEUR_NUL_P(v)
#define term_cst(varval)

References BASE_UNDEFINED_P, descriptor_none_p, effect_consistent_p(), effect_descriptor, MY_MAX_CHECK, pips_assert, region_system, sc_weak_consistent_p(), Scontrainte::succ, Svecteur::succ, term_cst, value_lt, variable_phi_p, Scontrainte::vecteur, VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by regions_consistent_p(), replace_indices_region(), replace_indices_region_com(), set_methods_for_convex_effects(), and set_methods_for_convex_rw_pointer_effects().

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

◆ regions_consistent_p()

bool regions_consistent_p ( list  l_reg)
Parameters
l_reg_reg

Definition at line 116 of file debug.c.

117 {
118  bool consistent = true;
119  MAP(EFFECT, reg,
120  consistent = consistent && region_consistent_p(reg),l_reg);
121  return consistent;
122 }
bool region_consistent_p(region reg)
Definition: debug.c:50
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226

References EFFECT, MAP, and region_consistent_p().

+ Here is the call graph for this function: