PIPS
utils.c File Reference
#include "local.h"
#include "prettyprint.h"
+ Include dependency graph for utils.c:

Go to the source code of this file.

Macros

#define NLC_PREFIX   "NLC"
 – utils.c More...
 
#define ENTITY_NLC_P(e)   (strncmp(entity_local_name(e), NLC_PREFIX, 3) == 0)
 

Functions

bool instruction_in_list_p (instruction inst, list l)
 =========================================================================== More...
 
bool nlc_linear_expression_p (expression exp)
 =========================================================================== More...
 

Macro Definition Documentation

◆ ENTITY_NLC_P

#define ENTITY_NLC_P (   e)    (strncmp(entity_local_name(e), NLC_PREFIX, 3) == 0)

Definition at line 39 of file utils.c.

◆ NLC_PREFIX

#define NLC_PREFIX   "NLC"

– utils.c

package atomizer : Alexis Platonoff, juillet 91

Miscellaneous functions

Definition at line 38 of file utils.c.

Function Documentation

◆ instruction_in_list_p()

bool instruction_in_list_p ( instruction  inst,
list  l 
)

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

utils.c

bool instruction_in_list_p(instruction inst, list l): Returns true if "inst" is in "l".

Note: "l" must be a list of instructions.

Parameters
instnst

Definition at line 50 of file utils.c.

53 {
54 bool not_found = true;
55 
56 while((not_found) && (l != NIL))
57  {
58  instruction current_inst = INSTRUCTION(CAR(l));
59  if (inst == current_inst)
60  not_found = false;
61  else
62  l = CDR(l);
63  }
64 return (! not_found);
65 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define INSTRUCTION(x)
INSTRUCTION.
Definition: ri.h:1448

References CAR, CDR, INSTRUCTION, and NIL.

Referenced by modify_blocks().

+ Here is the caller graph for this function:

◆ nlc_linear_expression_p()

bool nlc_linear_expression_p ( expression  exp)

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

bool nlc_linear_expression_p(expression exp): returns true if "exp" is an integer linear expression with only NLCs variables.

NLC means Normalized Loop Counter.

Called functions : _ unnormalize_expression() : loop_normalize/utils.c

We unnormalize the expression, otherwise, it causes an error when we normalize an expression with sub-expressions already normalized. (cf. NormalizedExpression() in normalize/normalize.c).

This unnormalization is done recursively upon all the sub-expressions of "exp".

Parameters
expxp

Definition at line 78 of file utils.c.

80 {
81 Pvecteur vect;
82 bool ONLY_NLCs;
83 
84 pips_debug(7, "exp : %s\n", expression_to_string(exp));
85 
87  ONLY_NLCs = false;
88 else
89  {
91  ONLY_NLCs = true;
92 
93  for(; !VECTEUR_NUL_P(vect) && ONLY_NLCs ; vect = vect->succ)
94  {
95  entity var = (entity) vect->var;
96 
97  if( ! term_cst(vect) )
98  if( ! (ENTITY_NLC_P(var)) )
99  ONLY_NLCs = false;
100  }
101  }
102 
103 /* We unnormalize the expression, otherwise, it causes an error when we
104  * normalize an expression with sub-expressions already normalized.
105  * (cf. NormalizedExpression() in normalize/normalize.c).
106  *
107  * This unnormalization is done recursively upon all the sub-expressions of
108  * "exp".
109  */
111 
112 debug(7, "nlc_linear_expression_p", " result : %d\n", ONLY_NLCs);
113 
114 return(ONLY_NLCs);
115 }
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
#define ENTITY_NLC_P(e)
Definition: utils.c:39
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189
void unnormalize_expression(void *st)
void unnormalize_expression(expression exp): puts all the normalized field of expressions in "st" to ...
Definition: normalize.c:452
string expression_to_string(expression e)
Definition: expression.c:77
#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
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207
struct Svecteur * Pvecteur
#define VECTEUR_NUL_P(v)
#define term_cst(varval)

References debug(), ENTITY_NLC_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 atomizer_of_expression(), and atomizer_of_intrinsic().

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