PIPS
code_generation.c File Reference
#include <stdio.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "conversion.h"
#include "hyperplane.h"
+ Include dependency graph for code_generation.c:

Go to the source code of this file.

Functions

statement code_generation (list lls, Pvecteur pvg[], Pbase base_oldindex, Pbase base_newindex, Psysteme sc_newbase, bool preserve_entry_label_p)
 package hyperplane More...
 

Function Documentation

◆ code_generation()

statement code_generation ( list  lls,
Pvecteur  pvg[],
Pbase  base_oldindex,
Pbase  base_newindex,
Psysteme  sc_newbase,
bool  preserve_entry_label_p 
)

package hyperplane

code_generation.c

include <sys/stdtypes.h> for debug with dbmalloc include "stdlib.h" statement code_generation(cons *lls,Pvecteur pvg[], Pbase base_oldindex, Pbase base_newindex) generation of hyperplane code for the nested loops (cons *lls). the new nested loops will be ; DOSEQ Ip = ... DOALL Jp = ... DOALL Kp = ... ... ENDDO

modification : Keep the code in the sequential version. Let the parallelisation to generate the parallel code. suggested by BB, modified by Yi-Qing. 17/05/92

make the parallel loops from inner loop to outermost loop

handling of current loop

new bounds for new index related to the old index of the old loop

FI: I do not understand how you could keep a go to target (!) or a list of local variables

Parameters
llsls
pvgvg
base_oldindexase_oldindex
base_newindexase_newindex
sc_newbasec_newbase
preserve_entry_label_preserve_entry_label_p

Definition at line 58 of file code_generation.c.

64 {
65  statement state_lhyp = statement_undefined;
67  loop l_hyp = loop_undefined;
73  Pbase pb = BASE_UNDEFINED;
74 
76  statement_newbase(bl,pvg,base_oldindex);
77  /* make the parallel loops from inner loop to outermost loop*/
78 
79  for(pb=base_reversal(base_newindex);lls!=NIL; lls=CDR(lls), pb = pb->succ) {
80  /* handling of current loop */
81  s_loop = STATEMENT(CAR(lls));
82 
83  /* new bounds for new index related to the old index of the old loop*/
84  make_bound_expression(pb->var, base_newindex,sc_newbase, &lower, &upper);
85  rl = make_range(lower, upper, int_to_expression(1));
86 
87  /*
88  loop l_old = loop_undefined;
89  l_old = instruction_loop(statement_instruction(s_loop));
90  l_hyp = make_loop((entity) pb->var,
91  rl,
92  bl,
93  loop_label(l_old),
94  make_execution(is_execution_sequential,UU),
95  loop_locals(l_old));
96  */
97 
98  /* FI: I do not understand how you could keep a go to target (!)
99  * or a list of local variables
100  */
101  l_hyp = make_loop((entity) pb->var,
102  rl,
103  bl,
106  NIL);
107 
108  bl = makeloopbody(l_hyp, s_loop, true);
109  }
110 
111  instr_lhyp = make_instruction(is_instruction_loop,l_hyp);
112  state_lhyp = copy_statement(s_loop);
113  if(!preserve_entry_label_p)
114  clear_label(state_lhyp);
116  statement_instruction(state_lhyp) = instr_lhyp;
117  return(state_lhyp);
118 }
execution make_execution(enum execution_utype tag, void *val)
Definition: ri.c:838
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
statement copy_statement(statement p)
STATEMENT.
Definition: ri.c:2186
void free_instruction(instruction p)
Definition: ri.c:1118
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
Pbase base_reversal(Pbase b_in)
Pbase base_reversal(Pbase b_in): produces a basis b_out, having the same basis vectors as b_in,...
Definition: base.c:221
void statement_newbase(statement s, pvg, Pbase base_oldindex)
statement_newbase(statement s, Pvecteur pvg[], Pbase base_oldindex) compute the new statement by perf...
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
statement makeloopbody(loop, statement, bool)
statement makeloopbody(l, s_old) make a statement for a loop body, using the fields of a previously e...
Definition: statement.c:1641
void clear_label(statement)
Definition: statement.c:1568
Psysteme sc_newbase
include <sys/ddi.h>
#define UU
Definition: newgen_types.h:98
void make_bound_expression(Variable index, Pbase base, Psysteme sc, expression *lower, expression *upper)
void make_bound_expression(variable index, Pbase base, Psysteme sc, expression *lower,...
entity entity_empty_label(void)
Definition: entity.c:1105
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 loop_body(x)
Definition: ri.h:1644
#define loop_undefined
Definition: ri.h:1612
#define instruction_loop(x)
Definition: ri.h:1520
#define range_undefined
Definition: ri.h:2263
#define instruction_undefined
Definition: ri.h:1454
#define expression_undefined
Definition: ri.h:1223
@ is_instruction_loop
Definition: ri.h:1471
#define statement_instruction(x)
Definition: ri.h:2458
@ is_execution_sequential
Definition: ri.h:1189
#define statement_undefined
Definition: ri.h:2419
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
#define BASE_UNDEFINED

References base_reversal(), BASE_UNDEFINED, CAR, CDR, clear_label(), copy_statement(), entity_empty_label(), expression_undefined, free_instruction(), instruction_loop, instruction_undefined, int_to_expression(), is_execution_sequential, is_instruction_loop, loop_body, loop_undefined, make_bound_expression(), make_execution(), make_instruction(), make_loop(), make_range(), makeloopbody(), NIL, range_undefined, sc_newbase, STATEMENT, statement_instruction, statement_newbase(), statement_undefined, Svecteur::succ, UU, and Svecteur::var.

Referenced by hyperplane(), parallel_tiling(), tiling_transformation(), and unimodular().

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