PIPS
icm.c File Reference
#include "local.h"
#include "prettyprint.h"
#include "effects-generic.h"
#include "effects-simple.h"
+ Include dependency graph for icm.c:

Go to the source code of this file.

Macros

#define NB_SIMPLIFY_PASSES   1
 Set to 2 if we want to simplify in two passes. More...
 
#define FLOW_DEPENDANCE   1
 
#define ANTI_DEPENDANCE   2
 
#define OUTPUT_DEPENDANCE   4
 
#define INPUT_DEPENDANCE   8
 
#define ALL_DEPENDANCES   (FLOW_DEPENDANCE|ANTI_DEPENDANCE|OUTPUT_DEPENDANCE)
 

Functions

statement vertex_to_statement (vertex v)
 Vertex_to_statement looks for the statement that is pointed to by vertex v. More...
 
void dump_sef (statement_effects se)
 icm.c More...
 
static void prettyprint_conflict (FILE *fd, conflict c)
 
static void prettyprint_successor (FILE *fd, successor su)
 
static void prettyprint_vertex (FILE *fd, vertex v)
 
void print_list_entities (list l)
 
static set vertices_to_statements (list vl, set ss)
 of statement More...
 
static set invariant_vertex_to_invariant_entities (vertex v, set rs)
 of entity More...
 
static bool statement_mark (statement s)
 
static bool loop_level_in (loop l)
 
static void loop_level_out (__attribute__((unused)) loop l)
 
static bool action_dependance_p (conflict c, int dependance_type)
 
static bool dependance_vertices_p (vertex v1, vertex v2, int dependance_type, int level)
 Test the existence of a given dependence between two vertices v1, v2. More...
 
static bool exist_non_self_dependance_from_vertex_p (vertex v, int dependance_type, int level)
 
static list remove_dependance_from_levels (list levels, int level_min, int level_max)
 of level More...
 
static list remove_dependance_from_conflicts (list conflicts, int dependance_type, int level_min, int level_max)
 of conflict More...
 
static list remove_dependances_from_successors (list successors, vertex v2, int dependance_type, int level_min, int level_max)
 of successor More...
 
static void remove_dependance (vertex v1, vertex v2, int dependance_type, int level_min, int level_max)
 
static bool common_ignore_this_vertex (set region, vertex v)
 
static bool icm_ignore_this_successor (vertex v, set region, successor su, int level)
 
static bool invariant_ignore_this_successor (vertex v, set region, successor su, int level)
 
static bool statement_depend_of_indices_p (statement st, list indices, int level)
 
static bool inv_entity_filter (entity e)
 
static bool ref_flt (reference r)
 
static bool expressions_invariant_p (list le)
 
static bool vertex_partially_invariant_p (vertex v, __attribute__((unused)) graph g, __attribute__((unused)) int level, __attribute__((unused)) set invariant)
 
static bool vertex_invariant_p (vertex v, graph g, int level, set region, set invariant)
 
static void SimplifyInvariantVertex (vertex v, set region, int level)
 
static graph DoInvariantsStatements (list lsccs, graph g, set region, int level, set partially_invariant)
 
static bool vertex_redundant_p (vertex v, __attribute__((unused)) graph g, int level, set region, set partially_invariant, set redundant)
 
static void SimplifyRedundantVertex (vertex v, set region, int level)
 
static graph DoRedundantsStatements (list lsccs, graph g, set region, int level, set partially_invariant)
 
static graph SimplifyGraph (graph g, set region, int level, unsigned int count)
 
static graph SupressDependances (graph g, set region, int level, unsigned int count)
 
static bool does_it_depend (statement s)
 Set whether s depends from enclosing indices. More...
 
static bool push_depending_index (loop l)
 
static void pop_depending_index (loop l)
 
static bool drop_it (loop l)
 
static expression compute_final_index_value (expression m1, expression m2, expression m3)
 
static bool icm_loop_rwt (loop l)
 
static void drop_dummy_loops (statement s)
 
static statement icm_codegen (statement stat, graph g, set region, int level, bool task_parallelize_p)
 
bool invariant_code_motion (const char *module_name)
 Phase that hoists loop invariant code out of loops. More...
 

Variables

static int reference_level =0
 
static bool expression_invariant = false
 
static set invariant_entities = set_undefined
 of entity More...
 
static list indices = NIL
 
static int depth = 0
 
static list depending_indices
 of entity More...
 
static bool it_depends
 

Macro Definition Documentation

◆ ALL_DEPENDANCES

#define ALL_DEPENDANCES   (FLOW_DEPENDANCE|ANTI_DEPENDANCE|OUTPUT_DEPENDANCE)

Definition at line 56 of file icm.c.

◆ ANTI_DEPENDANCE

#define ANTI_DEPENDANCE   2

Definition at line 53 of file icm.c.

◆ FLOW_DEPENDANCE

#define FLOW_DEPENDANCE   1

Definition at line 52 of file icm.c.

◆ INPUT_DEPENDANCE

#define INPUT_DEPENDANCE   8

Definition at line 55 of file icm.c.

◆ NB_SIMPLIFY_PASSES

#define NB_SIMPLIFY_PASSES   1

Set to 2 if we want to simplify in two passes.

Definition at line 49 of file icm.c.

◆ OUTPUT_DEPENDANCE

#define OUTPUT_DEPENDANCE   4

Definition at line 54 of file icm.c.

Function Documentation

◆ action_dependance_p()

static bool action_dependance_p ( conflict  c,
int  dependance_type 
)
static

Definition at line 258 of file icm.c.

259 {
262 
263  return (((dependance_type & FLOW_DEPENDANCE) &&
264  ((action_write_p(s) && action_read_p(k)))) ||
265  ((dependance_type & ANTI_DEPENDANCE) &&
266  ((action_read_p(s) && action_write_p(k)))) ||
267  ((dependance_type & OUTPUT_DEPENDANCE) &&
268  ((action_write_p(s) && action_write_p(k)))) ||
269  ((dependance_type & INPUT_DEPENDANCE) &&
270  ((action_read_p(s) && action_read_p(k)))));
271 }
#define conflict_sink(x)
Definition: dg.h:167
#define conflict_source(x)
Definition: dg.h:165
#define effect_action(x)
Definition: effects.h:642
#define action_write_p(x)
Definition: effects.h:314
#define action_read_p(x)
Definition: effects.h:311
#define INPUT_DEPENDANCE
Definition: icm.c:55
#define FLOW_DEPENDANCE
Definition: icm.c:52
#define OUTPUT_DEPENDANCE
Definition: icm.c:54
#define ANTI_DEPENDANCE
Definition: icm.c:53

References action_read_p, action_write_p, ANTI_DEPENDANCE, conflict_sink, conflict_source, effect_action, FLOW_DEPENDANCE, INPUT_DEPENDANCE, and OUTPUT_DEPENDANCE.

Referenced by dependance_vertices_p(), and remove_dependance_from_conflicts().

+ Here is the caller graph for this function:

◆ common_ignore_this_vertex()

static bool common_ignore_this_vertex ( set  region,
vertex  v 
)
static
Parameters
regionof statement

Definition at line 536 of file icm.c.

537 {
538  return(!set_belong_p(region, (char *) vertex_to_statement(v)));
539 }
#define region
simulation of the type region
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
Definition: util.c:45
bool set_belong_p(const set, const void *)
Definition: set.c:194

References region, set_belong_p(), and vertex_to_statement().

Referenced by icm_ignore_this_successor(), invariant_ignore_this_successor(), SimplifyGraph(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), and SupressDependances().

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

◆ compute_final_index_value()

static expression compute_final_index_value ( expression  m1,
expression  m2,
expression  m3 
)
static

max of (val_e2, 0)

memory leak

Definition at line 1254 of file icm.c.

1255 {
1256  expression result;
1257  expression E0 = make_op_exp("-", m2, copy_expression(m1));
1258  expression E1 = make_op_exp("+", E0, copy_expression(m3));
1259  expression E2 = make_op_exp("/", E1, copy_expression(m3));
1260 
1261  if (expression_constant_p(E2)) {
1262  int val_E2 = expression_to_int(E2);
1263 
1264  /* max of (val_e2, 0) */
1265  if (val_E2 > 0) {
1266  expression E3 = make_op_exp("*", E2, m3);
1267  result = make_op_exp("+", E3, m1);
1268  }
1269  else {
1270  result = m1;
1271  free_expression(m3);
1272  }
1273  }
1274  else {
1275  expression zero = int_to_expression(0);
1276  expression p_int, E3, E4;
1277 
1279  E2);
1280 
1282  p_int,
1283  zero);
1284  E4 = make_op_exp("*", E3, m3);
1285  result = make_op_exp("+", m1, E4);
1286  }
1287 
1288  /* memory leak */
1289 
1290  return result;
1291 }
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
void free_expression(expression p)
Definition: ri.c:853
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
#define MAX_OPERATOR_NAME
#define INT_GENERIC_CONVERSION_NAME
generic conversion names.
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
int expression_to_int(expression exp)
================================================================
Definition: expression.c:2205
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
Definition: expression.c:354
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
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
Definition: expression.c:2012
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342

References copy_expression(), entity_intrinsic(), expression_constant_p(), expression_to_int(), free_expression(), INT_GENERIC_CONVERSION_NAME, int_to_expression(), make_op_exp(), MakeBinaryCall(), MakeUnaryCall(), and MAX_OPERATOR_NAME.

Referenced by icm_loop_rwt().

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

◆ dependance_vertices_p()

static bool dependance_vertices_p ( vertex  v1,
vertex  v2,
int  dependance_type,
int  level 
)
static

Test the existence of a given dependence between two vertices v1, v2.

Note:

  • dependance_type is a bitfield which contains the kind of dependence,
  • level is the minimum level wanted.

Definition at line 282 of file icm.c.

283 {
284  ifdebug(9) {
285  debug(9, "dependance_vertices_p", "");
286 
287  if (dependance_type & FLOW_DEPENDANCE) fprintf(stderr, "F ");
288  if (dependance_type & ANTI_DEPENDANCE) fprintf(stderr, "A ");
289  if (dependance_type & OUTPUT_DEPENDANCE) fprintf(stderr, "O ");
290  if (dependance_type & INPUT_DEPENDANCE) fprintf(stderr, "I ");
291  fprintf(stderr, "dep. at level >= %d ", level);
292  fprintf(stderr,
293  "between %02td and %02td ? ",
296  }
297 
298  MAP(SUCCESSOR, su, {
299  vertex s = successor_vertex(su);
300  if (s == v2) {
301  MAP(CONFLICT, c, {
302  if (conflict_cone(c) != cone_undefined) {
303  MAP(INT, l, {
304  if (l >= level) {
305  if (action_dependance_p(c, dependance_type))
306  {
307  ifdebug(9) { fprintf(stderr, "yes\n"); }
308  return true;
309  }
310  }
311  }, cone_levels(conflict_cone(c)));
312  }
314  }
315  }, vertex_successors(v1));
316 
317  ifdebug(9) { fprintf(stderr, "no\n"); }
318  return false;
319 }
@ INT
Definition: atomic.c:48
#define cone_levels(x)
Definition: dg.h:128
#define CONFLICT(x)
CONFLICT.
Definition: dg.h:134
#define dg_arc_label_conflicts(x)
Definition: dg.h:201
#define cone_undefined
Definition: dg.h:104
#define conflict_cone(x)
Definition: dg.h:169
#define successor_vertex(x)
Definition: graph.h:118
#define successor_arc_label(x)
Definition: graph.h:116
#define vertex_successors(x)
Definition: graph.h:154
#define SUCCESSOR(x)
SUCCESSOR.
Definition: graph.h:86
#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 action_dependance_p(conflict c, int dependance_type)
Definition: icm.c:258
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
#define statement_number(x)
Definition: ri.h:2452
#define level
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47

References action_dependance_p(), ANTI_DEPENDANCE, cone_levels, cone_undefined, CONFLICT, conflict_cone, debug(), dg_arc_label_conflicts, FLOW_DEPENDANCE, fprintf(), ifdebug, INPUT_DEPENDANCE, INT, level, MAP, OUTPUT_DEPENDANCE, statement_number, SUCCESSOR, successor_arc_label, successor_vertex, vertex_successors, and vertex_to_statement().

Referenced by exist_non_self_dependance_from_vertex_p(), icm_ignore_this_successor(), invariant_ignore_this_successor(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), vertex_invariant_p(), and vertex_redundant_p().

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

◆ does_it_depend()

static bool does_it_depend ( statement  s)
static

Set whether s depends from enclosing indices.

Definition at line 1202 of file icm.c.

1203 {
1205  if (it_depends) gen_recurse_stop(NULL);
1206  return true;
1207 }
void gen_recurse_stop(void *obj)
Tells the recursion not to go in this object.
Definition: genClib.c:3251
static bool it_depends
Definition: icm.c:1196
static list depending_indices
of entity
Definition: icm.c:1195
static bool statement_depend_of_indices_p(statement st, list indices, int level)
Definition: icm.c:596

References depending_indices, gen_recurse_stop(), it_depends, and statement_depend_of_indices_p().

Referenced by drop_it().

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

◆ DoInvariantsStatements()

static graph DoInvariantsStatements ( list  lsccs,
graph  g,
set  region,
int  level,
set  partially_invariant 
)
static

of statement

of vertex

Group of vertices : all are variants

One statement...

which is invariant

Added to the list

Invariant is partially invariant...

NL: I can't explain why we have to add the declaration statement as an invariant statement, but it's seem that it work, and permit some optimizations...

Added to the list

Invariant is partially invariant...

NL: I'm not totally sure of the explanation I propose below The variable declared inside the loop can be consider as invariant variable because there values only be important inside the loop and not outside. so from the outside of the loop these variables doesn't exist and so can be consider as invariant?

Parameters
lsccsof scc
regionof statement
partially_invariantof statement

Definition at line 848 of file icm.c.

853 {
854  set /* of statement */ invariant = set_make(set_pointer);
855 
856  FOREACH(SCC, s, lsccs) {
857  list /* of vertex */ lv = scc_vertices(s);
858 
859  if (gen_length(lv) > 1) {
860  /* Group of vertices : all are variants */
861  }
862  else {
863  /* One statement... */
864  vertex v = VERTEX(CAR(lv));
866 
867  if (!declaration_statement_p(st)) {
868  if (vertex_invariant_p(v, g, level, region, invariant)) {
869  /* which is invariant */
871 
872  /* Added to the list */
873  invariant = set_add_element(invariant,
874  invariant,
875  (char *) st);
876 
877  /* Invariant is partially invariant... */
878  partially_invariant = set_add_element(partially_invariant,
879  partially_invariant,
880  (char *) st);
881 
885 
886  }
887  else if (vertex_partially_invariant_p(v, g, level, invariant)) {
888  partially_invariant =
889  set_add_element(partially_invariant,
890  partially_invariant,
891  (char *) st);
892  }
893  }
894  else {
895  //If it's an declaration, so we work on environment domain
896  // NL: It's a workaround, and not totally sure that it always work, not enough test case
897 
898  /* NL: I can't explain why we have to add the declaration statement
899  * as an invariant statement, but it's seem that it work,
900  * and permit some optimizations...
901  */
902  /* Added to the list */
903  invariant = set_add_element(invariant,
904  invariant,
905  (char *) st);
906 
907  /* Invariant is partially invariant... */
908  partially_invariant = set_add_element(partially_invariant,
909  partially_invariant,
910  (char *) st);
911 
912  /* NL: I'm not totally sure of the explanation I propose below
913  * The variable declared inside the loop can be consider as invariant variable
914  * because there values only be important inside the loop and not outside.
915  * so from the outside of the loop these variables doesn't exist and
916  * so can be consider as invariant?
917  */
921  }
922  }
923  }
924 
925  set_free(invariant);
926 
927  return g;
928 }
#define SCC(x)
SCC.
Definition: dg.h:315
#define scc_vertices(x)
Definition: dg.h:345
#define VERTEX(x)
VERTEX.
Definition: graph.h:122
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 FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
Definition: statement.c:224
static bool vertex_invariant_p(vertex v, graph g, int level, set region, set invariant)
Definition: icm.c:736
static set invariant_vertex_to_invariant_entities(vertex v, set rs)
of entity
Definition: icm.c:178
static set invariant_entities
of entity
Definition: icm.c:64
static void SimplifyInvariantVertex(vertex v, set region, int level)
Definition: icm.c:806
static bool vertex_partially_invariant_p(vertex v, __attribute__((unused)) graph g, __attribute__((unused)) int level, __attribute__((unused)) set invariant)
Definition: icm.c:668
void set_free(set)
Definition: set.c:332
@ set_pointer
Definition: newgen_set.h:44
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References CAR, declaration_statement_p(), FOREACH, gen_length(), invariant_entities, invariant_vertex_to_invariant_entities(), level, region, SCC, scc_vertices, set_add_element(), set_free(), set_make(), set_pointer, SimplifyInvariantVertex(), VERTEX, vertex_invariant_p(), vertex_partially_invariant_p(), and vertex_to_statement().

Referenced by SupressDependances().

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

◆ DoRedundantsStatements()

static graph DoRedundantsStatements ( list  lsccs,
graph  g,
set  region,
int  level,
set  partially_invariant 
)
static

of statement

of vertex

Group of vertices : all are no redundant

One statement...

which is redundant

Parameters
lsccsof scc
regionof statement
partially_invariantof statement

Definition at line 1045 of file icm.c.

1050 {
1051  set /* of statement */ redundant = set_make(set_pointer);
1052 
1053  MAP(SCC, s, {
1054  list /* of vertex */ lv = scc_vertices(s);
1055 
1056  if (gen_length(lv) > 1) {
1057  /* Group of vertices : all are no redundant */
1058  }
1059  else {
1060  /* One statement... */
1061  vertex v = VERTEX(CAR(lv));
1063 
1064  if (set_belong_p(partially_invariant, (char *) st)) {
1065  if (vertex_redundant_p(v, g, level,
1066  region,
1067  partially_invariant,
1068  redundant)) {
1069  /* which is redundant */
1071 
1073  redundant,
1074  (char *) st);
1075  }
1076  }
1077  }
1078  }, lsccs);
1079 
1081 
1082  return g;
1083 }
static bool vertex_redundant_p(vertex v, __attribute__((unused)) graph g, int level, set region, set partially_invariant, set redundant)
Definition: icm.c:935
static void SimplifyRedundantVertex(vertex v, set region, int level)
Definition: icm.c:1005
static int redundant(Pproblem XX, int i1, int i2)
Definition: isolve.c:720

References CAR, gen_length(), level, MAP, redundant(), region, SCC, scc_vertices, set_add_element(), set_belong_p(), set_free(), set_make(), set_pointer, SimplifyRedundantVertex(), VERTEX, vertex_redundant_p(), and vertex_to_statement().

Referenced by SupressDependances().

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

◆ drop_dummy_loops()

static void drop_dummy_loops ( statement  s)
static

WARNING : We must recompute proper_effects for the program !!! So we directly call the pass !!!!!

Definition at line 1350 of file icm.c.

1351 {
1352  /* WARNING :
1353  * We must recompute proper_effects for the program !!!
1354  * So we directly call the pass !!!!!
1355  */
1359 
1360 
1361  make_stmt_stack();
1362 
1366  NULL);
1367 
1368  free_stmt_stack();
1371 }
static void stmt_rewrite(statement s)
Definition: graph.c:232
static bool stmt_filter(statement s)
modifies global var current_caller_stmt
Definition: alias_pairs.c:222
void proper_effects_of_module_statement(statement)
void reset_proper_rw_effects(void)
void init_proper_rw_effects(void)
void generic_effects_reset_all_methods(void)
void set_methods_for_proper_simple_effects(void)
void gen_multi_recurse(void *o,...)
Multi recursion visitor function.
Definition: genClib.c:3428
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
static bool icm_loop_rwt(loop l)
Definition: icm.c:1294
#define loop_domain
newgen_language_domain_defined
Definition: ri.h:218
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362

References gen_multi_recurse(), gen_null(), generic_effects_reset_all_methods(), icm_loop_rwt(), init_proper_rw_effects(), loop_domain, proper_effects_of_module_statement(), reset_proper_rw_effects(), set_methods_for_proper_simple_effects(), statement_domain, stmt_filter(), and stmt_rewrite().

Referenced by icm_codegen().

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

◆ drop_it()

static bool drop_it ( loop  l)
static

assert?

Definition at line 1228 of file icm.c.

1229 {
1231  {
1233  it_depends = false;
1237  NULL);
1238  depending_indices = NIL; /* assert? */
1239  return !it_depends;
1240  }
1241 
1242  return false;
1243 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
static bool does_it_depend(statement s)
Set whether s depends from enclosing indices.
Definition: icm.c:1202
static bool push_depending_index(loop l)
Definition: icm.c:1210
static void pop_depending_index(loop l)
Definition: icm.c:1217
#define loop_execution(x)
Definition: ri.h:1648
#define execution_parallel_p(x)
Definition: ri.h:1211

References depending_indices, does_it_depend(), execution_parallel_p, gen_multi_recurse(), gen_null(), it_depends, loop_domain, loop_execution, NIL, pop_depending_index(), push_depending_index(), and statement_domain.

Referenced by icm_loop_rwt().

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

◆ dump_sef()

void dump_sef ( statement_effects  se)

icm.c

Parameters
see

Definition at line 75 of file icm.c.

76 {
77  fprintf(stderr, "\n");
78  STATEMENT_EFFECTS_MAP(s, e, {
79  fprintf(stderr,
80  "%02td (%p) -> (%td) : ",
81  statement_number(s),
82  s,
84 
85  MAP(EFFECT, e, {
86  print_words(stderr, words_effect(e));
87  fprintf(stderr, "(%p), ", e);
88  }, effects_effects(e));
89 
90  fprintf(stderr, "\n");
91  }, se);
92 }
list words_effect(effect)
#define STATEMENT_EFFECTS_MAP(k, v, c, f)
Definition: effects.h:1057
#define effects_effects(x)
Definition: effects.h:710
#define EFFECT(x)
EFFECT.
Definition: effects.h:608
void print_words(FILE *fd, cons *lw)
Definition: print.c:263

References EFFECT, effects_effects, fprintf(), gen_length(), MAP, print_words(), STATEMENT_EFFECTS_MAP, statement_number, and words_effect().

+ Here is the call graph for this function:

◆ exist_non_self_dependance_from_vertex_p()

static bool exist_non_self_dependance_from_vertex_p ( vertex  v,
int  dependance_type,
int  level 
)
static

Definition at line 327 of file icm.c.

330 {
331  MAP(SUCCESSOR, su, {
332  vertex y = successor_vertex(su);
333  if (v != y) {
334  if (dependance_vertices_p(v, y, dependance_type, level))
335  return true;
336  }
337  }, vertex_successors(v));
338 
339  return false;
340 }
static bool dependance_vertices_p(vertex v1, vertex v2, int dependance_type, int level)
Test the existence of a given dependence between two vertices v1, v2.
Definition: icm.c:282

References dependance_vertices_p(), level, MAP, SUCCESSOR, successor_vertex, and vertex_successors.

Referenced by SimplifyInvariantVertex(), and SimplifyRedundantVertex().

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

◆ expressions_invariant_p()

static bool expressions_invariant_p ( list  le)
static
Parameters
leof expression

Definition at line 648 of file icm.c.

649 {
650  MAP(EXPRESSION, exp, {
651  expression_invariant = true;
652 
654 
655  if (!expression_invariant) {
656  return false;
657  }
658  }, le);
659 
660  return true;
661 }
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
static bool expression_invariant
Definition: icm.c:63
static bool ref_flt(reference r)
Definition: icm.c:642
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define reference_domain
newgen_range_domain_defined
Definition: ri.h:338
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References exp, EXPRESSION, expression_invariant, gen_null(), gen_recurse, MAP, ref_flt(), and reference_domain.

Referenced by vertex_partially_invariant_p().

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

◆ icm_codegen()

static statement icm_codegen ( statement  stat,
graph  g,
set  region,
int  level,
bool  task_parallelize_p 
)
static

Compute has_level hash and has_indices tables

LOOP

STATEMENT

Simplify the dependance graph

Definir le mapping entre les vertex originaux et les vertex copies

CodeGenerate reload the proper_rw_effects table, so we must reset before...

Generate the code (CodeGenerate don't use the first parameter...)

big hack

Remove dummy loops.

Parameters
regionof statement

Definition at line 1382 of file icm.c.

1387 {
1388  statement result = statement_undefined;
1389  graph simplified_graph = graph_undefined;
1390 
1392 
1393  debug_on("ICM_DEBUG_LEVEL");
1394  ifdebug(4) {
1395  pips_debug(9, "ICM_DEBUG_LEVEL start\n");
1396  pips_debug(4, "on statement:\n");
1397  print_statement(stat);
1398  }
1399 
1401  db_get_memory_resource(DBR_PROPER_EFFECTS,
1403  true));
1404 
1405  /* Compute has_level hash and has_indices tables */
1406 
1407  init_has_level();
1408  make_has_indices_map();
1409 
1410  indices = NIL;
1411 
1412  gen_multi_recurse(stat,
1414  statement_domain, statement_mark, gen_null, /* STATEMENT */
1415  NULL);
1416 
1418 
1419  /* Simplify the dependance graph */
1420 
1421  simplified_graph = copy_graph(g);
1422 
1423  /* Definir le mapping entre les vertex originaux et les vertex copies */
1424 
1425  ifdebug(4) {
1426  pips_debug(4, "Original graph:\n");
1429  simplified_graph);
1430  }
1431 
1433 
1434  simplified_graph = SimplifyGraph(simplified_graph,
1435  region,
1436  level,
1438 
1440 
1441  ifdebug(4) {
1442  pips_debug(4, "Simplified graph:\n");
1445  simplified_graph);
1446  }
1447 
1448  close_has_level();
1449  free_has_indices_map();
1451  /* CodeGenerate reload the
1452  * proper_rw_effects table, so we must
1453  * reset before... */
1454 
1455  pips_debug(9, "ICM_DEBUG_LEVEL stop\n");
1456  debug_off();
1457 
1458  /* Generate the code (CodeGenerate don't use the first
1459  * parameter...) */
1460  result = CodeGenerate(/* big hack */ statement_undefined,
1461  simplified_graph,
1462  region,
1463  level,
1464  task_parallelize_p);
1465  free_graph(simplified_graph);
1466 
1467  ifdebug(4) {
1468  pips_debug(4, "Intermediate code:\n");
1469  print_statement(result);
1470  }
1471 
1472  /* Remove dummy loops. */
1473  drop_dummy_loops(result);
1474 
1475  ifdebug(4) {
1476  pips_debug(4, "Final code:\n");
1477  print_statement(result);
1478  }
1479 
1480  return result;
1481 }
void free_graph(graph p)
Definition: graph.c:23
graph copy_graph(graph p)
GRAPH.
Definition: graph.c:20
void set_proper_rw_effects(statement_effects)
#define graph_undefined
Definition: graph.h:60
const char * get_current_module_name(void)
Get the name of the current module.
Definition: static.c:121
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
static bool loop_level_in(loop l)
Definition: icm.c:227
static void drop_dummy_loops(statement s)
Definition: icm.c:1350
#define NB_SIMPLIFY_PASSES
Set to 2 if we want to simplify in two passes.
Definition: icm.c:49
static int reference_level
Definition: icm.c:61
static list indices
Definition: icm.c:204
static graph SimplifyGraph(graph g, set region, int level, unsigned int count)
Definition: icm.c:1092
static bool statement_mark(statement s)
Definition: icm.c:213
static void loop_level_out(__attribute__((unused)) loop l)
Definition: icm.c:242
#define debug_on(env)
Definition: misc-local.h:157
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define debug_off()
Definition: misc-local.h:160
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
#define statement_undefined
Definition: ri.h:2419
statement CodeGenerate(statement __attribute__((unused)) stat, graph g, set region, int l, bool task_parallelize_p)
This function implements Allen & Kennedy's algorithm.
Definition: codegen.c:393
void prettyprint_dependence_graph(FILE *, statement, graph)
Print all edges and arcs.
Definition: util.c:177

References CodeGenerate(), copy_graph(), db_get_memory_resource(), debug_off, debug_on, drop_dummy_loops(), free_graph(), gen_free_list(), gen_multi_recurse(), gen_null(), get_current_module_name(), graph_undefined, ifdebug, indices, invariant_entities, level, loop_domain, loop_level_in(), loop_level_out(), NB_SIMPLIFY_PASSES, NIL, pips_debug, prettyprint_dependence_graph(), print_statement(), reference_level, region, reset_proper_rw_effects(), set_free(), set_make(), set_pointer, set_proper_rw_effects(), SimplifyGraph(), statement_domain, statement_mark(), and statement_undefined.

Referenced by invariant_code_motion().

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

◆ icm_ignore_this_successor()

static bool icm_ignore_this_successor ( vertex  v,
set  region,
successor  su,
int  level 
)
static
Parameters
regionof statement

Definition at line 547 of file icm.c.

551 {
553  return(true);
554 
555  if (!dependance_vertices_p(v,
556  successor_vertex(su),
558  level))
559  return (true);
560 
561  return false;
562 }
static bool common_ignore_this_vertex(set region, vertex v)
Definition: icm.c:536
#define ALL_DEPENDANCES
Definition: icm.c:56

References ALL_DEPENDANCES, common_ignore_this_vertex(), dependance_vertices_p(), level, region, and successor_vertex.

Referenced by SimplifyGraph().

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

◆ icm_loop_rwt()

static bool icm_loop_rwt ( loop  l)
static

Assume here that index is a scalar variable... :-)

memory leak...

Definition at line 1294 of file icm.c.

1295 {
1296  statement head = stmt_head();
1297 
1298  ifdebug(5) {
1299  fprintf(stderr, "TEST : loop on %s (statement %td):\n",
1300  entity_name(loop_index(l)),
1301  statement_number(head));
1302  }
1303 
1304  if (drop_it(l))
1305  {
1306  statement index_statement;
1307  statement body = loop_body(l);
1308 
1309  expression index, m1, m2, m3;
1310 
1314 
1315  /* Assume here that index is a scalar variable... :-) */
1316  pips_assert("icm_loop_rwt", entity_scalar_p(loop_index(l)));
1317 
1318  index = make_factor_expression(1, loop_index(l));
1319 
1320  index_statement =
1321  make_assign_statement(index,
1322  compute_final_index_value(m1, m2, m3));
1323 
1326 
1327  pips_debug(5, "-> loop on %s removed (statement %td)\n",
1328  entity_name(loop_index(l)),
1329  statement_number(head));
1330 
1331  /* memory leak... */
1332  }
1333  else {
1334  pips_debug(5, "-> loop on %s NOT removed (statement %td)\n",
1335  entity_name(loop_index(l)),
1336  statement_number(head));
1337  }
1338 
1339  return true;
1340 }
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106
statement make_assign_statement(expression, expression)
Definition: statement.c:583
statement update_statement_instruction(statement, instruction)
Replace the instruction in statement s by instruction i.
Definition: statement.c:3039
static expression compute_final_index_value(expression m1, expression m2, expression m3)
Definition: icm.c:1254
static bool drop_it(loop l)
Definition: icm.c:1228
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define make_statement_list(stats...)
easy list constructor
expression make_factor_expression(int coeff, entity vari)
Some functions to generate expressions from vectors and constraint systems.
Definition: expression.c:1631
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define loop_body(x)
Definition: ri.h:1644
#define range_upper(x)
Definition: ri.h:2290
#define range_increment(x)
Definition: ri.h:2292
#define instruction_undefined
Definition: ri.h:1454
#define entity_name(x)
Definition: ri.h:2790
#define range_lower(x)
Definition: ri.h:2288
#define statement_instruction(x)
Definition: ri.h:2458
#define loop_range(x)
Definition: ri.h:1642
#define loop_index(x)
Definition: ri.h:1640

References compute_final_index_value(), copy_expression(), drop_it(), entity_name, entity_scalar_p(), fprintf(), ifdebug, instruction_undefined, loop_body, loop_index, loop_range, make_assign_statement(), make_factor_expression(), make_instruction_block(), make_statement_list, pips_assert, pips_debug, range_increment, range_lower, range_upper, statement_instruction, statement_number, and update_statement_instruction().

Referenced by drop_dummy_loops().

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

◆ inv_entity_filter()

static bool inv_entity_filter ( entity  e)
static

Definition at line 635 of file icm.c.

636 {
639  return true;
640 }

References expression_invariant, gen_recurse_stop(), invariant_entities, and set_belong_p().

Referenced by ref_flt().

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

◆ invariant_code_motion()

bool invariant_code_motion ( const char *  module_name)

Phase that hoists loop invariant code out of loops.

Parameters
[in]module_name
Returns
true because everything should go fine

Prepare some stuffs and call icm_codegen...

Parameters
module_nameodule_name

Definition at line 1495 of file icm.c.

1496 {
1500 
1501  set_bool_property( "GENERATE_NESTED_PARALLEL_LOOPS", true );
1502  set_bool_property( "RICE_DATAFLOW_DEPENDENCE_ONLY", false );
1503 
1505  db_get_memory_resource(DBR_CODE,
1506  module_name,
1507  true));
1508 
1510 
1512 
1513  debug_on("ICM_DEBUG_LEVEL");
1514 
1515  ifdebug(7)
1516  {
1517  fprintf(stderr,
1518  "\nTesting NewGen consistency for initial code %s:\n",
1519  module_name);
1521  fprintf(stderr," NewGen consistent statement\n");
1522  }
1523 
1524  ifdebug(1) {
1525  pips_debug(1, "original sequential code:\n\n");
1527  }
1528 
1529  if (graph_undefined_p(dg)) {
1530  dg = (graph) db_get_memory_resource(DBR_DG, module_name, true);
1531  }
1532  else {
1533  pips_internal_error("dg should be undefined");
1534  }
1535 
1536  enclosing = 0;
1538 
1539  ifdebug(7) {
1540  fprintf(stderr, "\ntransformed code %s:",module_name);
1542  fprintf(stderr," gen consistent ");
1543  }
1544 
1545  // Uselessly reinitialize ordering_to_statement, even if it not set...
1548 
1550 
1551  dg = graph_undefined;
1555 
1556  debug_off();
1557  return true;
1558 }
bool statement_consistent_p(statement p)
Definition: ri.c:2195
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
Definition: chains.c:124
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
struct _newgen_struct_graph_ * graph
Definition: graph.h:31
#define graph_undefined_p(x)
Definition: graph.h:61
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
statement get_current_module_statement(void)
Get the current module statement.
Definition: static.c:208
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
static statement icm_codegen(statement stat, graph g, set region, int level, bool task_parallelize_p)
Definition: icm.c:1382
static statement mod_stat
We want to keep track of the current statement inside the recurse.
Definition: impact_check.c:41
#define pips_internal_error
Definition: misc-local.h:149
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
Definition: ordering.c:172
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
static char * module
Definition: pips.c:74
void set_bool_property(const char *, bool)
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
Definition: reorder.c:244
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
int enclosing
This is an horrendous hack.
Definition: rice.c:67
statement rice_statement(statement stat, int l, statement(*codegen_fun)(statement, graph, set, int, bool))
Definition: rice.c:82

References clean_up_sequences(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, dg, enclosing, fprintf(), get_current_module_statement(), graph_undefined, graph_undefined_p, icm_codegen(), ifdebug, local_name_to_top_level_entity(), mod_stat, module, module_name(), module_reorder(), pips_debug, pips_internal_error, print_statement(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), rice_statement(), set_bool_property(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), statement_consistent_p(), and statement_undefined.

+ Here is the call graph for this function:

◆ invariant_ignore_this_successor()

static bool invariant_ignore_this_successor ( vertex  v,
set  region,
successor  su,
int  level 
)
static
Parameters
regionof statement

Definition at line 570 of file icm.c.

574 {
576  return(true);
577 
578  if (!dependance_vertices_p(v,
579  successor_vertex(su),
581  level))
582  return (true);
583 
584  return (false);
585 }

References common_ignore_this_vertex(), dependance_vertices_p(), FLOW_DEPENDANCE, level, region, and successor_vertex.

Referenced by SupressDependances().

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

◆ invariant_vertex_to_invariant_entities()

static set invariant_vertex_to_invariant_entities ( vertex  v,
set  rs 
)
static

of entity

of effect

Parameters
rsof entity

Definition at line 178 of file icm.c.

180 {
182  list /* of effect */ le = load_proper_rw_effects_list(st);
183 
184  MAP(EFFECT, ef, {
185  if (effect_write_p(ef)) {
187 
188  if (!set_belong_p(rs, (char *) v)) {
189  rs = set_add_element(rs, rs, (char *) e);
190  }
191  }
192  }, le);
193 
194  return rs;
195 }
list load_proper_rw_effects_list(statement)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_write_p(eff)
#define reference_variable(x)
Definition: ri.h:2326

References EFFECT, effect_any_reference, effect_write_p, load_proper_rw_effects_list(), MAP, reference_variable, set_add_element(), set_belong_p(), and vertex_to_statement().

Referenced by DoInvariantsStatements().

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

◆ loop_level_in()

static bool loop_level_in ( loop  l)
static

Definition at line 227 of file icm.c.

228 {
229  entity index = loop_index(l);
230  indices = CONS(ENTITY, index, indices);
231  ++depth;
232 
233  return true;
234 }
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
static int depth
Definition: icm.c:205
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755

References CONS, depth, ENTITY, indices, and loop_index.

Referenced by icm_codegen().

+ Here is the caller graph for this function:

◆ loop_level_out()

static void loop_level_out ( __attribute__((unused)) loop  l)
static

Definition at line 242 of file icm.c.

243 {
244  list new_indices = CDR(indices);
245  free(indices);
246  indices = new_indices;
247  --depth;
248 }
void free(void *)
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111

References CDR, depth, free(), and indices.

Referenced by icm_codegen().

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

◆ pop_depending_index()

static void pop_depending_index ( loop  l)
static

Definition at line 1217 of file icm.c.

1218 {
1219  list tmp = depending_indices;
1220  pips_assert("current loop index is poped",
1223  CDR(tmp) = NIL;
1224  free(tmp);
1225 }

References CAR, CDR, depending_indices, ENTITY, free(), loop_index, NIL, and pips_assert.

Referenced by drop_it().

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

◆ prettyprint_conflict()

static void prettyprint_conflict ( FILE *  fd,
conflict  c 
)
static

Definition at line 99 of file icm.c.

100 {
101  fprintf(fd, "\t\tfrom ");
103 
104  fprintf(fd, " to ");
106 
107  fprintf(fd, " at levels ");
108  MAP(INT, level, {
109  fprintf(fd, " %d", level);
110  }, cone_levels(conflict_cone(c)));
111  fprintf(fd, "\n");
112 }

References cone_levels, conflict_cone, conflict_sink, conflict_source, fprintf(), INT, level, MAP, print_words(), and words_effect().

Referenced by prettyprint_successor(), and remove_dependance_from_conflicts().

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

◆ prettyprint_successor()

static void prettyprint_successor ( FILE *  fd,
successor  su 
)
static

Definition at line 119 of file icm.c.

120 {
121  vertex v = successor_vertex(su);
122  fprintf(fd,
123  "link with %02td :\n",
125 
126  MAP(CONFLICT, c, {
127  prettyprint_conflict(fd, c);
129 }
static void prettyprint_conflict(FILE *fd, conflict c)
Definition: icm.c:99

References CONFLICT, dg_arc_label_conflicts, fprintf(), MAP, prettyprint_conflict(), statement_number, successor_arc_label, successor_vertex, and vertex_to_statement().

Referenced by prettyprint_vertex(), and remove_dependances_from_successors().

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

◆ prettyprint_vertex()

static void prettyprint_vertex ( FILE *  fd,
vertex  v 
)
static

Definition at line 136 of file icm.c.

137 {
138  fprintf(fd,
139  "vertex %02td :\n",
141  MAP(SUCCESSOR, s, {
142  prettyprint_successor(fd, s);
143  }, vertex_successors(v));
144 }
static void prettyprint_successor(FILE *fd, successor su)
Definition: icm.c:119

References fprintf(), MAP, prettyprint_successor(), statement_number, SUCCESSOR, vertex_successors, and vertex_to_statement().

Referenced by remove_dependance().

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

◆ print_list_entities()

void print_list_entities ( list  l)
Parameters
lof entity

Definition at line 151 of file icm.c.

152 {
153  MAP(ENTITY, e, {
154  fprintf(stderr, "%s ", entity_name(e));
155  }, l);
156 }

References ENTITY, entity_name, fprintf(), and MAP.

Referenced by statement_depend_of_indices_p().

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

◆ push_depending_index()

static bool push_depending_index ( loop  l)
static

Definition at line 1210 of file icm.c.

1211 {
1213  return true;
1214 }

References CONS, depending_indices, ENTITY, and loop_index.

Referenced by drop_it().

+ Here is the caller graph for this function:

◆ ref_flt()

static bool ref_flt ( reference  r)
static

Definition at line 642 of file icm.c.

643 {
645 }
static bool inv_entity_filter(entity e)
Definition: icm.c:635

References inv_entity_filter(), and reference_variable.

Referenced by expressions_invariant_p().

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

◆ remove_dependance()

static void remove_dependance ( vertex  v1,
vertex  v2,
int  dependance_type,
int  level_min,
int  level_max 
)
static

of successor

Parameters
v2Successors of this vertex are updated

Definition at line 488 of file icm.c.

493 {
494  list /* of successor */ v1_successors = vertex_successors(v1);
495 
496  ifdebug(3) {
497  pips_debug(3, "Remove ");
498 
499  if (dependance_type & FLOW_DEPENDANCE) fprintf(stderr, "F ");
500  if (dependance_type & ANTI_DEPENDANCE) fprintf(stderr, "A ");
501  if (dependance_type & OUTPUT_DEPENDANCE) fprintf(stderr, "O ");
502  if (dependance_type & INPUT_DEPENDANCE) fprintf(stderr, "I ");
503 
504  fprintf(stderr,
505  "dep. at level >= %d and level <= %d ",
506  level_min,
507  level_max);
508 
509  fprintf(stderr,
510  "between %02td and %02td.\n",
513  }
514 
515  vertex_successors(v1) =
516  remove_dependances_from_successors(v1_successors,
517  v2,
518  dependance_type,
519  level_min,
520  level_max);
521 
522  ifdebug(7) {
523  prettyprint_vertex(stderr, v1);
524  }
525 }
static list remove_dependances_from_successors(list successors, vertex v2, int dependance_type, int level_min, int level_max)
of successor
Definition: icm.c:428
static void prettyprint_vertex(FILE *fd, vertex v)
Definition: icm.c:136

References ANTI_DEPENDANCE, FLOW_DEPENDANCE, fprintf(), ifdebug, INPUT_DEPENDANCE, OUTPUT_DEPENDANCE, pips_debug, prettyprint_vertex(), remove_dependances_from_successors(), statement_number, vertex_successors, and vertex_to_statement().

Referenced by SimplifyInvariantVertex(), and SimplifyRedundantVertex().

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

◆ remove_dependance_from_conflicts()

static list remove_dependance_from_conflicts ( list  conflicts,
int  dependance_type,
int  level_min,
int  level_max 
)
static

of conflict

of conflict

of level

of level

memory leak : levels

memory leak : conflicts

Parameters
conflictsof conflict

Definition at line 369 of file icm.c.

373 {
374  list /* of conflict */ new_conflicts = NIL;
375 
376  ifdebug(7) {
377  fprintf(stderr, "Old conflicts :\n");
378  MAP(CONFLICT, c, {
379  prettyprint_conflict(stderr, c);
380  }, conflicts);
381  }
382 
383  FOREACH(CONFLICT, c, conflicts) {
384  if(conflict_cone(c) != cone_undefined) {
385  if (action_dependance_p(c, dependance_type))
386  {
387  list /* of level */ levels = cone_levels(conflict_cone(c));
388 
389  list /* of level */ new_levels =
391  level_min,
392  level_max);
393 
394  if (new_levels != NIL) {
395  cone_levels(conflict_cone(c)) = new_levels;
396  new_conflicts = CONS(CONFLICT, c, new_conflicts);
397  }
398 
399  /* memory leak : levels */
400  }
401  else {
402  new_conflicts = CONS(CONFLICT, c, new_conflicts);
403  }
404  }
405  else {
406  new_conflicts = CONS(CONFLICT, c, new_conflicts);
407  }
408  }
409 
410  /* memory leak : conflicts */
411 
412  ifdebug(7)
413  {
414  fprintf(stderr, "New conflicts :\n");
415  MAP(CONFLICT, c, {
416  prettyprint_conflict(stderr, c);
417  }, new_conflicts);
418  }
419 
420  return new_conflicts;
421 }
static list remove_dependance_from_levels(list levels, int level_min, int level_max)
of level
Definition: icm.c:346

References action_dependance_p(), cone_levels, cone_undefined, CONFLICT, conflict_cone, CONS, FOREACH, fprintf(), ifdebug, MAP, NIL, prettyprint_conflict(), and remove_dependance_from_levels().

Referenced by remove_dependances_from_successors().

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

◆ remove_dependance_from_levels()

static list remove_dependance_from_levels ( list  levels,
int  level_min,
int  level_max 
)
static

of level

of level

memory leak : levels

Parameters
levelsof level

Definition at line 346 of file icm.c.

349 {
350  list /* of level */ new_levels = NIL;
351 
352  MAP(INT, level, {
353  if ((level < level_min) || (level > level_max)) {
354  new_levels = gen_nconc(new_levels, CONS(INT, level, NIL));
355  }
356  }, levels);
357 
358  /* memory leak : levels */
359 
360  return new_levels;
361 }
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344

References CONS, gen_nconc(), INT, level, MAP, and NIL.

Referenced by remove_dependance_from_conflicts().

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

◆ remove_dependances_from_successors()

static list remove_dependances_from_successors ( list  successors,
vertex  v2,
int  dependance_type,
int  level_min,
int  level_max 
)
static

of successor

of successor

of conflict

of conflict

memory leak : lc

memory leak : successors

Definition at line 428 of file icm.c.

433 {
434  list /* of successor */ new_successors = NIL;
435 
436  ifdebug(7)
437  {
438  fprintf(stderr, "Old successors :\n");
439  MAP(SUCCESSOR, s, {
440  prettyprint_successor(stderr, s);
441  }, successors);
442  }
443 
444  MAP(SUCCESSOR, su, {
445  vertex v = successor_vertex(su);
446 
447  if (v == v2) {
448  list /* of conflict */ lc =
450 
451  list /* of conflict */ new_lc =
453  dependance_type,
454  level_min,
455  level_max);
456 
457  if (new_lc != NIL) {
459  new_successors = CONS(SUCCESSOR, su, new_successors);
460  }
461 
462  /* memory leak : lc */
463  }
464  else {
465  new_successors = CONS(SUCCESSOR, su, new_successors);
466  }
467 
468  }, successors);
469 
470  /* memory leak : successors */
471 
472  ifdebug(7)
473  {
474  fprintf(stderr, "New successors :\n");
475  MAP(SUCCESSOR, s, {
476  prettyprint_successor(stderr, s);
477  }, successors);
478  }
479 
480  return new_successors;
481 }
static list successors(list l)
static list remove_dependance_from_conflicts(list conflicts, int dependance_type, int level_min, int level_max)
of conflict
Definition: icm.c:369

References CONS, dg_arc_label_conflicts, fprintf(), ifdebug, MAP, NIL, prettyprint_successor(), remove_dependance_from_conflicts(), SUCCESSOR, successor_arc_label, successor_vertex, and successors().

Referenced by remove_dependance().

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

◆ SimplifyGraph()

static graph SimplifyGraph ( graph  g,
set  region,
int  level,
unsigned int  count 
)
static

of scc

Find sccs

Check if the component is strongly connected

Parameters
regionof statement

Definition at line 1092 of file icm.c.

1096 {
1097  ifdebug(5) {
1098  pips_debug(5, "start\n");
1099  pips_debug(5, "level=%d, count=%d\n", level, count);
1100 
1101  pips_debug(5, "set of statement number studied: ");
1102  SET_MAP(elt, fprintf(stderr, "%d, ", (int) statement_number((statement) elt)), region);
1103  fprintf(stderr, "\n");
1104  ifdebug(8) {
1105  pips_debug(8, "set of statement studied:\n");
1106  SET_MAP(elt, print_statement((statement) elt), region);
1107  }
1108  }
1109  list /* of scc */ lsccs;
1110 
1111  /* Find sccs */
1114  lsccs = FindAndTopSortSccs(g, region, level);
1116 
1117  FOREACH(SCC, elmt, lsccs) {
1118  /* Check if the component is strongly connected */
1119  if (strongly_connected_p(elmt, level)) {
1120  set new_region = set_make(set_pointer);
1121  new_region = vertices_to_statements(scc_vertices(elmt),
1122  new_region);
1123 
1124  g = SupressDependances(g, new_region, level, count);
1125 
1126  set_free(new_region);
1127  }
1128  }
1129 
1130  // No leak
1131  gen_free_list(lsccs);
1132 
1133  ifdebug(5) {
1134  pips_debug(5, "end\n");
1135  }
1136  return g;
1137 }
static int count
Definition: SDG.c:519
static set vertices_to_statements(list vl, set ss)
of statement
Definition: icm.c:166
static graph SupressDependances(graph g, set region, int level, unsigned int count)
Definition: icm.c:1144
static bool icm_ignore_this_successor(vertex v, set region, successor su, int level)
Definition: icm.c:547
#define SET_MAP(element, code, the_set)
Definition: newgen_set.h:54
bool strongly_connected_p(scc s, int l)
this function returns true if scc s is stronly connected at level l, i.e.
Definition: codegen.c:284
void set_sccs_drivers(bool(*)(set, vertex), bool(*)(vertex, set, successor, int))
scc.c
void reset_sccs_drivers(void)
Definition: scc.c:98
list FindAndTopSortSccs(graph, set, int)
Definition: scc.c:317

References common_ignore_this_vertex(), count, FindAndTopSortSccs(), FOREACH, fprintf(), gen_free_list(), icm_ignore_this_successor(), ifdebug, level, pips_debug, print_statement(), region, reset_sccs_drivers(), SCC, scc_vertices, set_free(), set_make(), SET_MAP, set_pointer, set_sccs_drivers(), statement_number, strongly_connected_p(), SupressDependances(), and vertices_to_statements().

Referenced by icm_codegen(), and SupressDependances().

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

◆ SimplifyInvariantVertex()

static void SimplifyInvariantVertex ( vertex  v,
set  region,
int  level 
)
static

of vertex

Parameters
regionSuccessors of this vertex are updated of statement

Definition at line 806 of file icm.c.

809 {
810  set /* of vertex */ matching_vertices = set_make(set_pointer);
812 
817  vertex y = successor_vertex(su);
821 
822  matching_vertices = set_add_element(matching_vertices,
823  matching_vertices,
824  (char *) y);
825  }
826  }
827 
828  //remove_dependance(v, v, OUTPUT_DEPENDANCE, 0, load_has_level(st));
829  remove_dependance(v, v, OUTPUT_DEPENDANCE, level, load_has_level(st));
830 
831  if (!set_empty_p(matching_vertices)) {
832  SET_MAP(y, {
834  //0, load_has_level(st));
835  level, load_has_level(st));
836  }, matching_vertices);
837  }
838  }
839 
840  set_free(matching_vertices);
841 }
static bool exist_non_self_dependance_from_vertex_p(vertex v, int dependance_type, int level)
Definition: icm.c:327
static void remove_dependance(vertex v1, vertex v2, int dependance_type, int level_min, int level_max)
Definition: icm.c:488
bool set_empty_p(const set)
tell whether set s is empty.
Definition: set.c:367

References ANTI_DEPENDANCE, common_ignore_this_vertex(), dependance_vertices_p(), exist_non_self_dependance_from_vertex_p(), FLOW_DEPENDANCE, FOREACH, level, OUTPUT_DEPENDANCE, region, remove_dependance(), set_add_element(), set_empty_p(), set_free(), set_make(), SET_MAP, set_pointer, SUCCESSOR, successor_vertex, vertex_successors, and vertex_to_statement().

Referenced by DoInvariantsStatements().

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

◆ SimplifyRedundantVertex()

static void SimplifyRedundantVertex ( vertex  v,
set  region,
int  level 
)
static

of vertices

Parameters
regionSuccessors of this vertex are updated of statement

Definition at line 1005 of file icm.c.

1008 {
1009  set /* of vertices */ matching_vertices = set_make(set_pointer);
1011 
1016  vertex y = successor_vertex(su);
1017  if (!common_ignore_this_vertex(region, y) &&
1020 
1021  matching_vertices = set_add_element(matching_vertices,
1022  matching_vertices,
1023  (char *) y);
1024  }
1025  }
1026 
1027  remove_dependance(v, v, OUTPUT_DEPENDANCE, 0, load_has_level(st));
1028 
1029  if (!set_empty_p(matching_vertices)) {
1030  SET_MAP(y, {
1032  0, load_has_level(st));
1033  }, matching_vertices);
1034  }
1035  }
1036 
1037  set_free(matching_vertices);
1038 }

References ANTI_DEPENDANCE, common_ignore_this_vertex(), dependance_vertices_p(), exist_non_self_dependance_from_vertex_p(), FLOW_DEPENDANCE, FOREACH, level, OUTPUT_DEPENDANCE, region, remove_dependance(), set_add_element(), set_empty_p(), set_free(), set_make(), SET_MAP, set_pointer, SUCCESSOR, successor_vertex, vertex_successors, and vertex_to_statement().

Referenced by DoRedundantsStatements().

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

◆ statement_depend_of_indices_p()

static bool statement_depend_of_indices_p ( statement  st,
list  indices,
int  level 
)
static

of effect

Ignore the first indicies...

Parameters
indicesof entity

Definition at line 596 of file icm.c.

599 {
600  list /* of effect */ le = load_proper_rw_effects_list(st);
601 
602  ifdebug(6) {
603  pips_debug(6, "Statement %02td depend of ", statement_number(st));
605  }
606 
607  /* Ignore the first indicies... */
608  for(; level > reference_level; --level) {
609  indices = CDR(indices);
610  }
611 
612  MAP(ENTITY, index, {
613  MAP(EFFECT, ef, {
615  if (e == index) {
616 
617  ifdebug(6) {
618  fprintf(stderr,": yes\n");
619  }
620 
621  return true;
622  }
623  }, le);
624  }, indices);
625 
626  ifdebug(6) {
627  fprintf(stderr,": no\n");
628  }
629 
630  return false;
631 }
void print_list_entities(list l)
Definition: icm.c:151

References CDR, EFFECT, effect_any_reference, ENTITY, fprintf(), ifdebug, indices, level, load_proper_rw_effects_list(), MAP, pips_debug, print_list_entities(), reference_level, reference_variable, and statement_number.

Referenced by does_it_depend(), and vertex_invariant_p().

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

◆ statement_mark()

static bool statement_mark ( statement  s)
static

Definition at line 213 of file icm.c.

214 {
215  store_has_level(s, depth);
216  store_statement_has_indices(s, gen_nreverse(gen_copy_seq(indices)));
217 
218  return true;
219 }
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501

References depth, gen_copy_seq(), gen_nreverse(), and indices.

Referenced by icm_codegen().

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

◆ SupressDependances()

static graph SupressDependances ( graph  g,
set  region,
int  level,
unsigned int  count 
)
static

of scc

of statement

Find sccs considering only flow dependances

Forward simplification

Backward simplification

Parameters
regionof statement

Definition at line 1144 of file icm.c.

1148 {
1149  ifdebug(5) {
1150  pips_debug(5, "start\n");
1151  pips_debug(5, "level=%d, count=%d\n", level, count);
1152 
1153  pips_debug(5, "set of statement number studied: ");
1154  SET_MAP(elt, fprintf(stderr, "%d, ", (int) statement_number((statement) elt)), region);
1155  fprintf(stderr, "\n");
1156  ifdebug(8) {
1157  pips_debug(8, "set of statement studied:\n");
1158  SET_MAP(elt, print_statement((statement) elt), region);
1159  }
1160  }
1161  list /* of scc */ lsccs;
1162  set /* of statement */ partially_invariant = set_make(set_pointer);
1163 
1164  /* Find sccs considering only flow dependances */
1167  lsccs = FindAndTopSortSccs(g, region, level);
1169 
1170  /* Forward simplification */
1171  g = DoInvariantsStatements(lsccs, g, region, level, partially_invariant);
1172 
1173  /* Backward simplification */
1174  lsccs = gen_nreverse(lsccs);
1175  g = DoRedundantsStatements(lsccs, g, region, level, partially_invariant);
1176 
1177  // No leak
1178  gen_free_list(lsccs);
1179  set_free(partially_invariant);
1180 
1181  if (count > 1) {
1182  return SimplifyGraph(g, region, level, count-1);
1183  }
1184  else{
1186  }
1187 }
static graph DoRedundantsStatements(list lsccs, graph g, set region, int level, set partially_invariant)
Definition: icm.c:1045
static bool invariant_ignore_this_successor(vertex v, set region, successor su, int level)
Definition: icm.c:570
static graph DoInvariantsStatements(list lsccs, graph g, set region, int level, set partially_invariant)
Definition: icm.c:848

References common_ignore_this_vertex(), count, DoInvariantsStatements(), DoRedundantsStatements(), FindAndTopSortSccs(), fprintf(), gen_free_list(), gen_nreverse(), ifdebug, invariant_ignore_this_successor(), level, NB_SIMPLIFY_PASSES, pips_debug, print_statement(), region, reset_sccs_drivers(), set_free(), set_make(), SET_MAP, set_pointer, set_sccs_drivers(), SimplifyGraph(), and statement_number.

Referenced by SimplifyGraph().

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

◆ vertex_invariant_p()

static bool vertex_invariant_p ( vertex  v,
graph  g,
int  level,
set  region,
set  invariant 
)
static

Test if the statement is dependent of ALL loop indexes >= level

If there is a flow dependence from v to v, then v is not variant

If there is a flow dependence from y to v and if y is not invariant, then v is not invariant

Parameters
regionof statement
invariantof statement

Definition at line 736 of file icm.c.

741 {
743 
744  /* Test if the statement is dependent of ALL loop indexes >= level */
746  load_statement_has_indices(st),
747  level)) {
748  pips_debug(6,
749  "statement %02td is not invariant (depend of indices).\n",
750  statement_number(st));
751 
752  return false;
753  }
754 
755  /* If there is a flow dependence from v to v, then v is not variant */
757  pips_debug(6,
758  "statement %02td is not invariant (self flow dep).\n",
759  statement_number(st));
760 
761  return false;
762  }
763 
764  /* If there is a flow dependence from y to v and if y is not invariant,
765  * then v is not invariant */
766  MAP(VERTEX, y, {
768  statement y_st = vertex_to_statement(y);
769 
770  if (!set_belong_p(invariant, (char *) y_st) &&
771  set_belong_p(region, (char *) y_st)) {
772 
773  pips_debug(6,
774  "statement %02td is not invariant "
775  "(dep. of %02td).\n",
776  statement_number(st),
777  statement_number(y_st));
778 
779  return false;
780  }
781  }
782  }, graph_vertices(g));
783 
784  pips_debug(6,
785  "statement %02td is invariant.\n",
786  statement_number(st));
787 
788  return true;
789 }
#define graph_vertices(x)
Definition: graph.h:82

References dependance_vertices_p(), FLOW_DEPENDANCE, graph_vertices, level, MAP, pips_debug, region, set_belong_p(), statement_depend_of_indices_p(), statement_number, VERTEX, and vertex_to_statement().

Referenced by DoInvariantsStatements().

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

◆ vertex_partially_invariant_p()

static bool vertex_partially_invariant_p ( vertex  v,
__attribute__((unused)) graph  g,
__attribute__((unused)) int  level,
__attribute__((unused)) set  invariant 
)
static

Looking for write effects only

Which kind of reference we have ?

An array access with well known indices

An array access with unknow indices

A scalar variable

Parameters
invariantof statement

Definition at line 668 of file icm.c.

672 {
674 
675  MAP(EFFECT, ef, {
677 
678  /* Looking for write effects only */
679  if (effect_write_p(ef)) {
680 
681  /* Which kind of reference we have ? */
682  if (reference_indices(ref) != NIL) {
683  /* An array access with well known indices */
685  pips_debug(6,
686  "statement %02td is partially invariant "
687  "(known array access).\n",
688  statement_number(st));
689 
690  return true;
691  }
692  else {
693  pips_debug(6,
694  "statement %02td is not partially invariant "
695  "(known array access).\n",
696  statement_number(st));
697 
698  return false;
699  }
700  }
701  else {
703  /* An array access with unknow indices */
704  pips_debug(6,
705  "statement %02td is not partially invariant "
706  "(UNKNOWN array access).\n",
707  statement_number(st));
708 
709  return false;
710  }
711  else {
712  /* A scalar variable */
713  pips_debug(6,
714  "statement %02td is partially invariant "
715  "(scalar access).\n",
716  statement_number(st));
717 
718  return true;
719  }
720  }
721  }
723 
724  pips_debug(6,
725  "statement %02td is not partially invariant.\n",
726  statement_number(st));
727 
728  return false;
729 }
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
static bool expressions_invariant_p(list le)
Definition: icm.c:648
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
Definition: variable.c:1293
#define reference_indices(x)
Definition: ri.h:2328

References EFFECT, effect_any_reference, effect_write_p, expressions_invariant_p(), load_proper_rw_effects_list(), MAP, NIL, pips_debug, ref, reference_indices, reference_variable, statement_number, variable_entity_dimension(), and vertex_to_statement().

Referenced by DoInvariantsStatements().

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

◆ vertex_redundant_p()

static bool vertex_redundant_p ( vertex  v,
__attribute__((unused)) graph  g,
int  level,
set  region,
set  partially_invariant,
set  redundant 
)
static

Test if the statement is depandant of ALL loop indexes >= level

This condition is not required, but putting a statement depending of indicies after the loop is tiedous (setting the value to the bound+1...)

Test if we are not always writing at the same adress ie. is not partially_invariant.

If there is a flow dependance from v to y and if y is not redundant, then v is not redundant

Parameters
regionof statement
partially_invariantof statement
redundantof statement

Definition at line 935 of file icm.c.

941 {
943 
944  /* Test if the statement is depandant of ALL loop indexes >= level */
945  /* This condition is not required, but putting a statement depending
946  of indicies after the loop is tiedous (setting the value to
947  the bound+1...) */
948 /*
949  if (statement_depend_of_indices_p(st,
950  load_statement_has_indices(st),
951  level)) {
952  ifdebug(6) {
953  debug(6, "vertex_redundant_p", "");
954  fprintf(stderr,
955  "statement %02d is not redundant (depend of indices).\n",
956  statement_number(st));
957  }
958 
959  return false;
960  }
961 */
962 
963  /* Test if we are not always writing at the same adress
964  ie. is not partially_invariant. */
965  if (!set_belong_p(partially_invariant, (char *) st)) {
966  pips_debug(6,
967  "statement %02td is not redundant (variable address).\n",
968  statement_number(st));
969 
970  return false;
971  }
972 
973  /* If there is a flow dependance from v to y and if y is not redundant,
974  then v is not redundant */
976  vertex y = successor_vertex(su);
978  statement y_st = vertex_to_statement(y);
979 
980  if (!set_belong_p(redundant, (char *) y_st) &&
981  set_belong_p(region, (char *) y_st)) {
982 
983  pips_debug(6,
984  "statement %td is not redundant "
985  "(dep. of %td).\n",
986  statement_number(st),
987  statement_number(y_st));
988 
989  return false;
990  }
991  }
992  }
993 
994  pips_debug(6,
995  "statement %td is redundant.\n",
996  statement_number(st));
997  return true;
998 }

References dependance_vertices_p(), FLOW_DEPENDANCE, FOREACH, level, pips_debug, redundant(), region, set_belong_p(), statement_number, SUCCESSOR, successor_vertex, vertex_successors, and vertex_to_statement().

Referenced by DoRedundantsStatements().

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

◆ vertex_to_statement()

statement vertex_to_statement ( vertex  v)

Vertex_to_statement looks for the statement that is pointed to by vertex v.

This information is kept in a static hash_table named OrderingToStatement. See ri-util/ordering.c for more information.

Definition at line 45 of file util.c.

46 {
49 }
#define dg_vertex_label_statement(x)
Definition: dg.h:235
struct _newgen_struct_dg_vertex_label_ * dg_vertex_label
Definition: dg.h:68
#define vertex_vertex_label(x)
Definition: graph.h:152
statement ordering_to_statement(int o)
Get the statement associated to a given ordering.
Definition: ordering.c:111

References dg_vertex_label_statement, ordering_to_statement(), and vertex_vertex_label.

Referenced by adg_dup_disjunctive_nodes(), adg_list_same_order_in_dg(), adg_same_order_in_dg(), allocate_task_to_cluster(), bdsc_code_instrumentation(), bottom_level(), check_tiling_legality(), check_way_between_two_statements(), clean_sdg(), common_ignore_this_vertex(), communications_construction(), contains_level_l_dependence(), dependance_vertices_p(), dg_vertex_dup(), dma_statements_conflict_p(), do_reduction_detection(), do_reduction_propagation(), do_redundant_load_store_elimination(), do_scalar_renaming_in_graph(), do_scalar_renaming_in_successors(), do_scalar_renaming_in_vertex(), DoInvariantsStatements(), DoRedundantsStatements(), end_idle_clusters(), find_covering_reference_path(), find_level_l_loop_statement(), flint_initialize_statement_def_use_variables(), graph_to_live_writes(), ignore_this_conflict(), init_statement_equivalence_table(), initialization(), invariant_vertex_to_invariant_entities(), IsolatedStatement(), make_filtered_dg_or_dvdg(), parse_instrumented_file(), predecessors(), prettyprint_successor(), prettyprint_vertex(), print_loopnest_dependence_cone(), print_SDGs(), PrintScc(), quick_privatize_graph(), quick_privatize_loop(), ready_node(), remove_dependance(), rice_update_dependence_graph(), scc_region(), schedule_failsafe(), search_parallel_loops(), sequence_dg(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), some_conflicts_between(), statement_conflicts_p(), statement_to_vertex(), statements_conflict_p(), statements_conflict_relaxed_p(), stats_has_rw_conf_p(), step_analyse_CHAINS_DG(), successor_only_has_rr_conflict_p(), successors(), t_level(), tlevel_decrease(), topological_sort(), TopSortSccs(), update_priority_values(), vertex_invariant_p(), vertex_partially_invariant_p(), vertex_redundant_p(), vertex_to_chains(), vertices_to_statements(), xml_Chain_Graph(), and zeroing_multiple_edges().

+ Here is the call graph for this function:

◆ vertices_to_statements()

static set vertices_to_statements ( list  vl,
set  ss 
)
static

of statement

Parameters
vlof vertex
ssof statement

Definition at line 166 of file icm.c.

168 {
169  MAP(VERTEX, v, {
170  ss = set_add_element(ss, ss, (char *) vertex_to_statement(v));
171  }, vl);
172 
173  return ss;
174 }

References MAP, set_add_element(), VERTEX, and vertex_to_statement().

Referenced by SimplifyGraph().

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

Variable Documentation

◆ depending_indices

list depending_indices
static

of entity

Definition at line 1195 of file icm.c.

Referenced by does_it_depend(), drop_it(), pop_depending_index(), and push_depending_index().

◆ depth

int depth = 0
static

Definition at line 205 of file icm.c.

Referenced by loop_level_in(), loop_level_out(), and statement_mark().

◆ expression_invariant

bool expression_invariant = false
static

Definition at line 63 of file icm.c.

Referenced by expressions_invariant_p(), and inv_entity_filter().

◆ indices

◆ invariant_entities

set invariant_entities = set_undefined
static

of entity

Definition at line 64 of file icm.c.

Referenced by DoInvariantsStatements(), icm_codegen(), and inv_entity_filter().

◆ it_depends

bool it_depends
static

Definition at line 1196 of file icm.c.

Referenced by does_it_depend(), and drop_it().

◆ reference_level

int reference_level =0
static

Definition at line 61 of file icm.c.

Referenced by icm_codegen(), and statement_depend_of_indices_p().