PIPS
io-util.c File Reference
#include "defines-local.h"
#include "conversion.h"
#include "effects-generic.h"
#include "effects-simple.h"
#include "effects-convex.h"
+ Include dependency graph for io-util.c:

Go to the source code of this file.

Macros

#define Load(stat)    ((bool)(intptr_t) (hash_get(stat_bool_map, stat)))
 
#define Store(stat, val)    (hash_put(stat_bool_map, (void*)stat, (void*) (val)))
 
#define GENERATION(NAME, COLLECT, UPDATE)
 

Functions

static bool host_section_p (list ls)
 true if the first statement of a block is a host section marker. More...
 
void hpfc_io_util_error_handler ()
 ??? neglect expression side effects... More...
 
static void only_io_sequence (sequence q)
 
static void only_io_test (test t)
 
static void only_io_loop (loop l)
 
static void only_io_call (call c)
 
static void only_io_unstructured (unstructured u)
 
static statement_mapping only_io_mapping (statement program, statement_mapping map)
 
void only_io_mapping_initialize (statement program)
 
static statement hpfc_hmessage (entity array, entity proc, bool send)
 T_LID=CMP_LID(pn, pi...) ? init buffer... More...
 
static statement hpfc_nrecv (entity array, bool cast)
 ! init buffer CALL HPFC {RCV FROM HOST, NCAST} CALL (type) BUFFER UNPACK More...
 
static statement hpfc_nsend (entity array)
 PVM_SEND(HOST_TID, HOST SND CHANNEL, INFO) HOST SND CHANNEL += 2. More...
 
static statement hpfc_hcast (entity array)
 static statement hpfc_hcast() More...
 
 GENERATION (node_pre_io, hpfc_buffer_initialization(true, false, true), hpfc_nrecv(array, false))
 
void generate_io_statements_for_shared_arrays (entity array, tag move, Psysteme condition, Psysteme echelon, _UNUSED_ list parameters, list scanners, list rebuild, statement *psh, statement *psn)
 generate_io_statements_for_shared_arrays More...
 

Variables

static statement_mapping stat_bool_map = hash_table_undefined
 HPFC module by Fabien COELHO. More...
 

Macro Definition Documentation

◆ GENERATION

#define GENERATION (   NAME,
  COLLECT,
  UPDATE 
)
Value:
static statement NAME(array, move) entity array; tag move;\
{pips_assert("valid move", \
return((move==is_movement_collect) ? (COLLECT) : (UPDATE));}
#define is_movement_update
#define is_movement_collect
Efficient I/O tags.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
int tag
TAG.
Definition: newgen_types.h:92
#define NAME
Definition: readmakefile.c:188
static entity array

Definition at line 256 of file io-util.c.

◆ Load

#define Load (   stat)     ((bool)(intptr_t) (hash_get(stat_bool_map, stat)))

Definition at line 53 of file io-util.c.

◆ Store

#define Store (   stat,
  val 
)     (hash_put(stat_bool_map, (void*)stat, (void*) (val)))

Definition at line 56 of file io-util.c.

Function Documentation

◆ generate_io_statements_for_shared_arrays()

void generate_io_statements_for_shared_arrays ( entity  array,
tag  move,
Psysteme  condition,
Psysteme  echelon,
_UNUSED_ list  parameters,
list  scanners,
list  rebuild,
statement psh,
statement psn 
)

generate_io_statements_for_shared_arrays

code to be generated:

Host:

[ IF condition then ] init_send DO scanners rebuild pack ENDDO host_cast [ ENDIF ]

Node:

[ IF condition then ] receive_hcast DO scanners rebuild unpack ENDDO [ ENDIF ]

some comments are generated to help understand the code

Definition at line 438 of file io-util.c.

448 {
450  string comment;
451  statement
452  h_cont = make_empty_statement(),
453  n_cont = make_empty_statement(),
454  h_pre = hpfc_buffer_initialization(true, false, true),
455  h_rebuild = generate_deducables(rebuild),
456  h_pack = hpfc_buffer_packing(array, (entity (*)())get_ith_array_dummy, true),
457  h_cast = hpfc_hcast(array),
458  n_rcv = hpfc_nrecv(array, true),
459  n_rebuild = generate_deducables(rebuild),
460  n_unpack = hpfc_buffer_packing(array, (entity (*)())get_ith_local_dummy, false),
461  h_scan = systeme_to_loop_nest
462  (echelon,
463  scanners,
465  CONS(STATEMENT, h_pack,
466  NIL))),
467  divide),
468  n_scan = systeme_to_loop_nest
469  (echelon,
470  scanners,
472  CONS(STATEMENT, n_unpack,
473  NIL))),
474  divide);
475 
476  pips_assert("update", movement_update_p(move));
477 
478  *psh = make_block_statement(
480  (condition, make_block_statement(CONS(STATEMENT, h_pre,
481  CONS(STATEMENT, h_scan,
482  CONS(STATEMENT, h_cast,
483  NIL))))),
484  CONS(STATEMENT, h_cont, NIL)));
485 
486  *psn = make_block_statement(
488  (condition, make_block_statement(CONS(STATEMENT, n_rcv,
489  CONS(STATEMENT, n_scan,
490  NIL)))),
491  CONS(STATEMENT, n_cont, NIL)));
492 
493  /* some comments are generated to help understand the code
494  */
495  comment = strdup(concatenate("! updating shared variable ",
496  entity_local_name(array), "\n", NULL));
499  free(comment);
500  insert_comments_to_statement(h_cont, "! end of update\n");
501  insert_comments_to_statement(n_cont, "! end of update\n");
502 }
#define divide(a, b)
statement systeme_to_loop_nest(Psysteme, list, statement, entity)
sc is used to generate the loop nest bounds for variables vars.
statement generate_optional_if(Psysteme, statement)
statement generate_optional_if(sc, stat)
static void comment(string_buffer code, spoc_hardware_type hw, dagvtx v, int stage, int side, bool flip)
Definition: freia_spoc.c:52
statement generate_deducables(list le)
statement generate_deducables(list le)
Definition: generate-util.c:83
statement hpfc_buffer_packing(entity array, entity(*creation)(), bool pack)
array(creation) = buffer(current++) or reverse assignment...
statement hpfc_buffer_initialization(bool is_send, _UNUSED_ bool is_lazy, bool job_was_done)
void free(void *)
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
#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
void insert_comments_to_statement(statement, const char *)
Insert a comment string (if non empty) at the beginning of the comments of a statement.
Definition: statement.c:1916
#define IDIVIDE
#define movement_update_p(t)
entity hpfc_name_to_entity(const char *)
Definition: run-time.c:817
entity get_ith_array_dummy(int)
entity get_ith_local_dummy(int)
static statement hpfc_hcast(entity array)
static statement hpfc_hcast()
Definition: io-util.c:247
static statement hpfc_nrecv(entity array, bool cast)
! init buffer CALL HPFC {RCV FROM HOST, NCAST} CALL (type) BUFFER UNPACK
Definition: io-util.c:218
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
#define make_empty_statement
An alias for make_empty_block_statement.
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
char * strdup()

References array, comment(), concatenate(), CONS, divide, entity_local_name(), free(), generate_deducables(), generate_optional_if(), get_ith_array_dummy(), get_ith_local_dummy(), hpfc_buffer_initialization(), hpfc_buffer_packing(), hpfc_hcast(), hpfc_name_to_entity(), hpfc_nrecv(), IDIVIDE, insert_comments_to_statement(), make_block_statement(), make_empty_statement, movement_update_p, NIL, pips_assert, STATEMENT, strdup(), and systeme_to_loop_nest().

+ Here is the call graph for this function:

◆ GENERATION()

GENERATION ( node_pre_io  ,
hpfc_buffer_initialization(true, false, true ,
hpfc_nrecv(array, false  
)

proc_cond computation: well, it may have been kept before the new loop bound computation?

Do not forget to move forbidden information associated with block:

Definition at line 262 of file io-util.c.

320 {
321  string comment;
322  entity
323  proc = array_to_processors(array),
325  Psysteme
326  /* proc_cond computation:
327  * well, it may have been kept before the new loop bound computation?
328  */
329  proc_decl = entity_to_declaration_constraints(proc, 2),
330  proc_cond_tmp = sc_dup(proc_echelon),
331  proc_cond = (sc_nredund(&proc_cond_tmp),
332  extract_nredund_subsystem(proc_cond_tmp, proc_decl));
333  statement
334  h_cont = make_empty_statement(),
335  n_cont = make_empty_statement(),
336  node_tmp = statement_undefined,
338  node_deduce = generate_deducables(rebuild),
339  host_deduce = generate_deducables(rebuild),
340  h_pre = host_pre_io(array, move),
341  h_in = host_in_io(array, move),
342  h_post = host_post_io(array, move),
343  n_pre = node_pre_io(array, move),
344  n_in = node_in_io(array, move),
345  n_post = node_post_io(array, move),
346  host_scan_loop =
348  (tile_echelon,
349  scanners,
350  make_block_statement(CONS(STATEMENT, host_deduce,
351  CONS(STATEMENT, h_in,
352  NIL))),
353  divide),
354  host_proc_loop =
356  (proc_echelon,
357  processors,
359  CONS(STATEMENT, host_scan_loop,
360  CONS(STATEMENT, h_post,
361  NIL)))),
362  divide),
363  node_scan_loop =
365  (tile_echelon,
366  scanners,
367  make_block_statement(CONS(STATEMENT, node_deduce,
368  CONS(STATEMENT, n_in,
369  NIL))),
370  divide);
371 
372  *psh = make_block_statement(
373  CONS(STATEMENT, generate_optional_if(condition, host_proc_loop),
374  CONS(STATEMENT, h_cont, NIL)));
375 
376  node_tmp =
378  CONS(STATEMENT, node_scan_loop,
379  CONS(STATEMENT, n_post,
380  NIL))));
381  *psn = make_block_statement(
383  (condition, make_block_statement(CONS(STATEMENT, node_defproc,
384  CONS(STATEMENT,
385  generate_optional_if(proc_cond, node_tmp), NIL)))),
386  CONS(STATEMENT, n_cont, NIL)));
387 
388  sc_rm(proc_cond_tmp), sc_rm(proc_cond);
389 
390  comment = strdup(concatenate("! ",
391  movement_update_p(move) ? "updating" : "collecting",
392  " distributed variable ",
393  entity_local_name(array), "\n", NULL));
394 
397  free(comment);
398 
399  comment = strdup(concatenate("! end of ",
400  movement_update_p(move) ? "update" : "collect",
401  "\n", NULL));
403  /* Do not forget to move forbidden information associated with
404  block: */
406  free(comment);
407 
408  DEBUG_STAT(5, "Host", *psh);
409  DEBUG_STAT(5, "Node", *psn);
410 }
Psysteme entity_to_declaration_constraints(entity e, tag what)
gives back the constraints due to the declarations.
Definition: build-system.c:285
statement define_node_processor_id(entity proc, entity(*creation)(int))
builds a statement VAR_i = MYPOS(i, proc_number) // i=1 to proc dimension
Definition: generate-util.c:49
#define array_to_processors(array)
#define DEBUG_STAT(D, W, S)
entity get_ith_processor_dummy(int)
#define statement_undefined
Definition: ri.h:2419
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Definition: sc_alloc.c:277
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Definition: sc_alloc.c:176
Psysteme extract_nredund_subsystem(Psysteme s1, Psysteme s2)
Psysteme extract_nredund_subsystem(s1, s2) Psysteme s1, s2;.

References array, array_to_processors, comment(), concatenate(), CONS, DEBUG_STAT, define_node_processor_id(), divide, entity_local_name(), entity_to_declaration_constraints(), extract_nredund_subsystem(), free(), generate_deducables(), generate_optional_if(), get_ith_processor_dummy(), hpfc_name_to_entity(), IDIVIDE, insert_comments_to_statement(), make_block_statement(), make_empty_statement, movement_update_p, NIL, sc_dup(), sc_rm(), STATEMENT, statement_undefined, strdup(), and systeme_to_loop_nest().

+ Here is the call graph for this function:

◆ host_section_p()

static bool host_section_p ( list  ls)
static

true if the first statement of a block is a host section marker.

looks like a hack. should be managed in directives.c...

Parameters
lsof statement

Definition at line 63 of file io-util.c.

65 {
66  if (gen_length(ls)>=1)
67  {
69  if (instruction_call_p(one))
70  return same_string_p
73  }
74 
75  return false;
76 }
size_t gen_length(const list l)
Definition: list.c:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define same_string_p(s1, s2)
#define HPF_PREFIX
moved here because needed by syntax:-(
#define HOSTSECTION_SUFFIX
#define call_function(x)
Definition: ri.h:709
#define instruction_call_p(x)
Definition: ri.h:1527
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_call(x)
Definition: ri.h:1529

References call_function, CAR, entity_local_name(), gen_length(), HOSTSECTION_SUFFIX, HPF_PREFIX, instruction_call, instruction_call_p, same_string_p, STATEMENT, and statement_instruction.

Referenced by only_io_sequence().

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

◆ hpfc_hcast()

static statement hpfc_hcast ( entity  array)
static

static statement hpfc_hcast()

  PVM_CAST(NBTASKS, NODETIDS, MCASTHOST, INFO)
  MCASTHOST = MCASTHOST + 2

Definition at line 247 of file io-util.c.

248 {
249  return make_block_statement(
251  CONS(STATEMENT,
253  NIL)));
254 }
statement hpfc_packing_of_current__buffer(entity array, bool pack)
CALL (pvmtype) HPFC {,UN}PACK.
#define HPFC_HCAST
host/node communications
statement hpfc_make_call_statement(entity, list)
statement hpfc_make_call_statement(e, l) generate a call statement to function e, with expression lis...
Definition: run-time.c:318

References array, CONS, HPFC_HCAST, hpfc_make_call_statement(), hpfc_name_to_entity(), hpfc_packing_of_current__buffer(), make_block_statement(), NIL, and STATEMENT.

Referenced by generate_io_statements_for_shared_arrays().

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

◆ hpfc_hmessage()

static statement hpfc_hmessage ( entity  array,
entity  proc,
bool  send 
)
static

T_LID=CMP_LID(pn, pi...) ? init buffer...

/ CALL (type) PACK... CALL HPFC {SND TO,RCV FROM} NODE(T_LID) / CALL (type) UPCK...

statement

Definition at line 181 of file io-util.c.

185 {
186  entity ld;
187  expression lid;
188  statement cmp_lid, comm, pack;
189  list /* statement */ lp, ls;
190 
192  lid = entity_to_expression(ld);
193  cmp_lid = hpfc_compute_lid(ld, proc, (entity (*)())get_ith_processor_dummy, NULL);
194 
195  lp = CONS(STATEMENT, cmp_lid, NIL);
196 
197  if (!send)
198  lp = CONS(STATEMENT, hpfc_buffer_initialization(false, false, false),
199  lp);
200 
202  send? HPFC_sH2N: HPFC_rN2H), CONS(EXPRESSION, lid, NIL));
203 
205 
206  if (send)
207  ls = CONS(STATEMENT, pack, CONS(STATEMENT, comm, NIL));
208  else
209  ls = CONS(STATEMENT, comm, CONS(STATEMENT, pack, NIL));
210 
211  return make_block_statement(gen_nconc(lp, ls));
212 }
statement hpfc_compute_lid(entity lid, entity proc, entity(*creation)(), entity array)
statement st_compute_lid(proc)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
#define HPFC_rN2H
#define T_LID
Variables.
#define HPFC_sH2N
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References array, CONS, entity_to_expression(), EXPRESSION, gen_nconc(), get_ith_processor_dummy(), hpfc_buffer_initialization(), hpfc_compute_lid(), hpfc_make_call_statement(), hpfc_name_to_entity(), hpfc_packing_of_current__buffer(), HPFC_rN2H, HPFC_sH2N, make_block_statement(), NIL, STATEMENT, and T_LID.

+ Here is the call graph for this function:

◆ hpfc_io_util_error_handler()

void hpfc_io_util_error_handler ( void  )

??? neglect expression side effects...

Definition at line 82 of file io-util.c.

83 {
84  error_reset_current_statement_stack();
85 }

Referenced by hpfc_error_handler().

+ Here is the caller graph for this function:

◆ hpfc_nrecv()

static statement hpfc_nrecv ( entity  array,
bool  cast 
)
static

! init buffer CALL HPFC {RCV FROM HOST, NCAST} CALL (type) BUFFER UNPACK

from host

Definition at line 218 of file io-util.c.

221 {
222  return make_block_statement(
223  CONS(STATEMENT, hpfc_buffer_initialization(false, false, false),
227  NIL))));
228 }
#define HPFC_rH2N
#define HPFC_NCAST

References array, CONS, hpfc_buffer_initialization(), hpfc_make_call_statement(), hpfc_name_to_entity(), HPFC_NCAST, hpfc_packing_of_current__buffer(), HPFC_rH2N, make_block_statement(), NIL, and STATEMENT.

Referenced by generate_io_statements_for_shared_arrays().

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

◆ hpfc_nsend()

static statement hpfc_nsend ( entity  array)
static

PVM_SEND(HOST_TID, HOST SND CHANNEL, INFO) HOST SND CHANNEL += 2.

Definition at line 233 of file io-util.c.

234 {
235  return make_block_statement(
239  NIL)));
240 }
#define HPFC_sN2H

References array, CONS, hpfc_make_call_statement(), hpfc_name_to_entity(), hpfc_packing_of_current__buffer(), HPFC_sN2H, make_block_statement(), NIL, and STATEMENT.

+ Here is the call graph for this function:

◆ only_io_call()

static void only_io_call ( call  c)
static

Fortran IO intrinsics

declared with FCD

runtime managed

Definition at line 117 of file io-util.c.

118 {
119  entity f = call_function(c);
120  intptr_t is_io = entity_continue_p(f)? 3:
121  io_intrinsic_p(f) || /* Fortran IO intrinsics */
122  hpfc_special_io(f) || /* declared with FCD */
123  hpfc_io_like_function(f);/* runtime managed */
124 
125  pips_debug(5, "call %p (%s): %"PRIdPTR"\n", c, entity_name(f), is_io);
126  Store(current_statement_head(), is_io);
127 }
bool hpfc_special_io(entity f)
Definition: hpfc.c:77
bool hpfc_io_like_function(entity)
Definition: run-time.c:836
#define Store(stat, val)
Definition: io-util.c:56
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
bool entity_continue_p(entity f)
Definition: entity.c:1731
bool io_intrinsic_p(entity e)
rue is a statement s is an io intrinsic
Definition: entity.c:1655
#define entity_name(x)
Definition: ri.h:2790
#define intptr_t
Definition: stdint.in.h:294

References call_function, entity_continue_p(), entity_name, f(), hpfc_io_like_function(), hpfc_special_io(), intptr_t, io_intrinsic_p(), pips_debug, and Store.

Referenced by only_io_mapping().

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

◆ only_io_loop()

static void only_io_loop ( loop  l)
static

Definition at line 110 of file io-util.c.

111 {
112  intptr_t is_io = Load(loop_body(l));
113  pips_debug(5, "loop %p: %"PRIdPTR"\n", l, is_io);
114  Store(current_statement_head(), is_io);
115 }
#define Load(stat)
Definition: io-util.c:53
#define loop_body(x)
Definition: ri.h:1644

References intptr_t, Load, loop_body, pips_debug, and Store.

Referenced by only_io_mapping().

+ Here is the caller graph for this function:

◆ only_io_mapping()

static statement_mapping only_io_mapping ( statement  program,
statement_mapping  map 
)
static

Definition at line 142 of file io-util.c.

145 {
146  stat_bool_map = map;
147 
148  make_current_statement_stack();
149  gen_multi_recurse(program,
150  statement_domain, current_statement_filter, current_statement_rewrite,
157  NULL);
158  free_current_statement_stack();
159  return stat_bool_map;
160 }
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
bool gen_false(__attribute__((unused)) gen_chunk *unused)
Return false and ignore the argument.
Definition: genClib.c:2796
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
static void only_io_call(call c)
Definition: io-util.c:117
static void only_io_sequence(sequence q)
Definition: io-util.c:87
static statement_mapping stat_bool_map
HPFC module by Fabien COELHO.
Definition: io-util.c:51
static void only_io_test(test t)
Definition: io-util.c:102
static void only_io_loop(loop l)
Definition: io-util.c:110
static void only_io_unstructured(unstructured u)
Definition: io-util.c:129
#define test_domain
newgen_entity_domain_defined
Definition: ri.h:418
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
#define unstructured_domain
newgen_type_domain_defined
Definition: ri.h:442
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
#define call_domain
newgen_callees_domain_defined
Definition: ri.h:58
#define sequence_domain
newgen_reference_domain_defined
Definition: ri.h:346

References call_domain, expression_domain, gen_false(), gen_multi_recurse(), gen_null(), gen_true(), loop_domain, only_io_call(), only_io_loop(), only_io_sequence(), only_io_test(), only_io_unstructured(), sequence_domain, stat_bool_map, statement_domain, test_domain, and unstructured_domain.

Referenced by only_io_mapping_initialize().

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

◆ only_io_mapping_initialize()

void only_io_mapping_initialize ( statement  program)
Parameters
programrogram

Definition at line 163 of file io-util.c.

165 {
166  debug_on("HPFC_IO_DEBUG_LEVEL");
168  debug_off();
169 }
void set_only_io_map(statement_mapping)
static statement_mapping only_io_mapping(statement program, statement_mapping map)
Definition: io-util.c:142
#define debug_on(env)
Definition: misc-local.h:157
#define debug_off()
Definition: misc-local.h:160
#define MAKE_STATEMENT_MAPPING()
Definition: newgen-local.h:43

References debug_off, debug_on, MAKE_STATEMENT_MAPPING, only_io_mapping(), and set_only_io_map().

Referenced by set_resources_for_module().

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

◆ only_io_sequence()

static void only_io_sequence ( sequence  q)
static

Definition at line 87 of file io-util.c.

88 {
89  intptr_t is_io;
91  is_io=1;
92  else
93  {
94  is_io=3;
95  MAP(STATEMENT, s, is_io = (is_io & Load(s)), sequence_statements(q));
96  }
97 
98  pips_debug(5, "block %p: %"PRIdPTR"\n", q, is_io);
99  Store(current_statement_head(), is_io);
100 }
#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
static bool host_section_p(list ls)
true if the first statement of a block is a host section marker.
Definition: io-util.c:63
#define sequence_statements(x)
Definition: ri.h:2360

References host_section_p(), intptr_t, Load, MAP, pips_debug, sequence_statements, STATEMENT, and Store.

Referenced by only_io_mapping().

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

◆ only_io_test()

static void only_io_test ( test  t)
static

Definition at line 102 of file io-util.c.

103 {
104  intptr_t is_io=3;
105  is_io = (Load(test_true(t)) & Load(test_false(t)));
106  pips_debug(5, "test %p: %"PRIdPTR"\n", t, is_io);
107  Store(current_statement_head(), is_io);
108 }
#define test_false(x)
Definition: ri.h:2837
#define test_true(x)
Definition: ri.h:2835

References intptr_t, Load, pips_debug, Store, test_false, and test_true.

Referenced by only_io_mapping().

+ Here is the caller graph for this function:

◆ only_io_unstructured()

static void only_io_unstructured ( unstructured  u)
static

Definition at line 129 of file io-util.c.

130 {
131  intptr_t is_io = 3;
133  list blocks = NIL;
134 
135  CONTROL_MAP(ct, is_io = is_io & Load(control_statement(ct)), c, blocks);
137  pips_debug(5, "unstructured %p: %"PRIdPTR"\n", u, is_io);
138  Store(current_statement_head(), (void*)is_io);
139 }
static list blocks
lisp of loops
#define CONTROL_MAP(ctl, code, c, list)
Macro to walk through all the controls reachable from a given control node of an unstructured.
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define control_statement(x)
Definition: ri.h:941

References blocks, CONTROL_MAP, control_statement, gen_free_list(), intptr_t, Load, NIL, pips_debug, Store, and unstructured_control.

Referenced by only_io_mapping().

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

Variable Documentation

◆ stat_bool_map

statement_mapping stat_bool_map = hash_table_undefined
static

HPFC module by Fabien COELHO.

this is enough for the distribution purpose, because more clever analysis would be as checking for the distributablity of the enclosed code. A distribution code dedicated to IO will be implemented later on. only io encoding: 0 - not an IO 1 - is an IO 3 - may be considered as an IO along real IO functions...

Definition at line 51 of file io-util.c.

Referenced by only_io_mapping().