PIPS
delay.c File Reference
#include <stdio.h>
#include "genC.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "union.h"
#include "matrice.h"
#include "matrix.h"
#include "sparse_sc.h"
#include "ri.h"
#include "constants.h"
#include "ri-util.h"
#include "misc.h"
#include "complexity_ri.h"
#include "database.h"
#include "graph.h"
#include "dg.h"
#include "paf_ri.h"
#include "parser_private.h"
#include "property.h"
#include "reduction.h"
#include "text.h"
#include "text-util.h"
#include "tiling.h"
#include "pipsdbm.h"
#include "resources.h"
#include "static_controlize.h"
#include "paf-util.h"
#include "pip.h"
#include "array_dfg.h"
#include "prgm_mapping.h"
#include "conversion.h"
#include "scheduling.h"
#include "reindexing.h"
+ Include dependency graph for delay.c:

Go to the source code of this file.

Typedefs

typedef dfg_vertex_label vertex_label
 Local defines. More...
 
typedef dfg_arc_label arc_label
 

Functions

static void rewrite_nothing_call (call c)
 ====================================================================== More...
 
static void rewrite_nothing_ref (reference r)
 
static bool reference_filter (reference r)
 ====================================================================== More...
 
static bool assignation_filter (call c)
 ====================================================================== More...
 
list add_delay_information (hash_table t, list sl)
 ====================================================================== More...
 
void fprint_delay (FILE *fp, graph g, hash_table t)
 ====================================================================== More...
 

Variables

hash_table delay_table
 Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic : More...
 

Typedef Documentation

◆ arc_label

Definition at line 93 of file delay.c.

◆ vertex_label

Local defines.

Definition at line 92 of file delay.c.

Function Documentation

◆ add_delay_information()

list add_delay_information ( hash_table  t,
list  sl 
)

======================================================================

list add_delay_information(t, sl): go through the list of new statement and replace each first time dimension by its expression modulo the value of the delay.

AC 94/07/06

Definition at line 200 of file delay.c.

204 {
205  instruction ins;
206 
207  ins = make_instruction_block(sl);
208 
210 
211  return(instruction_block(ins));
212 }
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
static bool assignation_filter(call c)
======================================================================
Definition: delay.c:172
static void rewrite_nothing_call(call c)
======================================================================
Definition: delay.c:104
#define instruction_block(i)
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58

References assignation_filter(), call_domain, gen_recurse, instruction_block, make_instruction_block(), and rewrite_nothing_call().

Referenced by re_do_it().

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

◆ assignation_filter()

static bool assignation_filter ( call  c)
static

======================================================================

bool assignation_filter(c): tests if the call is an assignation. This is the filter of the function gen_recurse(). In case of a call we do not want to go down so the bool is always set to false. We test too if the assignation is an instruction and in that case, we treat each reference by calling the function gen_recurse again.

AC 94/07/25

first, test if the expression is an array that is an instruction

Definition at line 172 of file delay.c.

174 {
175  list lexp;
176  expression exp;
177 
179  {
180  lexp = call_arguments(c);
181  exp = EXPRESSION(CAR(lexp));
182 
183  /* first, test if the expression is an array that is an instruction */
184  if (array_ref_exp_p(exp))
187  }
188 
189  return(false);
190 }
static list lexp
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
static void rewrite_nothing_ref(reference r)
Definition: delay.c:105
static bool reference_filter(reference r)
======================================================================
Definition: delay.c:114
bool array_ref_exp_p(expression e)
======================================================================
#define ENTITY_ASSIGN_P(e)
#define call_function(x)
Definition: ri.h:709
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define reference_domain
newgen_range_domain_defined
Definition: ri.h:338
#define call_arguments(x)
Definition: ri.h:711
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References array_ref_exp_p(), call_arguments, call_function, CAR, ENTITY_ASSIGN_P, exp, EXPRESSION, gen_recurse, lexp, reference_domain, reference_filter(), and rewrite_nothing_ref().

Referenced by add_delay_information().

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

◆ fprint_delay()

void fprint_delay ( FILE *  fp,
graph  g,
hash_table  t 
)

======================================================================

void fprint_delay(fp, t): print the hash_table t

AC 94/07/01

Definition at line 221 of file delay.c.

225 {
226  list vl;
227 
228  for (vl = graph_vertices(g); !ENDP(vl); POP(vl)) {
229  int cn, del;
230  vertex cv;
231 
232  cv = VERTEX(CAR(vl));
234  del = (int)hash_get(delay_table, (char *)cn);
235  fprintf(fp,"\nInstruction n. %d \t=> delai = %d", cn, del);
236  }
237 }
void const char const char const int
#define vertex_vertex_label(x)
Definition: graph.h:152
#define graph_vertices(x)
Definition: graph.h:82
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
#define dfg_vertex_label_statement(x)
Definition: paf_ri.h:413
hash_table delay_table
Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic :
Definition: reindexing.c:109
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References CAR, delay_table, dfg_vertex_label_statement, ENDP, fprintf(), graph_vertices, hash_get(), int, POP, VERTEX, and vertex_vertex_label.

Referenced by reindexing().

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

◆ reference_filter()

static bool reference_filter ( reference  r)
static

======================================================================

bool reference_filter(r): filter on the reference r.

AC 94/07/28

first we get the number of the instruction

get the delay in the hash table

process the instruction only if the reference is an array.

build the modulo expression

Definition at line 114 of file delay.c.

116 {
117  entity e = reference_variable(r);
118  list lexp = NIL, lexp2 = NIL;
119  int n, d;
120  expression exp, exp2;
121  call ca;
122 
123  /* first we get the number of the instruction */
124  n = get_number_of_ins(e);
125 
126  /* get the delay in the hash table */
127  d = (int)hash_get(delay_table, (char *)n);
128 
129  if (get_debug_level() > 6) {
130  fprintf(stderr,"\nOld ref : ");
131  print_reference(r);
132  fprintf(stderr, "\n n = %d", n);
133  fprintf(stderr, "\n d = %d", d);
134  }
135 
136  /* process the instruction only if the reference is an array. */
137  if(reference_indices(r) != NIL) {
138  if ((d > 0) && (d != INFINITY)) {
140  lexp = CDR(reference_indices(r));
141  /* build the modulo expression */
142  lexp2 = CONS(EXPRESSION, int_to_expression(d+1), NIL);
143  lexp2 = CONS(EXPRESSION, exp, lexp2);
147  reference_indices(r) = CONS(EXPRESSION, exp2, lexp);
148  }
149  else if (d == 0) {
150  lexp = CDR(reference_indices(r));
151  exp = int_to_expression(0);
153  }
154  }
155  if (get_debug_level() > 6) {
156  fprintf(stderr,"\nNew ref : ");
157  print_reference(r);}
158 
159  return(false);
160 }
call make_call(entity a1, list a2)
Definition: ri.c:269
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
Definition: debug.c:67
void print_reference(reference r)
Definition: expression.c:142
#define INFINITY
define INFINITY 2147483647
int get_number_of_ins(entity e)
======================================================================
Definition: reindexing.c:638
#define MODULO_OPERATOR_NAME
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
#define normalized_undefined
Definition: ri.h:1745
#define reference_variable(x)
Definition: ri.h:2326
@ is_syntax_call
Definition: ri.h:2693
#define reference_indices(x)
Definition: ri.h:2328

References CAR, CDR, CONS, delay_table, entity_intrinsic(), exp, EXPRESSION, fprintf(), get_debug_level(), get_number_of_ins(), hash_get(), INFINITY, int, int_to_expression(), is_syntax_call, lexp, make_call(), make_expression(), make_syntax(), MODULO_OPERATOR_NAME, NIL, normalized_undefined, print_reference(), reference_indices, and reference_variable.

Referenced by assignation_filter().

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

◆ rewrite_nothing_call()

static void rewrite_nothing_call ( call  c)
static

======================================================================

void rewrite_nothing(chunk *) {return;}: rewrite nothing, incredible,no?

AC 94/07/25 could use gen_null instead. FC.

Definition at line 104 of file delay.c.

104 {return;}

Referenced by add_delay_information().

+ Here is the caller graph for this function:

◆ rewrite_nothing_ref()

static void rewrite_nothing_ref ( reference  r)
static

Definition at line 105 of file delay.c.

105 {return;}

Referenced by assignation_filter().

+ Here is the caller graph for this function:

Variable Documentation

◆ delay_table

hash_table delay_table
extern

Name : delay.c Package : reindexing Author : Alexis Platonoff Date : March 1995 Historic :

Documents: SOON Comments : This file contains the functions dealing with the dealy. Ansi includes
Newgen includes
C3 includes
Pips includes
External variables

Definition at line 109 of file reindexing.c.

Referenced by build_first_comb(), calculate_delay(), fprint_delay(), make_array_bounds(), re_do_it(), reference_filter(), and reindexing().