PIPS
call.c File Reference
#include "local-header.h"
+ Include dependency graph for call.c:

Go to the source code of this file.

Functions

list summary_to_proper_reference (call c, reference r)
 these functions must translate external reductions into local ones if must be. More...
 
static list translate_reduction (call c, reduction external_red)
 of reduction More...
 
list translate_reductions (call c)
 of reduction More...
 

Function Documentation

◆ summary_to_proper_reference()

list summary_to_proper_reference ( call  c,
reference  r 
)

these functions must translate external reductions into local ones if must be.

call.c

thus it is similar to summary effects call translations. I do reuse some functions there by generating fake effects... I think they should be cleaned so as to offer reference plus predicate translations, and then would be used by reductions and effects. Fabien. translation of a reference, based on effect translations... such an interface should be available? of reference

persistent!

of effect

of reference

Definition at line 45 of file call.c.

48 {
49  effect e = make_simple_effect(r, /* persistent! */
52  list /* of effect */ lef, /* of reference */ lref = NIL;
53 
54  pips_debug(7, "reference to %s\n", entity_name(reference_variable(r)));
55 
57 
58  FOREACH (EFFECT, ef, lef) {
59  lref = CONS(REFERENCE, effect_any_reference(ef), lref);
60  }
61 
63  gen_free_list(lef);
64  return lref;
65 }
approximation make_approximation(enum approximation_utype tag, void *val)
Definition: effects.c:176
list summary_effect_to_proper_effect(call, effect)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define make_simple_effect(reference, action, approximation)
action make_action_write_memory(void)
To ease the extension of action with action_kind.
Definition: effects.c:1011
@ is_approximation_exact
Definition: effects.h:343
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
void gen_free(gen_chunk *obj)
version without shared_pointers.
Definition: genClib.c:992
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
void gen_map(gen_iter_func_t fp, const list l)
Definition: list.c:172
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#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_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
void(* gen_iter_func_t)(void *)
Definition: newgen_types.h:116
#define UU
Definition: newgen_types.h:98
#define REFERENCE(x)
REFERENCE.
Definition: ri.h:2296
#define reference_variable(x)
Definition: ri.h:2326
#define entity_name(x)
Definition: ri.h:2790
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References CONS, EFFECT, effect_any_reference, entity_name, FOREACH, gen_free(), gen_free_list(), gen_map(), is_approximation_exact, make_action_write_memory(), make_approximation(), make_simple_effect, NIL, pips_debug, REFERENCE, reference_variable, summary_effect_to_proper_effect(), and UU.

Referenced by translate_reduction().

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

◆ translate_reduction()

static list translate_reduction ( call  c,
reduction  external_red 
)
static

of reduction

of reference

of reduction

??? what about effects on commons hidden in the call? I do not know the reference to trust in the effects...

just the backbone, refs are real in the code?

Definition at line 68 of file call.c.

68  {
69 
70  reference ref = reduction_reference(external_red);
72  list /* of reference */ lref = summary_to_proper_reference(c, ref);
73  list /* of reduction */ lrds = NIL;
74 
75  pips_debug(7, "reduction %s[%s] (%td reductions)\n",
76  reduction_name(external_red),
77  entity_name(var), gen_length(lref));
78 
79  FOREACH (REFERENCE, r, lref) {
80  reduction red = copy_reduction(external_red);
81 
84 
87 
90  reduction_trusted(red) = NIL;
91 
92  /* ??? what about effects on commons hidden in the call?
93  * I do not know the reference to trust in the effects...
94  */
96 
97  pips_debug(7, "reduction on %s translated on %s\n",
99 
100  lrds = CONS(REDUCTION, red, lrds);
101  }
102 
103  gen_free_list(lref); /* just the backbone, refs are real in the code? */
104  return lrds;
105 }
reduction copy_reduction(reduction p)
REDUCTION.
void free_reference(reference p)
Definition: ri.c:2050
reference copy_reference(reference p)
REFERENCE.
Definition: ri.c:2047
preference make_preference(reference a1)
Definition: ri.c:1862
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
list summary_to_proper_reference(call c, reference r)
these functions must translate external reductions into local ones if must be.
Definition: call.c:45
size_t gen_length(const list l)
Definition: list.c:150
#define reduction_variable(r)
shorthands for REDUCTION:
#define REDUCTION(x)
REDUCTION.
#define reduction_dependences(x)
#define reduction_reference(x)
#define reduction_trusted(x)
#define PREFERENCE(x)
PREFERENCE.
Definition: ri.h:2073
static char * reduction_name(int kind)

References CONS, copy_reduction(), copy_reference(), entity_name, FOREACH, free_reference(), gen_free(), gen_free_list(), gen_length(), gen_map(), make_preference(), NIL, pips_debug, PREFERENCE, REDUCTION, reduction_dependences, reduction_name(), reduction_reference, reduction_trusted, reduction_variable, ref, REFERENCE, reference_variable, and summary_to_proper_reference().

Referenced by translate_reductions().

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

◆ translate_reductions()

list translate_reductions ( call  c)

of reduction

Returns
the list of proper reduction applicable to the call according to the summary reduction computed earlier.
Parameters
c,thecall to check for proper reductions

of reduction

Definition at line 112 of file call.c.

114 {
115  entity fun = call_function(c);
116  list /* of reduction */ lr = NIL;
117 
118  if (!entity_module_p(fun))
119  return NIL;
120 
122  lr = gen_nconc(translate_reduction(c, r), lr);
123  }
124 
125  return lr;
126 }
static list translate_reduction(call c, reduction external_red)
of reduction
Definition: call.c:68
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
reductions load_summary_reductions(entity f)
Fortran 77 anti aliasing rules implies that sg that looks like a reduction within a subroutine can be...
Definition: reductions.c:55
#define reductions_list(x)
bool entity_module_p(entity e)
Definition: entity.c:683
#define call_function(x)
Definition: ri.h:709

References call_function, entity_module_p(), FOREACH, gen_nconc(), load_summary_reductions(), NIL, REDUCTION, reductions_list, and translate_reduction().

Referenced by pr_call_flt().

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