PIPS
utils.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "sc.h"
#include "polyedre.h"
#include "matrix.h"
#include "ri.h"
#include "graph.h"
#include "paf_ri.h"
#include "database.h"
#include "parser_private.h"
#include "ri-util.h"
#include "workspace-util.h"
#include "prettyprint.h"
#include "constants.h"
#include "misc.h"
#include "text.h"
#include "text-util.h"
#include "paf-util.h"
#include "effects-generic.h"
#include "alias-classes.h"
#include "static_controlize.h"
+ Include dependency graph for utils.c:

Go to the source code of this file.

Macros

#define entity_assigned_by_array_p(ent)   (gen_find_eq(ent, assigned_var) != chunk_undefined)
 

Typedefs

typedef void * arc_label
 Name : utils.c Package : static_controlize.c Author : Arnauld LESERVOT Date : 27/04/93 Modified :
Documents: "Implementation du Data Flow Graph dans Pips" Comments :
More...
 
typedef void * vertex_label
 

Functions

list stco_same_loops (statement_mapping in_map, statement in_s, statement in_s2)
 ====================================================================== More...
 
int stco_renumber_code (statement in_st, int in_ct)
 ================================================================ More...
 
expression sc_opposite_exp_of_conjunction (expression exp, list *ell)
 ================================================================ More...
 
bool splc_positive_relation_p (expression exp, list *ell)
 ================================================================ More...
 
list ndf_normalized_test (expression exp, list *ell)
 ================================================================ More...
 
expression normalize_test_leaves (expression exp, list *ell)
 ================================================================ More...
 
expression sc_conditional (expression exp, list *ell)
 ================================================================ More...
 
list loops_to_indices (list l)
 ================================================================ More...
 
bool splc_linear_expression_p (expression exp, list *ell)
 ================================================================ More...
 
bool splc_linear_expression_list_p (list l, list *ell)
 ================================================================ More...
 
bool splc_linear_access_to_arrays_p (list l, list *ell)
 ================================================================ More...
 
string print_structurals (list l)
 ================================================================ More...
 
list sc_list_of_exp_dup (list l)
 ================================================================ More...
 
list sc_list_of_entity_dup (list l)
 ================================================================ More...
 
list sc_list_of_loop_dup (list l)
 ================================================================ More...
 
loop sc_loop_dup (loop l)
 ================================================================ More...
 
list make_undefined_list ()
 ================================================================ More...
 
int in_forward_defined (entity ent, list *swfl)
 ================================================================ More...
 
bool in_forward_defined_p (entity ent, list *swfl)
 ================================================================ More...
 
void verify_structural_parameters (list the_list, list *swfl)
 ================================================================ More...
 
list sc_entity_to_formal_integer_parameters (entity f)
 ================================================================ More...
 
bool sp_linear_expression_p (expression exp)
 ================================================================ More...
 
bool splc_feautrier_expression_p (expression exp, list *ell)
 ================================================================ More...
 
bool sp_feautrier_expression_p (expression exp)
 ================================================================ More...
 
entity sp_feautrier_scalar_assign_call (call c)
 ================================================================ More...
 
bool get_sp_of_call_p (call c, hash_table fst, list *swfl)
 ================================================================ More...
 
static void substitute_variable_by_expression (expression e, hash_table fst)
 rewriting of forward_substitute_in_exp, in_loop,... More...
 
void forward_substitute_in_anyloop (void *pl, hash_table fst)
 
void forward_substitute_in_exp (expression *pe, hash_table fst)
 
void forward_substitute_in_call (call *pc, hash_table fst)
 
bool normalizable_loop_p (loop l)
 bool normalizable_loop_p(loop l) Returns true if "l" has a constant step. More...
 
bool normalizable_loop_p_retrieved (loop l)
 Code retrieved from revision 14476, transformations/loop_normalize.c. More...
 
bool is_expression_in_list (expression exp, list l)
 State if an expression OR part of that expression corresponds to one of the entity of the list l. More...
 
bool get_reference_assignments (statement s, list *l)
 Allows the static_controlize phase to keep and update a list containing all the variables of the program assigned directly or indirectly by an array. More...
 

Variables

list Gstructure_parameters
 Global variables
More...
 
list assigned_var
 ================================================================= More...
 

Macro Definition Documentation

◆ entity_assigned_by_array_p

#define entity_assigned_by_array_p (   ent)    (gen_find_eq(ent, assigned_var) != chunk_undefined)

Definition at line 86 of file utils.c.

Typedef Documentation

◆ arc_label

typedef void* arc_label

Name : utils.c Package : static_controlize.c Author : Arnauld LESERVOT Date : 27/04/93 Modified :
Documents: "Implementation du Data Flow Graph dans Pips" Comments :

Ansi includes
Newgen includes C3 includes
Pips includes
Types arc_label and vertex_label must be defined although they are not used

Definition at line 62 of file utils.c.

◆ vertex_label

typedef void* vertex_label

Definition at line 63 of file utils.c.

Function Documentation

◆ forward_substitute_in_anyloop()

void forward_substitute_in_anyloop ( void *  pl,
hash_table  fst 
)

Would it be better to loop over with HASH_MAP or to check every reference?

Parameters
pll
fstst

Definition at line 1139 of file utils.c.

1140 {
1141  /* Would it be better to loop over with HASH_MAP or to check every
1142  reference? */
1145  NULL);
1146 }
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
Definition: genClib.c:3373
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
Definition: genClib.c:2780
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
#define expression_domain
newgen_execution_domain_defined
Definition: ri.h:154
static void substitute_variable_by_expression(expression e, hash_table fst)
rewriting of forward_substitute_in_exp, in_loop,...
Definition: utils.c:1122

References expression_domain, gen_context_multi_recurse(), gen_true(), pl, and substitute_variable_by_expression().

Referenced by loop_normalize_of_statement(), and static_controlize_statement().

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

◆ forward_substitute_in_call()

void forward_substitute_in_call ( call pc,
hash_table  fst 
)

Would it be better to loop over with HASH_MAP or to check every reference?

Parameters
pcc
fstst

Definition at line 1157 of file utils.c.

1158 {
1159  pips_assert("call c is consistent_p\n", call_consistent_p(*pc));
1160 
1161  /* Would it be better to loop over with HASH_MAP or to check every
1162  reference? */
1163  gen_context_multi_recurse(*pc, fst,
1165  NULL);
1166 }
bool call_consistent_p(call p)
Definition: ri.c:242
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172

References call_consistent_p(), expression_domain, gen_context_multi_recurse(), gen_true(), pips_assert, and substitute_variable_by_expression().

Referenced by loop_normalize_of_statement(), and static_controlize_statement().

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

◆ forward_substitute_in_exp()

void forward_substitute_in_exp ( expression pe,
hash_table  fst 
)

Would it be better to loop over with HASH_MAP or to check every reference?

Parameters
pee
fstst

Definition at line 1148 of file utils.c.

1149 {
1150  /* Would it be better to loop over with HASH_MAP or to check every
1151  reference? */
1152  gen_context_multi_recurse(*pe, fst,
1154  NULL);
1155 }

References expression_domain, gen_context_multi_recurse(), gen_true(), and substitute_variable_by_expression().

Referenced by adg_dataflowgraph(), loop_normalize_of_statement(), and static_controlize_statement().

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

◆ get_reference_assignments()

bool get_reference_assignments ( statement  s,
list l 
)

Allows the static_controlize phase to keep and update a list containing all the variables of the program assigned directly or indirectly by an array.

Definition at line 1300 of file utils.c.

1300  {
1301  // we only compute assignments
1302  if (!assignment_statement_p(s)) {
1303  return false;
1304  }
1306  // May not be necessary
1307  if (!instruction_call_p(inst)) {
1308  return false;
1309  }
1310  // Being an assignment, logically this call has only two arguments
1311  call c = instruction_call(inst);
1312  list args = call_arguments(c);
1313  // Left member of the assignment
1314  expression left = gen_car(args);
1315  entity eleft = expression_to_entity(left);
1316  // Right member of the assignment
1317  expression right = gen_car(CDR(args));
1318  // If the assigned variable is not in the list
1319  if (gen_find_eq(eleft, *l) == chunk_undefined) {
1320  // Test if the assignment is static control
1322  syntax s = expression_syntax(left);
1323  // We look for the right member in the list in order to know if the variable read has not been assigned by an array
1324  bool isRightArrayAccess = is_expression_in_list(right, *l);
1325  // If the left member is a scalar and if the right member is not static control or if it is a variable previously assigned
1326  // by an array, then we add the left member to the list
1327  if ((syntax_reference_p(s) && reference_indices(syntax_reference(s)) == NIL) && (entity_undefined_p(e) || isRightArrayAccess == true)) {
1328  *l = gen_cons(eleft, *l);
1329  }
1330  }
1331  return true;
1332 }
#define chunk_undefined
obsolete
Definition: genC.h:79
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
list gen_cons(const void *item, const list next)
Definition: list.c:888
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
void * gen_find_eq(const void *item, const list seq)
Definition: list.c:422
void * gen_car(list l)
Definition: list.c:364
bool assignment_statement_p(statement)
Test if a statement is an assignment.
Definition: statement.c:135
entity expression_to_entity(expression e)
just returns the entity of an expression, or entity_undefined
Definition: expression.c:3140
#define syntax_reference_p(x)
Definition: ri.h:2728
#define syntax_reference(x)
Definition: ri.h:2730
#define entity_undefined_p(x)
Definition: ri.h:2762
#define reference_indices(x)
Definition: ri.h:2328
#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
#define call_arguments(x)
Definition: ri.h:711
#define expression_syntax(x)
Definition: ri.h:1247
bool is_expression_in_list(expression exp, list l)
State if an expression OR part of that expression corresponds to one of the entity of the list l.
Definition: utils.c:1200
entity sp_feautrier_scalar_assign_call(call c)
================================================================
Definition: utils.c:1029
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References assignment_statement_p(), call_arguments, CDR, chunk_undefined, entity_undefined_p, expression_syntax, expression_to_entity(), gen_car(), gen_cons(), gen_find_eq(), instruction_call, instruction_call_p, is_expression_in_list(), NIL, reference_indices, sp_feautrier_scalar_assign_call(), statement_instruction, syntax_reference, and syntax_reference_p.

Referenced by static_controlize_statement().

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

◆ get_sp_of_call_p()

bool get_sp_of_call_p ( call  c,
hash_table  fst,
list swfl 
)

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

bool get_sp_of_call_p( (call) c, fst) AL 04/93 Updates the global variables Gstructure_parameters and Gforward_substitute_table according to the type of call. Returns true if the call has to be modified (redefinition of a structural parameter), false in all the other cases.

AP, sep 95 : Gforward_substitute_table is no longer a global variable, we pass it as an argument.

I: not too sure about the false parameter...

Parameters
fstst
swflbool get_sp_of_call_p( (call) c, fst) AL 04/93 Updates the global variables Gstructure_parameters and Gforward_substitute_table according to the type of call. Returns true if the call has to be modified (redefinition of a structural parameter), false in all the other cases.

AP, sep 95 : Gforward_substitute_table is no longer a global variable, we pass it as an argument. forward substitute table

Definition at line 1056 of file utils.c.

1060 {
1061  entity lhs_ent, ent;
1062  bool ret_bool = false;
1063 
1064  pips_debug(7, "begin\n");
1065  /*FI: not too sure about the false parameter... */
1066  pips_debug(9, "input call : %s \n",
1067  words_to_string(Words_Regular_Call(c, false )));
1068  pips_debug(9, "struct param. before : %s \n",
1070 
1071  if (ENTITY_READ_P( call_function(c) )) {
1072  list the_arg = call_arguments( c );
1073 
1074  MAPL( exp_ptr,
1075  {
1076  expression exp = EXPRESSION(CAR( exp_ptr ));
1078  if ((ent != entity_undefined) && !in_forward_defined_p(ent, swfl))
1080  },
1081  the_arg);
1082  }
1083 
1084  if ( ((lhs_ent = sp_feautrier_scalar_assign_call(c)) != entity_undefined)
1085  && (in_forward_defined(lhs_ent, swfl) <= 1) ) {
1086 
1087  expression nsp_exp;
1088  entity nsp_ent;
1089 
1090  if ( !ENTITY_SP_P( lhs_ent ) ) {
1092  }
1093  else {
1094  nsp_ent = make_nsp_entity();
1095  nsp_exp = make_entity_expression( nsp_ent, NIL );
1096  hash_put(fst, (char*) lhs_ent, (char*) nsp_exp );
1098  ret_bool = true;
1099  }
1100  }
1101 
1102  pips_debug(9, "struct param. after : %s \n",
1104  pips_debug(9, "call has to be modified : %s \n",
1105  ((ret_bool == true)?"TRUE":"FALSE") );
1106  pips_debug(7, "end\n");
1107  return( ret_bool );
1108 }
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
#define ADD_ELEMENT_TO_LIST(_list, _type, _element)
Definition: icfg-local.h:50
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
entity expression_int_scalar(expression exp)
================================================================
entity make_nsp_entity()
entity make_nsp_entity() Makes a new NSP (for New Structural Parameter) .
list Words_Regular_Call(call obj, bool is_a_subroutine)
Definition: misc.c:1081
#define ENTITY_READ_P(e)
expression make_entity_expression(entity e, cons *inds)
Definition: expression.c:176
#define call_function(x)
Definition: ri.h:709
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
#define entity_undefined
Definition: ri.h:2761
#define ENTITY_SP_P(ent)
string print_structurals(list l)
================================================================
Definition: utils.c:732
int in_forward_defined(entity ent, list *swfl)
================================================================
Definition: utils.c:836
bool in_forward_defined_p(entity ent, list *swfl)
================================================================
Definition: utils.c:855
list Gstructure_parameters
Global variables
string words_to_string(cons *lw)
Definition: print.c:211
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, ENTITY, ENTITY_READ_P, ENTITY_SP_P, entity_undefined, exp, EXPRESSION, expression_int_scalar(), Gstructure_parameters, hash_put(), in_forward_defined(), in_forward_defined_p(), make_entity_expression(), make_nsp_entity(), MAPL, NIL, pips_debug, print_structurals(), sp_feautrier_scalar_assign_call(), Words_Regular_Call(), and words_to_string().

+ Here is the call graph for this function:

◆ in_forward_defined()

int in_forward_defined ( entity  ent,
list swfl 
)

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

int in_forward_defined( (entity) ent ) AL 30/08/93 Returns the number of entities ent in the list Gscalar_written_forward.

Parameters
entnt
swflwfl

Definition at line 836 of file utils.c.

837 {
838  cons *pc;
839  int ret_int = 0;
840 
841  pips_debug(9, "doing \n");
842  for (pc = *swfl; pc != NIL; pc = pc->cdr ) {
843  if ((void *) ent == CAR(pc).p)
844  ret_int++;
845  }
846 
847  pips_debug(9, "returns : %d\n", ret_int);
848  return( ret_int );
849 }
struct cons * cdr
The pointer to the next element.
Definition: newgen_list.h:43

References CAR, cons::cdr, NIL, and pips_debug.

Referenced by get_sp_of_call_p().

+ Here is the caller graph for this function:

◆ in_forward_defined_p()

bool in_forward_defined_p ( entity  ent,
list swfl 
)

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

bool in_forward_defined_p( (entity) ent ) AL 04/93 Returns true if ent is in global variable Gscalar_written_forward.

Parameters
entnt
swflwfl

Definition at line 855 of file utils.c.

856 {
857  entity ch;
858 
859  pips_debug(7, "doing \n");
860  ch = (entity) gen_find_eq(ent, *swfl );
861  pips_debug(9, "scalar written_forward = %s\n",
862  print_structurals(*swfl) );
863  return( ch != entity_undefined );
864 }
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14

References entity_undefined, gen_find_eq(), pips_debug, and print_structurals().

Referenced by get_sp_of_call_p().

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

◆ is_expression_in_list()

bool is_expression_in_list ( expression  exp,
list  l 
)

State if an expression OR part of that expression corresponds to one of the entity of the list l.

This function was specifically designed in order to find if an expression is using one of the variable/entity listed in l. The function considers that the list only contains scalar variables.

Parameters
expxp

Definition at line 1200 of file utils.c.

1200  {
1201  if (l == NIL)
1202  return false;
1204  switch (syntax_tag(s)) {
1205  // If the expression is an array we go look among the indices by calling
1206  // the function on these indices
1207  case is_syntax_reference :
1208  {
1210  if (reference_indices(ref) != NIL) {
1212  if(is_expression_in_list(e, l))
1213  return true;
1214  }
1215  }
1216  else {
1217  entity ent = reference_variable(ref);
1218  if (gen_find_eq(ent, l) != chunk_undefined)
1219  return true;
1220  }
1221  }
1222  break;
1223  // Same principle, we go look among the arguments of the call
1224  case is_syntax_call :
1225  {
1226  call c = syntax_call(s);
1228  if(is_expression_in_list(e, l))
1229  return true;
1230  }
1231  }
1232  break;
1233  case is_syntax_cast :
1234  {
1235  cast ca = syntax_cast(s);
1237  if (gen_find_eq(ent, l) != chunk_undefined) {
1238  return true;
1239  }
1240  }
1241  break;
1242  // We call the function on every component of the range object
1243  case is_syntax_range :
1244  {
1245  range ra = syntax_range(s);
1247  }
1248  break;
1249  case is_syntax_subscript :
1250  {
1251  subscript sub = syntax_subscript(s);
1252  bool isinArray = is_expression_in_list(subscript_array(sub), l);
1253  if (isinArray)
1254  return true;
1256  if (is_expression_in_list(e, l)) {
1257  return true;
1258  }
1259  }
1260  }
1261  break;
1262  case is_syntax_application :
1263  {
1265  bool isinFunction = is_expression_in_list(application_function(app), l);
1266  if (isinFunction)
1267  return true;
1269  if (is_expression_in_list(e, l)) {
1270  return true;
1271  }
1272  }
1273  }
1274  break;
1275  case is_syntax_va_arg :
1276  {
1277  list sil = syntax_va_arg(s);
1278  FOREACH(sizeofexpression, soe, sil) {
1280  return true;
1281  }
1282  }
1283  break;
1285  {
1288  return true;
1289  }
1290  break;
1291  default :
1292  return false;
1293  }
1294  return false;
1295  }
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
#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 syntax_tag(x)
Definition: ri.h:2727
#define reference_variable(x)
Definition: ri.h:2326
#define range_upper(x)
Definition: ri.h:2290
#define sizeofexpression_expression(x)
Definition: ri.h:2409
#define syntax_cast(x)
Definition: ri.h:2739
#define syntax_application(x)
Definition: ri.h:2748
#define syntax_va_arg(x)
Definition: ri.h:2751
#define syntax_range(x)
Definition: ri.h:2733
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_application
Definition: ri.h:2697
@ is_syntax_cast
Definition: ri.h:2694
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_va_arg
Definition: ri.h:2698
@ is_syntax_reference
Definition: ri.h:2691
@ is_syntax_sizeofexpression
Definition: ri.h:2695
@ is_syntax_subscript
Definition: ri.h:2696
#define range_increment(x)
Definition: ri.h:2292
#define cast_expression(x)
Definition: ri.h:747
#define application_arguments(x)
Definition: ri.h:510
#define subscript_indices(x)
Definition: ri.h:2563
#define syntax_sizeofexpression(x)
Definition: ri.h:2742
#define syntax_call(x)
Definition: ri.h:2736
#define subscript_array(x)
Definition: ri.h:2561
#define application_function(x)
Definition: ri.h:508
#define range_lower(x)
Definition: ri.h:2288
#define syntax_subscript(x)
Definition: ri.h:2745

References application_arguments, application_function, call_arguments, cast_expression, chunk_undefined, exp, expression_syntax, expression_to_entity(), FOREACH, gen_find_eq(), is_expression_in_list(), is_syntax_application, is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, is_syntax_subscript, is_syntax_va_arg, NIL, range_increment, range_lower, range_upper, ref, reference_indices, reference_variable, sizeofexpression_expression, subscript_array, subscript_indices, syntax_application, syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_subscript, syntax_tag, and syntax_va_arg.

Referenced by get_reference_assignments(), and is_expression_in_list().

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

◆ loops_to_indices()

list loops_to_indices ( list  l)

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

list loops_to_indices((loop) l ) AL 04/93 Returns indices of the loop -list l.

Definition at line 630 of file utils.c.

631 {
632  list rl = NIL;
633  loop lo;
634 
635  pips_debug(7, "doing\n");
636  if (l == NIL) return(NIL);
637  MAPL( loop_ptr, {
638  lo = LOOP(CAR( loop_ptr ));
639  ADD_ELEMENT_TO_LIST( rl, ENTITY, loop_index( lo ) );
640  }, l);
641  return rl;
642 }
#define LOOP(x)
LOOP.
Definition: ri.h:1606
#define loop_index(x)
Definition: ri.h:1640

References ADD_ELEMENT_TO_LIST, CAR, ENTITY, LOOP, loop_index, MAPL, NIL, and pips_debug.

Referenced by splc_linear_expression_p().

+ Here is the caller graph for this function:

◆ make_undefined_list()

list make_undefined_list ( void  )

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

list make_undefined_list( ) AL 04/93 Duplicates a list of 2 undefined statements.

FI: this is no longer possible. List elements must be defined. Maybe empty/nop statements could be used instead?

Definition at line 815 of file utils.c.

816 {
817  list the_list = NIL;
818 
819  pips_debug(7, "doing\n");
820  /*
821  ADD_ELEMENT_TO_LIST( the_list, STATEMENT, statement_undefined);
822  ADD_ELEMENT_TO_LIST( the_list, STATEMENT, statement_undefined);
823  */
824  ADD_ELEMENT_TO_LIST( the_list, STATEMENT,
826  ADD_ELEMENT_TO_LIST( the_list, STATEMENT,
828  return the_list;
829 }
statement make_continue_statement(entity)
Definition: statement.c:953
entity entity_empty_label(void)
Definition: entity.c:1105
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413

References ADD_ELEMENT_TO_LIST, entity_empty_label(), make_continue_statement(), NIL, pips_debug, and STATEMENT.

Referenced by loop_normalize_of_loop(), and loop_normalize_of_statement().

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

◆ ndf_normalized_test()

list ndf_normalized_test ( expression  exp,
list ell 
)

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

list ndf_normalized_test( (expression) exp, (list) *ell) AL 04/93 Returns a list of positive linear forms from an input expression which is a logical combinaison of affine forms of structural parameters and of loop counters.

Redon FND propagation : see document.

We propagate an Exclusive Normal Disjunctive Form

if (ENTITY_OR_P( fun )) { list not_l1, not_l2, l1, l2;

l1 = ndf_normalized_test(arg1, ell); l2 = ndf_normalized_test( arg2, ell); not_l1 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg1), ell ); not_l2 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg2), ell );

MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, l2); }, not_l1 );

MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, l2); }, l1 );

MAPL( exp_ptr, { expression S1 = EXPRESSION(CAR( exp_ptr )); MAPL( exp_ptr2, { expression T1 = EXPRESSION(CAR( exp_ptr )); ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, MakeBinaryCall( ENTITY_AND, S1, T1 ) ); }, not_l2); }, l1 );

return( ret_list ); }

Parameters
expxp
ellll

Definition at line 306 of file utils.c.

307 {
308  list args, ret_list = NIL;
309  entity fun;
310  expression arg1, arg2, exp2, exp3;
311 
312  pips_debug(7, "doing\n");
313  if ( (exp == expression_undefined) ||
315  return NIL;
316  }
317  pips_debug(7, "input exp : %s\n",
319 
322  if(ENDP(args)) return NIL;
323 
324  if (splc_positive_relation_p(exp, ell)) {
325  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp );
326  return( ret_list );
327  }
328  if (ENTITY_NOT_P( fun )) {
329  arg1 = EXPRESSION(CAR(args));
330  if (splc_positive_relation_p(arg1, ell)) {
331  exp3 = EXPRESSION(CAR( call_arguments(
332  syntax_call(expression_syntax( arg1 )))));
333  exp2 = MakeBinaryCall( ENTITY_GE,
335  int_to_expression(-1),
336  exp3 ),
337  int_to_expression(0) );
338  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp2 );
339  return( ret_list );
340  }
341  else {
343 
344  MAPL( exp_ptr, {
345  exp3 = EXPRESSION(CAR( exp_ptr ));
346  if (exp2 == expression_undefined)
347  exp2 = sc_opposite_exp_of_conjunction(exp3, ell);
348  else
349  exp2 = MakeBinaryCall(ENTITY_AND,
351  copy_expression( exp2 ) );
352  }, ndf_normalized_test(arg1, ell));
353  ret_list = ndf_normalized_test(exp2, ell);
354  return( ret_list );
355  }
356  }
357 
358  arg1 = EXPRESSION(CAR(args));
359  arg2 = EXPRESSION(CAR(CDR(args)));
360 
361  /* Redon FND propagation : see document. */
362  if (ENTITY_OR_P( fun )) {
363  expression exp3;
364 
365  MAPL( exp_ptr, {
366  exp3 = EXPRESSION(CAR( exp_ptr ));
367  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp3 );
368  }, ndf_normalized_test(arg1, ell));
369  MAPL( exp_ptr, {
370  exp3 = EXPRESSION(CAR( exp_ptr ));
371  ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION, exp3 );
372  }, ndf_normalized_test(arg2, ell));
373  return( ret_list );
374  }
375 
376  /*
377  %%%%%%%%%%%%%
378  */
379 
380  /* We propagate an Exclusive Normal Disjunctive Form */
381  /* if (ENTITY_OR_P( fun )) {
382  * list not_l1, not_l2, l1, l2;
383  *
384  *l1 = ndf_normalized_test(arg1, ell);
385  *l2 = ndf_normalized_test( arg2, ell);
386  *not_l1 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg1), ell );
387  *not_l2 = ndf_normalized_test( MakeUnaryCall(ENTITY_NOT, arg2), ell );
388  *
389  * MAPL( exp_ptr, {
390  * expression S1 = EXPRESSION(CAR( exp_ptr ));
391  *MAPL( exp_ptr2, {
392  *expression T1 = EXPRESSION(CAR( exp_ptr ));
393  *ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
394  *MakeBinaryCall( ENTITY_AND, S1, T1 ) );
395  *}, l2);
396  *}, not_l1 );
397  *
398  *MAPL( exp_ptr, {
399  *expression S1 = EXPRESSION(CAR( exp_ptr ));
400  * MAPL( exp_ptr2, {
401  * expression T1 = EXPRESSION(CAR( exp_ptr ));
402  * ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
403  * MakeBinaryCall( ENTITY_AND, S1, T1 ) );
404  * }, l2);
405  * }, l1 );
406  *
407  * MAPL( exp_ptr, {
408  * expression S1 = EXPRESSION(CAR( exp_ptr ));
409  * MAPL( exp_ptr2, {
410  * expression T1 = EXPRESSION(CAR( exp_ptr ));
411  * ADD_ELEMENT_TO_LIST( ret_list, EXPRESSION,
412  * MakeBinaryCall( ENTITY_AND, S1, T1 ) );
413  * }, not_l2);
414  * }, l1 );
415  *
416  * return( ret_list );
417  *}
418  */
419  else if (ENTITY_AND_P( fun )) {
420  expression exp4, exp5, exp6;
421  list l1, l2;
422 
423  l1 = ndf_normalized_test(arg1, ell);
424  l2 = ndf_normalized_test(arg2, ell);
425  MAPL( exp_ptr, {
426  exp4 = EXPRESSION(CAR( exp_ptr ));
427  MAPL( ep, {
428  exp5 = EXPRESSION(CAR( ep ));
429  exp6 = MakeBinaryCall( ENTITY_AND,
430  exp4, exp5 );
431  ADD_ELEMENT_TO_LIST(ret_list, EXPRESSION, exp6);
432  }, l2 );
433  }, l1 );
434  return( ret_list );
435  }
436  else return NIL;
437 }
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
string expression_to_string(expression e)
Definition: expression.c:77
#define ENTITY_OR_P(e)
#define ENTITY_AND_P(e)
#define MINUS_OPERATOR_NAME
#define ENTITY_NOT_P(e)
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
#define expression_undefined
Definition: ri.h:1223
#define ENTITY_AND
#define ENTITY_GE
bool splc_positive_relation_p(expression exp, list *ell)
================================================================
Definition: utils.c:282
expression sc_opposite_exp_of_conjunction(expression exp, list *ell)
================================================================
Definition: utils.c:236
list ndf_normalized_test(expression exp, list *ell)
================================================================
Definition: utils.c:306

References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, CDR, copy_expression(), ENDP, ENTITY_AND, ENTITY_AND_P, ENTITY_GE, ENTITY_NOT_P, ENTITY_OR_P, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MAPL, MINUS_OPERATOR_NAME, ndf_normalized_test(), NIL, pips_debug, sc_opposite_exp_of_conjunction(), splc_positive_relation_p(), syntax_call, and syntax_tag.

Referenced by ndf_normalized_test(), and sc_conditional().

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

◆ normalizable_loop_p()

bool normalizable_loop_p ( loop  l)

bool normalizable_loop_p(loop l) Returns true if "l" has a constant step.

Definition at line 1172 of file utils.c.

1173 {
1174  pips_debug(7, "doing\n");
1176 }
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
Definition: expression.c:2453
#define loop_range(x)
Definition: ri.h:1642

References expression_constant_p(), loop_range, pips_debug, and range_increment.

Referenced by loop_normalize_of_loop().

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

◆ normalizable_loop_p_retrieved()

bool normalizable_loop_p_retrieved ( loop  l)

Code retrieved from revision 14476, transformations/loop_normalize.c.

Code to be retrieved: I suppose you need a constant increment?

Definition at line 1183 of file utils.c.

1184 {
1185  bool ok = false;
1186  entity i = loop_index(l);
1187  range r = loop_range(l);
1188 
1190 
1191  return ok;
1192 }
bool normalizable_and_linear_loop_p(entity, range)
static bool ok

References loop_index, loop_range, normalizable_and_linear_loop_p(), and ok.

+ Here is the call graph for this function:

◆ normalize_test_leaves()

expression normalize_test_leaves ( expression  exp,
list ell 
)

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

expression normalize_test_leaves((expression) exp, (list) *ell) AL 04/93 If exp is linear in structurals and loop-counters, it returns the same expression with linear positive forms

We return expression_undefined if we can not normalize

Parameters
expxp
ellll

Definition at line 445 of file utils.c.

448 {
450  entity fun = call_function(syntax_call( s ));
451  list args = call_arguments(syntax_call( s ));
452  list new_args = NIL;
454  expression e, ne, arg1, arg2, arg3, arg4;
455 
456  if (exp == expression_undefined || args == NIL) return( exp );
457  pips_debug(7, "exp : %s\n",
459  if (syntax_tag( s ) != is_syntax_call) return( ret_exp );
460 
461  if (ENTITY_NOT_P( fun )) {
462  expression exp1 =
463  normalize_test_leaves(EXPRESSION(CAR(args)), ell);
464 
465  /* We return expression_undefined if we can not normalize */
466  if (exp1 == expression_undefined) return(expression_undefined);
467 
468  ret_exp = MakeUnaryCall(ENTITY_NOT, exp1 );
469  pips_debug(7, "returning : %s\n",
470  expression_to_string( ret_exp ) );
471  return( ret_exp );
472  }
473 
474  arg1 = EXPRESSION(CAR(args));
475  arg2 = EXPRESSION(CAR(CDR(args)));
476  arg3 = copy_expression( arg1 );
477  arg4 = copy_expression( arg2 );
478  if (ENTITY_EQUIV_P( fun )) {
479  ret_exp1 = MakeBinaryCall( ENTITY_OR,
480  MakeUnaryCall( ENTITY_NOT, arg1),
481  arg2 );
482  ret_exp2 = MakeBinaryCall( ENTITY_OR,
483  MakeUnaryCall( ENTITY_NOT, arg4),
484  arg3 ) ;
485  exp = MakeBinaryCall( ENTITY_AND, ret_exp1, ret_exp2 );
486  }
487  else if (ENTITY_NON_EQUIV_P( fun )) {
489  MakeUnaryCall( ENTITY_NOT, arg2),
490  arg1 );
492  MakeUnaryCall( ENTITY_NOT, arg3),
493  arg4 ) ;
494  exp = MakeBinaryCall( ENTITY_OR, ret_exp1, ret_exp2);
495  }
496 
497  s = expression_syntax( exp );
498  fun = call_function(syntax_call( s ));
499  args = call_arguments(syntax_call( s ));
500  arg1 = EXPRESSION(CAR(args));
501  arg2 = EXPRESSION(CAR(CDR(args)));
502  arg3 = copy_expression( arg1 );
503  arg4 = copy_expression( arg2 );
505  MAPL( exp_ptr, {
506  e = EXPRESSION(CAR( exp_ptr ));
507  ne = normalize_test_leaves(e, ell);
508  if (ne == expression_undefined) return(ne);
510  copy_expression( ne ));
511  }, args);
512  call_arguments(syntax_call( s )) = new_args;
513  ret_exp = copy_expression( exp );
514  pips_debug(7, "returning : %s\n",
515  expression_to_string( ret_exp ) );
516  return( ret_exp );
517  }
518  else if ( ENTITY_RELATIONAL_OPERATOR_P( fun ) &&
519  (!splc_linear_expression_p(arg1, ell) ||
520  !splc_linear_expression_p(arg2, ell)) ) {
521 
522  pips_debug(7, "returning : %s\n",
523  "expression_undefined" );
524  return( expression_undefined );
525  }
526  if (ENTITY_LESS_THAN_P( fun )) {
527  ret_exp = MakeBinaryCall( ENTITY_GE,
529  make_op_exp(
531  arg2, arg1 ),
532  int_to_expression(1) ),
533  int_to_expression(0) );
534  }
535  else if (ENTITY_LESS_OR_EQUAL_P( fun )) {
536  ret_exp = MakeBinaryCall( ENTITY_GE,
538  arg2, arg1 ),
539  int_to_expression(0) );
540  }
541  else if (ENTITY_GREATER_THAN_P( fun )) {
542  ret_exp = MakeBinaryCall( ENTITY_GE,
544  make_op_exp(
546  arg1, arg2 ),
547  int_to_expression(1) ),
548  int_to_expression(0) );
549  }
550  else if (ENTITY_GREATER_OR_EQUAL_P( fun )) {
551  ret_exp = MakeBinaryCall( (entity) ENTITY_GE,
553  arg1, arg2 ),
554  int_to_expression(0) );
555  }
556  else if (ENTITY_EQUAL_P( fun )) {
557  ret_exp1 = MakeBinaryCall( ENTITY_GE,
559  arg1, arg2 ),
560  int_to_expression(0) );
561  ret_exp2 = MakeBinaryCall( ENTITY_GE,
563  arg4, arg3 ),
564  int_to_expression(0) ) ;
565  ret_exp = MakeBinaryCall( ENTITY_AND, ret_exp1, ret_exp2);
566  }
567  else if (ENTITY_NON_EQUAL_P( fun )) {
568  ret_exp1 = MakeBinaryCall( ENTITY_GE,
571  arg1, arg2 ),
572  int_to_expression(1) ),
573  int_to_expression(0) );
574  ret_exp2 = MakeBinaryCall( ENTITY_GE,
577  arg4, arg3 ),
578  int_to_expression(1) ),
579  int_to_expression(0) );
580  ret_exp = MakeBinaryCall( ENTITY_OR, ret_exp1, ret_exp2);
581  }
582  else ret_exp = expression_undefined;
583 
584  pips_debug(7, "returning : %s\n",
585  ((ret_exp == expression_undefined)?"expression_undefined":\
586  expression_to_string( ret_exp )) );
587  return( ret_exp );
588 }
#define ENTITY_RELATIONAL_OPERATOR_P(e)
#define ENTITY_NON_EQUAL_P(e)
#define ENTITY_EQUAL_P(e)
#define ENTITY_LESS_THAN_P(e)
#define ENTITY_GREATER_THAN_P(e)
#define ENTITY_NON_EQUIV_P(e)
#define ENTITY_LESS_OR_EQUAL_P(e)
#define ENTITY_GREATER_OR_EQUAL_P(e)
#define ENTITY_EQUIV_P(e)
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
Definition: expression.c:342
#define ENTITY_OR
#define ENTITY_NOT
#define ENTITY_STRICT_LOGICAL_OPERATOR_P(e)
bool splc_linear_expression_p(expression exp, list *ell)
================================================================
Definition: utils.c:648
expression normalize_test_leaves(expression exp, list *ell)
================================================================
Definition: utils.c:445

References ADD_ELEMENT_TO_LIST, call_arguments, call_function, CAR, CDR, copy_expression(), ENTITY_AND, ENTITY_EQUAL_P, ENTITY_EQUIV_P, ENTITY_GE, ENTITY_GREATER_OR_EQUAL_P, ENTITY_GREATER_THAN_P, ENTITY_LESS_OR_EQUAL_P, ENTITY_LESS_THAN_P, ENTITY_NON_EQUAL_P, ENTITY_NON_EQUIV_P, ENTITY_NOT, ENTITY_NOT_P, ENTITY_OR, ENTITY_RELATIONAL_OPERATOR_P, ENTITY_STRICT_LOGICAL_OPERATOR_P, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MakeUnaryCall(), MAPL, MINUS_OPERATOR_NAME, NIL, normalize_test_leaves(), pips_debug, splc_linear_expression_p(), syntax_call, and syntax_tag.

Referenced by normalize_test_leaves(), and sc_conditional().

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

◆ print_structurals()

string print_structurals ( list  l)

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

char* print_structurals( (list) l ) AL 04/93 Prints structural parameters.

Definition at line 732 of file utils.c.

733 {
734  return(strdup( words_to_string(words_entity_list( l )) ));
735 }
char * strdup()
list words_entity_list(list obj)
================================================================
Definition: prettyprint.c:265

References strdup(), words_entity_list(), and words_to_string().

Referenced by get_sp_of_call_p(), in_forward_defined_p(), static_controlize(), static_controlize_statement(), static_controlize_unstructured(), and verify_structural_parameters().

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

◆ sc_conditional()

expression sc_conditional ( expression  exp,
list ell 
)

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

expression sc_conditional( (expression) exp, (list) *ell ) AL 04/93 If exp is linear in structurals and loop-counters, it returns the same expression with a normal disjunctive form.

Parameters
expxp
ellll

Definition at line 596 of file utils.c.

597 {
598  expression e, ret_exp = expression_undefined;
600  list ndf_list;
601 
602  pips_debug(7, "exp : %s\n",
604 
605  if ( syntax_tag(s) != is_syntax_call ) return( ret_exp );
606  e = normalize_test_leaves(exp, ell);
607  ndf_list = ndf_normalized_test(e, ell);
608  if (ndf_list != NIL) {
609  ret_exp = EXPRESSION(CAR( ndf_list ));
610  ndf_list = CDR( ndf_list );
611  MAPL( exp_ptr,{
612  e = EXPRESSION(CAR( exp_ptr ));
613  ret_exp = MakeBinaryCall( ENTITY_OR,
614  copy_expression( ret_exp ), e );
615  }, ndf_list );
616  }
617 
618  pips_debug(7, "returning : %s\n",
619  ((ret_exp == expression_undefined)?"expression_undefined":
620  expression_to_string( ret_exp )) );
621  return( ret_exp );
622 }

References CAR, CDR, copy_expression(), ENTITY_OR, exp, EXPRESSION, expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, MakeBinaryCall(), MAPL, ndf_normalized_test(), NIL, normalize_test_leaves(), pips_debug, and syntax_tag.

Referenced by static_controlize_statement().

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

◆ sc_entity_to_formal_integer_parameters()

list sc_entity_to_formal_integer_parameters ( entity  f)

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

list sc_entity_to_formal_integer_parameters((entity) f) This is a strict copy of entity_to_formal_integer_parameters from semantics/interprocedural.c . This function is copied here to keep locality of local functions to each pass.

FI: Well, but it was modified to handle all integer scalar variables and a bug was added because a COMMON has a RAM storage (OK, this could be discussed). I add a test on type_variable_p()

Definition at line 900 of file utils.c.

902 {
903  list formals_or_ram_integer = NIL;
904  list decl = NIL;
905 
906  pips_assert("sc_entity_to_formal_integer_parameters",entity_module_p(f));
907 
909  MAPL(ce, {entity e = ENTITY(CAR(ce));
910  storage sto = entity_storage(e);
911  type t = entity_type(e);
912 
913  if( type_variable_p(t)
914  && (storage_formal_p(sto) || storage_ram_p(sto))
916  formals_or_ram_integer = CONS(ENTITY, e,
917  formals_or_ram_integer);},
918  decl);
919 
920  return formals_or_ram_integer;
921 }
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
code entity_code(entity e)
Definition: entity.c:1098
bool entity_module_p(entity e)
Definition: entity.c:683
bool entity_integer_scalar_p(entity)
for variables (like I), not constants (like 1)! use integer_constant_p() for constants
Definition: variable.c:1130
#define storage_formal_p(x)
Definition: ri.h:2522
#define entity_storage(x)
Definition: ri.h:2794
#define code_declarations(x)
Definition: ri.h:784
#define storage_ram_p(x)
Definition: ri.h:2519
#define entity_type(x)
Definition: ri.h:2792
#define type_variable_p(x)
Definition: ri.h:2947

References CAR, code_declarations, CONS, ENTITY, entity_code(), entity_integer_scalar_p(), entity_module_p(), entity_storage, entity_type, f(), MAPL, NIL, pips_assert, storage_formal_p, storage_ram_p, and type_variable_p.

Referenced by static_controlize().

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

◆ sc_list_of_entity_dup()

list sc_list_of_entity_dup ( list  l)

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

list sc_list_of_entity_dup( (list) l ) AL 04/93 Duplicates a list of entities.

Definition at line 761 of file utils.c.

762 {
763  list rl = NIL;
764 
765  pips_debug( 7, "doing\n");
766  if ( l == NIL ) return( NIL );
767  MAPL( ent_ptr, {
768  entity ent = ENTITY(CAR( ent_ptr ));
769  ADD_ELEMENT_TO_LIST( rl, ENTITY, ent );
770  }, l );
771  return( rl );
772 }

References ADD_ELEMENT_TO_LIST, CAR, ENTITY, MAPL, NIL, and pips_debug.

Referenced by static_controlize_call(), static_controlize_statement(), and static_controlize_unstructured().

+ Here is the caller graph for this function:

◆ sc_list_of_exp_dup()

list sc_list_of_exp_dup ( list  l)

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

list sc_list_of_exp_dup( (list) l ) AL 04/93 Duplicates a list of expressions.

Definition at line 741 of file utils.c.

742 {
743  list ret_list = NIL;
744 
745  pips_debug(9, "begin\n");
746  for(; !ENDP( l ); POP( l ) ) {
747  expression exp;
748 
749  exp = EXPRESSION(CAR( l ));
751  }
752 
753  pips_debug(9, "end\n");
754  return( ret_list );
755 }
#define POP(l)
Modify a list pointer to point on the next element of the list.
Definition: newgen_list.h:59

References ADD_ELEMENT_TO_LIST, CAR, copy_expression(), ENDP, exp, EXPRESSION, NIL, pips_debug, and POP.

Referenced by static_controlize_call(), static_controlize_statement(), and static_controlize_unstructured().

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

◆ sc_list_of_loop_dup()

list sc_list_of_loop_dup ( list  l)

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

list sc_list_of_loop_dup( (list) l ) AL 04/93 Duplicates a list of loops. See Newgen gen_copy_seq()?

Definition at line 778 of file utils.c.

779 {
780  list rl = NIL;
781 
782  pips_debug( 7, "doing\n");
783  if ( l == NIL ) return(NIL);
784  MAPL( loop_ptr, {
785  loop lo = LOOP(CAR( loop_ptr ));
786  ADD_ELEMENT_TO_LIST( rl, LOOP, lo );
787  }, l );
788  return( rl );
789 }

References ADD_ELEMENT_TO_LIST, CAR, LOOP, MAPL, NIL, and pips_debug.

Referenced by static_controlize_statement(), and static_controlize_unstructured().

+ Here is the caller graph for this function:

◆ sc_loop_dup()

loop sc_loop_dup ( loop  l)

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

list sc_loop_dup( (list) l ) AL 04/93 Duplicates a loop with sharing of the loop_body and sharing of the loop locals.

Definition at line 796 of file utils.c.

797 {
798  loop new_loop;
799 
800  pips_debug( 7, "doing\n");
801  new_loop = make_loop(loop_index(l), copy_range(loop_range(l)),
803  loop_locals(l));
804 
805  return(new_loop);
806 }
range copy_range(range p)
RANGE.
Definition: ri.c:2005
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
#define loop_body(x)
Definition: ri.h:1644
#define loop_execution(x)
Definition: ri.h:1648
#define loop_label(x)
Definition: ri.h:1646
#define loop_locals(x)
Definition: ri.h:1650

References copy_range(), loop_body, loop_execution, loop_index, loop_label, loop_locals, loop_range, make_loop(), and pips_debug.

+ Here is the call graph for this function:

◆ sc_opposite_exp_of_conjunction()

expression sc_opposite_exp_of_conjunction ( expression  exp,
list ell 
)

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

expression sc_opposite_exp_of_conjunction(expression exp, (list) *ell) AL 08/19/93 Input : exp a conjunction of linear expressions Output : simplified value of NOT( exp )

Parameters
expxp
ellll

Definition at line 236 of file utils.c.

239 {
240  expression ret_exp;
241 
242  pips_debug(9, "begin\n");
243  if ( (exp == expression_undefined) ||
245  ret_exp = expression_undefined;
246  }
247  else if (splc_positive_relation_p(exp, ell)) {
248  expression exp1, exp2;
249  exp1 = EXPRESSION(CAR( call_arguments(
251  exp2 = MakeBinaryCall( ENTITY_GE,
253  int_to_expression(-1), exp1 ),
254  int_to_expression(0) );
255  ret_exp = exp2;
256  }
257  else if(ENTITY_AND_P(call_function(
259  list args = NIL;
260  expression r_exp, l_exp;
261 
263  l_exp = EXPRESSION(CAR( args ));
264  r_exp = EXPRESSION(CAR(CDR( args )));
265  ret_exp = MakeBinaryCall( ENTITY_OR,
266  sc_opposite_exp_of_conjunction(l_exp, ell),
267  sc_opposite_exp_of_conjunction(r_exp, ell));
268 
269  }
270  else ret_exp = expression_undefined;
271 
272  pips_debug(9, "end\n");
273  return( ret_exp );
274 }

References call_arguments, call_function, CAR, CDR, ENTITY_AND_P, ENTITY_GE, ENTITY_OR, exp, EXPRESSION, expression_syntax, expression_undefined, int_to_expression(), is_syntax_call, make_op_exp(), MakeBinaryCall(), MINUS_OPERATOR_NAME, NIL, pips_debug, sc_opposite_exp_of_conjunction(), splc_positive_relation_p(), syntax_call, and syntax_tag.

Referenced by ndf_normalized_test(), and sc_opposite_exp_of_conjunction().

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

◆ sp_feautrier_expression_p()

bool sp_feautrier_expression_p ( expression  exp)

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

bool sp_feautrier_expression_p( (expression) exp) Returns true if exp quasi affine form.

Parameters
expxp

Definition at line 995 of file utils.c.

996 {
997  bool b = false;
999 
1000  pips_debug(7, "exp : %s \n",
1001  ((exp == expression_undefined)?"expression_undefined":
1002  expression_to_string( exp ) ));
1003 
1004  if (sp_linear_expression_p( exp )) return( true );
1005  if ( syntax_tag( s ) == is_syntax_call ) {
1006  call c;
1007  list args;
1008  expression exp1, exp2;
1009 
1010  c = syntax_call( s );
1011  if (ENTITY_DIVIDE_P(call_function( c ))) {
1012  args = call_arguments( c );
1013  exp1 = EXPRESSION(CAR( args ));
1014  exp2 = EXPRESSION(CAR( CDR(args) ));
1015  b = sp_feautrier_expression_p( exp1 )
1016  && expression_constant_p( exp2 );
1017  }
1018  }
1019  pips_debug(7, "returning : %s\n",
1020  (b?"TRUE":"FALSE") );
1021  return( b );
1022 }
#define ENTITY_DIVIDE_P(e)
bool sp_feautrier_expression_p(expression exp)
================================================================
Definition: utils.c:995
bool sp_linear_expression_p(expression exp)
================================================================
Definition: utils.c:928

References call_arguments, call_function, CAR, CDR, ENTITY_DIVIDE_P, exp, EXPRESSION, expression_constant_p(), expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, pips_debug, sp_feautrier_expression_p(), sp_linear_expression_p(), syntax_call, and syntax_tag.

Referenced by sp_feautrier_expression_p(), sp_feautrier_scalar_assign_call(), and static_controlize_statement().

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

◆ sp_feautrier_scalar_assign_call()

entity sp_feautrier_scalar_assign_call ( call  c)

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

entity sp_feautrier_scalar_assign_call( (call) c ) Returns the left-hand-side entity if it is an assignement of a linear combinaison of structural parameters.

Definition at line 1029 of file utils.c.

1030 {
1031  entity ent, ret_ent = entity_undefined;
1032  expression rhs;
1033 
1034  pips_debug(7, "doing\n");
1035  if ((ent = scalar_assign_call(c)) != entity_undefined) {
1036  rhs = EXPRESSION(CAR(CDR(call_arguments(c))));
1037  if (sp_feautrier_expression_p( rhs )) ret_ent = ent;
1038  }
1039  pips_debug(7,
1040  "returning : %s \n",
1041  ((ret_ent == entity_undefined)?"entity_undefined":
1042  entity_name( ret_ent )) );
1043  return( ret_ent );
1044 }
entity scalar_assign_call(call c)
entity scalar_assign_call((call) c) Detects if the call is an assignement and if the value assigned i...
#define entity_name(x)
Definition: ri.h:2790

References call_arguments, CAR, CDR, entity_name, entity_undefined, EXPRESSION, pips_debug, scalar_assign_call(), and sp_feautrier_expression_p().

Referenced by get_reference_assignments(), and get_sp_of_call_p().

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

◆ sp_linear_expression_p()

bool sp_linear_expression_p ( expression  exp)

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

bool sp_linear_expression_p( (expression) exp) Returns true if the expression is a linear combinaison of structural parameters.

Parameters
expxp

Definition at line 928 of file utils.c.

929 {
930  Pvecteur vect;
931  bool ONLY_SP;
932 
933  pips_debug(7, "exp : %s\n", expression_to_string(exp));
934 
936  ONLY_SP = false;
937  else
938  {
940  ONLY_SP = true;
941 
942  for(; !VECTEUR_NUL_P(vect) && ONLY_SP ; vect = vect->succ)
943  {
944  entity var = (entity) vect->var;
945 
946  if( ! term_cst(vect) )
947  if( ! (ENTITY_SP_P(var)) )
948  ONLY_SP = false;
949  }
950  }
952  pips_debug(7,
953  " result : %s\n", (ONLY_SP?"TRUE":"FALSE") );
954  return(ONLY_SP);
955 }
void unnormalize_expression(void *st)
void unnormalize_expression(expression exp): puts all the normalized field of expressions in "st" to ...
Definition: normalize.c:452
#define NORMALIZE_EXPRESSION(e)
#define normalized_tag(x)
Definition: ri.h:1778
#define expression_normalized(x)
Definition: ri.h:1249
#define normalized_linear(x)
Definition: ri.h:1781
@ is_normalized_complex
Definition: ri.h:1761
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
Variable var
Definition: vecteur-local.h:90
struct Svecteur * succ
Definition: vecteur-local.h:92
struct Svecteur * Pvecteur
#define VECTEUR_NUL_P(v)
#define term_cst(varval)

References ENTITY_SP_P, exp, expression_normalized, expression_to_string(), is_normalized_complex, NORMALIZE_EXPRESSION, normalized_linear, normalized_tag, pips_debug, Svecteur::succ, term_cst, unnormalize_expression(), Svecteur::var, and VECTEUR_NUL_P.

Referenced by sp_feautrier_expression_p().

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

◆ splc_feautrier_expression_p()

bool splc_feautrier_expression_p ( expression  exp,
list ell 
)

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

bool splc_feautrier_expression_p( (expression) exp ) Returns true if exp quasi affine form in structural parameters and in surrounding loop-counters.

Parameters
expxp
ellll

Definition at line 962 of file utils.c.

963 {
964  bool b = false;
966 
967  pips_debug(7, "exp : %s \n",
968  ((exp == expression_undefined)?"expression_undefined":
970 
971  if (splc_linear_expression_p(exp, ell)) return( true );
972  if ( syntax_tag( s ) == is_syntax_call ) {
973  call c;
974  list args;
975  expression exp1, exp2;
976 
977  c = syntax_call( s );
978  if (ENTITY_DIVIDE_P(call_function( c ))) {
979  args = call_arguments( c );
980  exp1 = EXPRESSION(CAR( args ));
981  exp2 = EXPRESSION(CAR( CDR(args) ));
982  b = splc_feautrier_expression_p(exp1, ell)
983  && expression_constant_p( exp2 );
984  }
985  }
986  pips_debug(7, "returning : %s\n",
987  (b?"TRUE":"FALSE") );
988  return( b );
989 }
bool splc_feautrier_expression_p(expression exp, list *ell)
================================================================
Definition: utils.c:962

References call_arguments, call_function, CAR, CDR, ENTITY_DIVIDE_P, exp, EXPRESSION, expression_constant_p(), expression_syntax, expression_to_string(), expression_undefined, is_syntax_call, pips_debug, splc_feautrier_expression_p(), splc_linear_expression_p(), syntax_call, and syntax_tag.

Referenced by splc_feautrier_expression_p(), and static_controlize_loop().

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

◆ splc_linear_access_to_arrays_p()

bool splc_linear_access_to_arrays_p ( list  l,
list ell 
)

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

bool splc_linear_access_to_arrays_p((list) l, (list) *ell) AL 04/93 Returns true if all expressions exp are structural parameters and loop counters linear functions.

Parameters
ellll

Definition at line 700 of file utils.c.

701 {
702  bool bo, ret_bo = true;
703  expression exp;
704  syntax s;
705  tag t;
706 
707  pips_debug(7, "doing\n");
708  if (l == NIL) return(true);
709  MAPL( exp_ptr, {
710  exp = EXPRESSION(CAR( exp_ptr ));
711  s = expression_syntax( exp );
712  t = syntax_tag( s );
713  if (t == is_syntax_call)
714  bo =
716  ell);
717  else if (t == is_syntax_reference)
718  bo =
720  ell);
721  else bo = false;
722  ret_bo = ret_bo && bo;
723  }, l );
724 
725  return( ret_bo );
726 }
int tag
TAG.
Definition: newgen_types.h:92
bool splc_linear_expression_list_p(list l, list *ell)
================================================================
Definition: utils.c:682
bool splc_linear_access_to_arrays_p(list l, list *ell)
================================================================
Definition: utils.c:700

References call_arguments, CAR, exp, EXPRESSION, expression_syntax, is_syntax_call, is_syntax_reference, MAPL, NIL, pips_debug, reference_indices, splc_linear_access_to_arrays_p(), splc_linear_expression_list_p(), syntax_call, syntax_reference, and syntax_tag.

Referenced by splc_linear_access_to_arrays_p(), and static_controlize_call().

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

◆ splc_linear_expression_list_p()

bool splc_linear_expression_list_p ( list  l,
list ell 
)

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

bool splc_linear_expression_list_p((list) l) AL 04/93 Returns true if all expressions exp are structural parameters and loop counters linear functions.

Parameters
ellll

Definition at line 682 of file utils.c.

683 {
684  bool bo = true;
685  expression exp;
686 
687  pips_debug( 7, "doing \n");
688  MAPL( exp_ptr, {
689  exp = EXPRESSION(CAR( exp_ptr ));
690  bo = bo && splc_linear_expression_p(exp, ell);
691  }, l );
692  return( bo );
693 }

References CAR, exp, EXPRESSION, MAPL, pips_debug, and splc_linear_expression_p().

Referenced by splc_linear_access_to_arrays_p().

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

◆ splc_linear_expression_p()

bool splc_linear_expression_p ( expression  exp,
list ell 
)

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

bool splc_linear_expression_p((expression) exp) AL 04/93 Returns true if exp is linear in structural parameters and loop counters.

Parameters
expxp
ellll

Definition at line 648 of file utils.c.

649 {
650  Pvecteur vect;
651  bool ONLY_SPLC;
652 
653  pips_debug(7, "exp : %s\n", expression_to_string(exp));
654 
656  ONLY_SPLC = false;
657  else
658  {
660  ONLY_SPLC = true;
661 
662  for(; !VECTEUR_NUL_P(vect) && ONLY_SPLC ; vect = vect->succ)
663  {
664  entity var = (entity) vect->var;
665  bool assigned_by_array = entity_assigned_by_array_p(var);
666  if( ! term_cst(vect) )
667  if(!(ENTITY_SP_P(var) || (gen_find_eq(var,loops_to_indices(*ell)) != chunk_undefined)) || assigned_by_array == true)
668  ONLY_SPLC = false;
669  }
670  }
672  pips_debug(7, " result : %s\n", (ONLY_SPLC?"TRUE":"FALSE") );
673  return(ONLY_SPLC);
674 }
#define entity_assigned_by_array_p(ent)
Definition: utils.c:86
list loops_to_indices(list l)
================================================================
Definition: utils.c:630

References chunk_undefined, entity_assigned_by_array_p, ENTITY_SP_P, exp, expression_normalized, expression_to_string(), gen_find_eq(), is_normalized_complex, loops_to_indices(), NORMALIZE_EXPRESSION, normalized_linear, normalized_tag, pips_debug, Svecteur::succ, term_cst, unnormalize_expression(), Svecteur::var, and VECTEUR_NUL_P.

Referenced by normalize_test_leaves(), splc_feautrier_expression_p(), splc_linear_expression_list_p(), and splc_positive_relation_p().

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

◆ splc_positive_relation_p()

bool splc_positive_relation_p ( expression  exp,
list ell 
)

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

bool splc_positive_relation_p((expression) exp, list *ell) AL 04/93 Returns true if exp is an affine form of structural parameters and of loop-counters.

Parameters
expxp
ellll

Definition at line 282 of file utils.c.

285 {
287  call c;
288  list args;
289 
290  pips_debug(7, "exp : %s\n",
292  if (syntax_tag(s) != is_syntax_call) return( false );
293  c = syntax_call( s );
294  if (!ENTITY_GREATER_OR_EQUAL_P(call_function( c ))) return( false );
295  args = call_arguments( c );
296  return(splc_linear_expression_p(EXPRESSION(CAR(args)), ell) &&
298 }
bool expression_equal_integer_p(expression exp, int i)
================================================================
Definition: expression.c:1977

References call_arguments, call_function, CAR, CDR, ENTITY_GREATER_OR_EQUAL_P, exp, EXPRESSION, expression_equal_integer_p(), expression_syntax, expression_to_string(), is_syntax_call, pips_debug, splc_linear_expression_p(), syntax_call, and syntax_tag.

Referenced by ndf_normalized_test(), and sc_opposite_exp_of_conjunction().

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

◆ stco_renumber_code()

int stco_renumber_code ( statement  in_st,
int  in_ct 
)

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

int stco_renumber_code( (statement) in_st, (int) in_ct ) AL 25/10/93 Input : A statement in_st and a begin count number in_ct. Output : Renumber statement_number in an textual order and return the last number attributed.

I've removed many renumbering since it is done by a deeper call to stco_renumber_code() and renumbering sequences kill an assert in the prettyprinter...

Renumber all the statement but the sequence:

Parameters
in_stn_st
in_ctn_ct

Definition at line 137 of file utils.c.

139 {
140  int count;
141  instruction inst;
142 
143  pips_debug(7, "begin\n");
144  count = in_ct;
145  inst = statement_instruction( in_st );
146 
147  /* Renumber all the statement but the sequence: */
149  statement_number(in_st) = count++;
150 
151  switch(instruction_tag(inst)) {
152  case is_instruction_block : {
153  MAPL( stmt_ptr, {
154  statement st = STATEMENT(CAR( stmt_ptr ));
155  /*
156  statement_number( st ) = count++;
157  */
158  count = stco_renumber_code( st, count );
159  }, instruction_block( inst ) );
160  break;
161  }
162  case is_instruction_test : {
163  test t = instruction_test(inst);
164  statement tt, tf;
165 
166  tt = test_true( t );
167  tf = test_false( t );
168  /*
169  statement_number( tt ) = count++;
170  statement_number( tf ) = count++;
171  */
172  count = stco_renumber_code( tt, count );
173  count = stco_renumber_code( tf, count );
174  break;
175  }
176  case is_instruction_loop : {
177  statement lb = loop_body( instruction_loop( inst ) );
178  /*
179  statement_number( lb ) = count++;
180  */
181  count = stco_renumber_code( lb, count );
182  break;
183  }
185  {
186  break;
187  }
189  {
190  break;
191  }
192  case is_instruction_call : {
193  break;
194  }
195  case is_instruction_goto : {
196  statement gs = instruction_goto( inst );
197  /*
198  statement_number( gs ) = count++;
199  */
200  count = stco_renumber_code( gs, count );
201  break;
202  }
204  {
205  break;
206  }
208  list blocs = NIL;
210 
212  blocs = gen_nreverse( blocs ) ;
213  MAPL( ctl_ptr, {
215  CONTROL(CAR( ctl_ptr )));
216  /*
217  statement_number( stmt ) = count++;
218  */
220  }, blocs);
221  gen_free_list(blocs);
222  break;
223  }
224  default : pips_internal_error("Ill. instruction tag");
225  }
226 
227  pips_debug(7, "return count : %d\n", count);
228  return( count );
229 }
static int count
Definition: SDG.c:519
void control_map_get_blocs(control c, list *l)
Build recursively the list of all controls reachable from a control of an unstructured.
Definition: control.c:75
list gen_nreverse(list cp)
reverse a list in place
Definition: list.c:304
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
#define pips_internal_error
Definition: misc-local.h:149
#define unstructured_control
After the modification in Newgen: unstructured = entry:control x exit:control we have create a macro ...
#define is_instruction_block
soft block->sequence transition
#define instruction_block(i)
#define instruction_loop(x)
Definition: ri.h:1520
#define instruction_goto(x)
Definition: ri.h:1526
#define test_false(x)
Definition: ri.h:2837
#define CONTROL(x)
CONTROL.
Definition: ri.h:910
@ is_instruction_goto
Definition: ri.h:1473
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_whileloop
Definition: ri.h:1472
@ is_instruction_expression
Definition: ri.h:1478
@ is_instruction_test
Definition: ri.h:1470
@ is_instruction_call
Definition: ri.h:1474
@ is_instruction_forloop
Definition: ri.h:1477
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511
#define test_true(x)
Definition: ri.h:2835
#define control_statement(x)
Definition: ri.h:941
#define instruction_test(x)
Definition: ri.h:1517
#define statement_number(x)
Definition: ri.h:2452
#define instruction_unstructured(x)
Definition: ri.h:1532
int stco_renumber_code(statement in_st, int in_ct)
================================================================
Definition: utils.c:137
Definition: statement.c:54

References CAR, CONTROL, control_map_get_blocs(), control_statement, count, gen_free_list(), gen_nreverse(), instruction_block, instruction_goto, instruction_loop, instruction_tag, instruction_test, instruction_unstructured, is_instruction_block, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_body, MAPL, NIL, pips_debug, pips_internal_error, STATEMENT, statement_instruction, statement_number, stco_renumber_code(), test_false, test_true, and unstructured_control.

Referenced by static_controlize(), and stco_renumber_code().

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

◆ stco_same_loops()

list stco_same_loops ( statement_mapping  in_map,
statement  in_s,
statement  in_s2 
)

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

utils.c

list stco_same_loops( in_map, in_s, in_s2 ) AL 25/10/93 Input : A static_control mapping on statements and 2 statements. Output : A list of loops common to in_s and in_s2.

Parameters
in_mapn_map
in_sn_s
in_s2n_s2

Definition at line 98 of file utils.c.

101 {
102  list l, l2, ret_l = NIL;
103  static_control sc, sc2;
104 
105  pips_debug(7,"begin\n");
106  sc = (static_control) GET_STATEMENT_MAPPING( in_map, in_s );
107  sc2= (static_control) GET_STATEMENT_MAPPING( in_map, in_s2 );
108  l = static_control_loops( sc );
109  l2 = static_control_loops( sc2 );
110  for(; !ENDP(l); POP(l)) {
111  list l3 = l2;
112  loop lo = LOOP(CAR( l ));
113  int in = statement_ordering(loop_body( lo ));
114  for(; !ENDP(l3); POP(l3) ) {
115  loop ll = LOOP(CAR( l3 ));
116  int in2 = statement_ordering(loop_body( ll ));
117  if( in == in2 ) ADD_ELEMENT_TO_LIST(ret_l, LOOP, ll);
118  }
119  }
120  pips_debug(7, "end \n");
121 
122  return( ret_l );
123 }
#define GET_STATEMENT_MAPPING(map, stat)
Definition: newgen-local.h:49
#define static_control_loops(x)
Definition: paf_ri.h:757
struct _newgen_struct_static_control_ * static_control
Definition: paf_ri.h:184
#define statement_ordering(x)
Definition: ri.h:2454

References ADD_ELEMENT_TO_LIST, CAR, ENDP, GET_STATEMENT_MAPPING, LOOP, loop_body, NIL, pips_debug, POP, statement_ordering, and static_control_loops.

Referenced by stco_common_loops_of_statements().

+ Here is the caller graph for this function:

◆ substitute_variable_by_expression()

static void substitute_variable_by_expression ( expression  e,
hash_table  fst 
)
static

rewriting of forward_substitute_in_exp, in_loop,...

FI: what was the initial semantics? Substitute the left hand sides only?

see transformations/induction_substitution.c

It's a simple case because the loop indices cannot be written within the loop bounds

FI: let's take care of memory leaks later...

The hash_table could contain syntax objects...

Definition at line 1122 of file utils.c.

1123 {
1124  syntax s = expression_syntax(e);
1125  if(syntax_reference_p(s)) {
1127  expression ne = hash_get(fst, (void *) v);
1128 
1129  if(!expression_undefined_p(ne)) {
1130  /* FI: let's take care of memory leaks later...
1131  *
1132  * The hash_table could contain syntax objects...
1133  */
1135  }
1136  }
1137 }
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
#define expression_undefined_p(x)
Definition: ri.h:1224

References expression_syntax, expression_undefined_p, hash_get(), reference_variable, syntax_reference, and syntax_reference_p.

Referenced by forward_substitute_in_anyloop(), forward_substitute_in_call(), and forward_substitute_in_exp().

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

◆ verify_structural_parameters()

void verify_structural_parameters ( list  the_list,
list swfl 
)

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

void verify_structural_parameters( (list) l ) AL 04/93 Updates the global variable Gstructure_parameters. 'l' is a list of entities, which are structural-parameters candidates. An entity will be a structural parameter if it is a candidate and if it is not written forward.

Parameters
the_listhe_list
swflwfl

Definition at line 873 of file utils.c.

874 {
875  pips_debug(7,"doing\n");
876  MAPL( el_ptr,
877  {
878  entity ent = ENTITY(CAR( el_ptr ));
879  if ( gen_find_eq( ent, *swfl )
880  == chunk_undefined )
882  ENTITY,
883  ent );
884  },
885  the_list);
886  pips_debug(7, "list of structurals : %s\n",
888 }

References ADD_ELEMENT_TO_LIST, CAR, chunk_undefined, ENTITY, gen_find_eq(), Gstructure_parameters, MAPL, pips_debug, and print_structurals().

Referenced by static_controlize().

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

Variable Documentation

◆ assigned_var

list assigned_var
extern

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

static_control static_controlize_statement((statement) s) AL 05/93 Computes s's static_control

Definition at line 207 of file static_controlize.c.

Referenced by static_controlize(), and static_controlize_statement().

◆ Gstructure_parameters

list Gstructure_parameters
extern

Global variables

extern list Gscalar_written_forward;

Global variables

static_controlize.c

Definition at line 81 of file static_controlize.c.

Referenced by get_sp_of_call_p(), static_controlize(), static_controlize_call(), static_controlize_statement(), static_controlize_unstructured(), and verify_structural_parameters().