expression.c File Reference

#include <stdio.h>
#include <string.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "text.h"
#include "text-util.h"
#include "arithmetique.h"
#include "pipsmake.h"
#include "ri-util.h"
Include dependency graph for ri-util/expression.c:

Go to the source code of this file.

Defines

#define ALREADY_SEEN(node)   (hash_defined_p(seen, (char*)node))
#define SEEN(node)   (hash_put(seen, (char*) node, (char*) 1))
#define DV_CIRCLE   ",a(\"_GO\",\"circle\")"
#define DV_YELLOW   ",a(\"COLOR\",\"yellow\")"

Functions

static string actual_fortran_string_to_compare (string fs, int *plength)
 quite lazy.
int fortran_string_compare (string fs1, string fs2)
 compare pips fortran string constants from the fortran point of view.
tag suggest_basic_for_expression (expression e)
 a BASIC tag is returned for the expression this is a preliminary version.
expression expression_mult (expression ex)
expression entity_to_expression (entity e)
 if v is a constant, returns a constant call.
expression make_entity_expression (entity e, cons *inds)
expression reference_to_expression (reference r)
expression call_to_expression (call c)
 Build an expression that call a function or procedure.
expression make_call_expression (entity e, list l)
 Build an expression that call an function entity with an argument list.
expression MakeNullaryCall (entity f)
 Creates a call expression to a function with zero arguments.
expression MakeUnaryCall (entity f, expression a)
 Creates a call expression to a function with one argument.
expression MakeBinaryCall (entity f, expression eg, expression ed)
 Creates a call expression to a function with 2 arguments.
expression MakeTernaryCall (entity f, expression e1, expression e2, expression e3)
 Creates a call expression to a function with 3 arguments.
expression make_assign_expression (expression lhs, expression rhs)
 Make an assign expression, since in C the assignment is a side effect operator.
bool expression_call_p (expression e)
 predicates and short cut accessors on expressions
call expression_call (expression e)
bool expression_cast_p (expression e)
cast expression_cast (expression e)
bool expression_field_p (expression e)
bool array_argument_p (expression e)
bool expression_reference_p (expression e)
 Test if an expression is a reference.
entity expression_variable (expression e)
bool is_expression_reference_to_entity_p (expression e, entity v)
 Test if an expression is a reference to a given variable entity.
bool same_expression_in_list_p (expression e, list le)
 This function returns TRUE, if there exists a same expression in the list FALSE, otherwise.
bool expression_equal_in_list_p (expression e, list le)
 This function returns TRUE, if there exists an expression equal in the list FALSE, otherwise.
bool logical_operator_expression_p (expression e)
bool relational_expression_p (expression e)
bool integer_expression_p (expression e)
bool logical_expression_p (expression e)
int trivial_expression_p (expression e)
 This function returns:
expression expression_verbose_reduction_p_and_return_increment (expression incr, bool filter(expression))
 Test if an expression is a verbose reduction of the form : "i = i op v" or "i = v op i".
bool expression_implied_do_p (e)
bool comma_expression_p (expression e)
bool expression_list_directed_p (e)
bool extended_integer_constant_expression_p (expression e)
 More extensive than next function.
bool integer_constant_expression_p (expression e)
 positive integer constant expression: call to a positive constant or to a sum of positive integer constant expressions (much too restrictive, but enough for the source codes submitted to PIPS up to now).
bool signed_integer_constant_expression_p (expression e)
bool expression_with_constant_signed_integer_value_p (expression e)
 The expression may be complicated but all its leaves are constants or parameters.
bool assignment_expression_p (expression e)
 Test if an expression is an assignment operation.
bool add_expression_p (expression e)
 Test if an expression is an addition.
bool sub_expression_p (expression e)
bool substraction_expression_p (expression e)
 Test if an expression is an substraction.
bool modulo_expression_p (expression e)
bool divide_expression_p (expression e)
bool power_expression_p (expression e)
bool abs_expression_p (expression e)
bool iabs_expression_p (expression e)
bool dabs_expression_p (expression e)
bool cabs_expression_p (expression e)
bool min0_expression_p (expression e)
bool max0_expression_p (expression e)
bool user_function_call_p (expression e)
bool operator_expression_p (expression e, string op_name)
expression make_true_expression ()
expression make_false_expression ()
bool true_expression_p (expression e)
bool false_expression_p (expression e)
boolean unbounded_dimension_p (dimension dim)
 boolean unbounded_dimension_p(dim) input : a dimension of an array entity.
expression find_ith_argument (list args, int n)
expression find_ith_expression (list le, int r)
 find_ith_expression() is obsolet; use find_ith_argument() instead
expression int_to_expression (_int i)
 transform an int into an expression and generate the corresponding entity if necessary; it is not clear if strdup() is always/sometimes necessary and if a memory leak occurs; wait till syntax/expression.c is merged with ri-util/expression.c
expression float_to_expression (float c)
expression complex_to_expression (float re, float im)
expression bool_to_expression (bool b)
expression Value_to_expression (Value v)
 added interface for linear stuff.
list expression_to_reference_list (expression e, list lr)
 conversion of an expression into a list of references; references are appended to list lr as they are encountered; array references are added before their index expressions are scanned;
list syntax_to_reference_list (syntax s, list lr)
void print_expression (expression e)
 no file descriptor is passed to make is easier to use in a debugging stage.
void print_expressions (list le)
void print_syntax_expressions (list le)
void print_syntax (syntax s)
void print_reference (reference r)
void print_reference_list (list lr)
void print_references (list rl)
void print_normalized (normalized n)
bool expression_equal_p (expression e1, expression e2)
bool same_expression_p (expression e1, expression e2)
bool sizeofexpression_equal_p (sizeofexpression s0, sizeofexpression s1)
bool cast_equal_p (cast c1, cast c2)
bool syntax_equal_p (syntax s1, syntax s2)
bool reference_equal_p (reference r1, reference r2)
bool range_equal_p (range r1, range r2)
bool call_equal_p (call c1, call c2)
expression make_integer_constant_expression (int c)
 expression make_integer_constant_expression(int c) make expression for integer
int integer_constant_expression_value (expression e)
int signed_integer_constant_expression_value (expression e)
expression make_factor_expression (int coeff, entity vari)
 Some functions to generate expressions from vectors and constraint systems.
expression make_vecteur_expression (Pvecteur pv)
 make expression for vector (Pvecteur)
statement Pvecteur_to_assign_statement (entity var, Pvecteur v)
 generates var = linear expression from the Pvecteur.
expression make_constraint_expression (Pvecteur v, Variable index)
 Make an expression from a constraint v for a given index.
expression make_contrainte_expression (Pcontrainte pc, Variable index)
 A wrapper around make_contrainte_expression() for compatibility.
expression Pvecteur_to_expression (Pvecteur vect)
 AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
reference expression_reference (expression e)
 Short cut, meaningful only if expression_reference_p(e) holds.
bool array_reference_p (reference r)
 predicates on references
bool references_do_not_conflict_p (reference r1, reference r2)
 If TRUE is returned, the two references cannot conflict unless array bound declarations are violated.
expression expression_list_to_binary_operator_call (list l, entity op)
expression expression_list_to_conjonction (list l)
bool expression_intrinsic_operation_p (expression exp)
 bool expression_intrinsic_operation_p(expression exp): Returns TRUE if "exp" is an expression with a call to an intrinsic operation.
bool call_constant_p (call c)
 bool call_constant_p(call c): Returns TRUE if "c" is a call to a constant, that is, a constant number or a symbolic constant.
bool expression_equal_integer_p (expression exp, int i)
 ================================================================
expression make_op_exp (char *op_name, expression exp1, expression exp2)
 ================================================================
expression make_lin_op_exp (entity op_ent, expression exp1, expression exp2)
 ================================================================
int expression_to_int (expression exp)
 ================================================================
constant expression_constant (expression exp)
bool expression_constant_p (expression exp)
 ================================================================
bool extended_expression_constant_p (expression exp)
 Returns true if the value of the expression does not depend syntactically on the current store.
bool expression_is_C_rhs_p (expression exp)
 Not all expressions can be used as right-hand side (rhs) in C assignments.
bool expression_one_p (expression exp)
bool same_expression_name_p (expression, expression)
 compare two entities for their appearance point of view.
bool same_lexpr_name_p (list l1, list l2)
bool same_entity_lname_p (entity e1, entity e2)
bool same_call_name_p (call c1, call c2)
bool same_ref_name_p (reference r1, reference r2)
bool same_range_name_p (range r1, range r2)
bool same_type_name_p (type t0, type t1)
bool same_sizeofexpression_name_p (sizeofexpression s0, sizeofexpression s1)
bool same_syntax_name_p (syntax s1, syntax s2)
static bool davinci_dump_expression_rc (FILE *out, expression e, hash_table seen)
void davinci_dump_expression (FILE *out, expression e)
 dump expression e in file out as a davinci graph.
static bool expr_flt (expression e)
void davinci_dump_all_expressions (FILE *out, statement s)
 dump all expressions in s to out.
expression substitute_entity_in_expression (entity old, entity new, expression e)
 This function replaces all the occurences of an old entity in the expression exp by the new entity.
bool simplify_C_expression (expression e)
 Replace C operators "+C" and "-C" which can handle pointers by arithmetic operators "+" and "-" when it is safe to do so, i.e.
expression convert_bound_expression (expression e, bool upper_p, bool non_strict_p)
 Replace a C expression used as FOR bound by a Fortran DO bound expression, taking into account the C comparison operator used.
bool reference_with_constant_indices_p (reference r)
reference reference_with_store_independent_indices (reference r)
 Return by side effect a reference whose memory locations includes the memory locations of r in case the subcript expressions are changed by a store change.
bool reference_with_unbounded_indices_p (reference r)
 indices can be constant or unbounded: they are store independent.
bool store_independent_reference_p (reference r)
 Does this reference define the same set of memory locations regardless of the current (environment and) memory state?
void check_user_call_site (entity func, list args)
entity expression_to_entity (expression e)
 just returns the entity of an expression, or entity_undefined SG: moved here from hpfc
list expressions_to_entities (list expressions)
 map expression_to_entity on expressions
static bool _expression_similar_p (expression target, expression pattern, hash_table symbols)
 perform the real similarity comparaison between two expressions target is matched against pattern, and expression <> argument is stored in symbols
bool expression_similar_get_context_p (expression target, expression pattern, hash_table *symbol_table)
 similar to expression_similar_p but the hash_map containing the crossref value is retured for further use
bool expression_similar_p (expression target, expression pattern)
 compare if two expressions are similar that is can we exchange target and pattern by substituing variables examples: 1+2 ~ a+b a+b !~ a+2 1+b ~ 1+c
list make_list_of_constant (int val, int number)
 of expression
bool brace_expression_p (expression e)
 Return boolean indicating if expression e is a brace expression.
boolean reference_scalar_p (reference r)
 This function returns TRUE if Reference r is scalar.
expression expressions_to_operation (const list l_exprs, entity op)
 take a list of expression and apply a binary operator between all of them and return it as an expression
void update_expression_syntax (expression e, syntax s)
 frees expression synatx and repalce it by the new syntax
entity string_to_entity (const char *s, entity module)
 very simple conversion from string to expression only handles entities and numeric values at the time being
expression string_to_expression (const char *s, entity module)

Variables

static FILE * out_flt = NULL

Define Documentation

#define ALREADY_SEEN ( node   )     (hash_defined_p(seen, (char*)node))

Definition at line 2287 of file ri-util/expression.c.

Referenced by davinci_dump_expression_rc().

#define DV_CIRCLE   ",a(\"_GO\",\"circle\")"

Definition at line 2290 of file ri-util/expression.c.

Referenced by davinci_dump_expression_rc().

#define DV_YELLOW   ",a(\"COLOR\",\"yellow\")"

Definition at line 2291 of file ri-util/expression.c.

Referenced by davinci_dump_expression_rc().

#define SEEN ( node   )     (hash_put(seen, (char*) node, (char*) 1))

Definition at line 2288 of file ri-util/expression.c.

Referenced by davinci_dump_expression_rc().


Function Documentation

static bool _expression_similar_p ( expression  target,
expression  pattern,
hash_table  symbols 
) [static]

perform the real similarity comparaison between two expressions target is matched against pattern, and expression <> argument is stored in symbols

Parameters:
target cheked expression
pattern pattern expression
symbols map storing entity <> expression tuple
Returns:
true if similar

cast handler

we memorize reference from target and pattern in the symbol table similar to in sed

simple variable

recursively compare each arguments if call do not differ

could occur with va args

SG: will this be usefull ?

SG:not supported yet

could occur with va args

Definition at line 2805 of file ri-util/expression.c.

References binary_call_lhs, binary_call_rhs, call_arguments, call_constant_p, call_function, CAR, cast_expression, commutative_call_p(), ENDP, entity_name, EXPRESSION, expression_syntax, FOREACH, gen_length(), hash_get(), hash_put(), HASH_UNDEFINED_VALUE, 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, pips_assert, pips_user_warning, POP, range_increment, range_lower, range_upper, reference_indices, reference_variable, same_entity_p(), sizeofexpression_expression, sizeofexpression_type, sizeofexpression_type_p, subscript_array, subscript_indices, syntax_call, syntax_call_p, syntax_cast, syntax_cast_p, syntax_equal_p(), syntax_range, syntax_range_p, syntax_reference, syntax_reference_p, syntax_sizeofexpression, syntax_sizeofexpression_p, syntax_subscript, syntax_subscript_p, syntax_tag, and type_equal_p().

Referenced by expression_similar_get_context_p(), and expression_similar_p().

02806 {
02807     bool similar=true;
02808     syntax starget = expression_syntax(target),
02809            spattern = expression_syntax(pattern);
02810 
02811     /* cast handler */
02812     if( syntax_cast_p( spattern ) )
02813     {
02814         pips_user_warning("cast ignored\n");
02815         return _expression_similar_p(target, cast_expression(syntax_cast(spattern)),symbols);
02816     }
02817     if( syntax_cast_p( starget ) )
02818     {
02819         pips_user_warning("cast ignored\n");
02820         return _expression_similar_p(cast_expression(syntax_cast(starget)), pattern,symbols);
02821     }
02822 
02823     switch(syntax_tag(spattern) )
02824     {
02825         /* we memorize reference from target and pattern in the symbol table
02826          * similar to \1 in sed
02827          */
02828         case is_syntax_reference:
02829             {
02830                 if( syntax_reference_p(starget) ||
02831                         ( syntax_call_p(starget) && call_constant_p(syntax_call(starget))) ||
02832                         syntax_sizeofexpression_p(starget) ||
02833                         syntax_subscript_p(starget)
02834                   )
02835                 {
02836                     reference r = syntax_reference(spattern);
02837                     /* simple variable */
02838                     if(ENDP(reference_indices(r)))
02839                     {
02840 
02841                         expression val = hash_get(symbols,entity_name(reference_variable(r)));
02842                         if ( val == HASH_UNDEFINED_VALUE )
02843                             hash_put(symbols,entity_name(reference_variable(r)), target);
02844                         else
02845                             similar = syntax_equal_p(expression_syntax(val),starget);
02846                     }
02847                     else
02848                     {
02849                         pips_user_warning("arrays are not supported in expression_similar\n");
02850                         similar=false;
02851                     }
02852                 }
02853                 else
02854                 {
02855                     similar=false;
02856                 }
02857             } break;
02858             /* recursively compare each arguments if call do not differ */
02859         case is_syntax_call:
02860             if( syntax_call_p(starget) &&
02861                     same_entity_p( call_function(syntax_call(starget)), call_function(syntax_call(spattern)) ) )
02862             {
02863                 call cpattern = syntax_call(spattern);
02864                 call ctarget = syntax_call(starget);
02865                 if(commutative_call_p(cpattern))
02866                 {
02867                     pips_assert("pips commutative call have only two arguments\n",gen_length(call_arguments(cpattern))==2);
02868                     expression lhs_pattern = binary_call_lhs(cpattern),
02869                                rhs_pattern = binary_call_rhs(cpattern),
02870                                lhs_target = binary_call_lhs(ctarget),
02871                                rhs_target = binary_call_rhs(ctarget);
02872                     similar = (_expression_similar_p(lhs_target,lhs_pattern,symbols) && _expression_similar_p(rhs_target,rhs_pattern,symbols))
02873                         ||
02874                         (_expression_similar_p(lhs_target,rhs_pattern,symbols) && _expression_similar_p(rhs_target,lhs_pattern,symbols))
02875                         ;
02876 
02877                 }
02878                 else
02879                 {
02880                     list iter = call_arguments(cpattern);
02881                     FOREACH(EXPRESSION, etarget, call_arguments(ctarget) )
02882                     {
02883                         if( ENDP(iter) ) { similar = false; break; }/* could occur with va args */
02884                         expression epattern = EXPRESSION(CAR(iter));
02885                         similar&= _expression_similar_p(etarget,epattern,symbols);
02886                         POP(iter);
02887                         if(!similar)
02888                             break;
02889                     }
02890                 }
02891             }
02892             else
02893             {
02894                 similar =false;
02895             }
02896             break;
02897             /* SG: will this be usefull ?*/
02898         case is_syntax_range:
02899             similar = syntax_range_p(starget) &&
02900                 _expression_similar_p(range_lower(syntax_range(starget)),range_lower(syntax_range(spattern)),symbols) &&
02901                 _expression_similar_p(range_upper(syntax_range(starget)),range_upper(syntax_range(spattern)),symbols) &&
02902                 _expression_similar_p(range_increment(syntax_range(starget)),range_increment(syntax_range(spattern)),symbols);
02903             break;
02904 
02905             /* SG:not supported yet */
02906         case is_syntax_cast:
02907             pips_user_warning("cast ignored\n");
02908             similar = _expression_similar_p(cast_expression(syntax_cast(starget)),pattern,symbols);
02909             break;
02910 
02911         case is_syntax_sizeofexpression:
02912             if( syntax_sizeofexpression_p(starget) )
02913             {
02914                 sizeofexpression seo_target = syntax_sizeofexpression(starget);
02915                 sizeofexpression seo_pattern = syntax_sizeofexpression(spattern);
02916                 if( sizeofexpression_type(seo_pattern) )
02917                     similar = sizeofexpression_type_p(seo_target) &&
02918                         type_equal_p( sizeofexpression_type(seo_target), sizeofexpression_type(seo_pattern) );
02919                 else
02920                     similar = _expression_similar_p(sizeofexpression_expression(seo_target),
02921                             sizeofexpression_expression(seo_pattern),
02922                             symbols );
02923             }
02924             else
02925             {
02926                 similar =false;
02927             }
02928             break;
02929 
02930         case is_syntax_subscript:
02931             if( syntax_subscript_p(starget) )
02932             {
02933                 subscript sub_target = syntax_subscript(starget),
02934                           sub_pattern = syntax_subscript(spattern);
02935                 similar&= _expression_similar_p( subscript_array(sub_target), subscript_array(sub_pattern),symbols );
02936 
02937                 list iter = subscript_indices(sub_pattern);
02938                 FOREACH(EXPRESSION, etarget, subscript_indices(sub_target) )
02939                 {
02940                     if( ENDP(iter) ) { similar = false; break; }/* could occur with va args */
02941                     expression epattern = EXPRESSION(CAR(iter));
02942                     similar&= _expression_similar_p(etarget,epattern,symbols);
02943                     POP(iter);
02944                 }
02945             }
02946             else
02947                 similar =false;
02948             break;
02949         case is_syntax_application:
02950             pips_user_warning("application similarity not implemented yet\n");
02951             similar=false;
02952             break;
02953         case is_syntax_va_arg:
02954             pips_user_warning("va_arg similarity not implemented yet\n");
02955             similar=false;
02956             break;
02957     };
02958     return similar;
02959 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool abs_expression_p ( expression  e  ) 

Definition at line 822 of file ri-util/expression.c.

References ABS_OPERATOR_NAME, and operator_expression_p().

00824 {
00825     return operator_expression_p(e, ABS_OPERATOR_NAME);
00826 }

Here is the call graph for this function:

static string actual_fortran_string_to_compare ( string  fs,
int *  plength 
) [static]

quite lazy.

..

skip TOP-LEVEL header

skip : header

skip surrounding quotes

skip trailing *spaces* (are these blanks?) if any.

Definition at line 58 of file ri-util/expression.c.

References MODULE_SEP_STRING, s, and TOP_LEVEL_MODULE_NAME.

Referenced by fortran_string_compare().

00059 {
00060   string s = fs;
00061   int len;
00062 
00063   /* skip TOP-LEVEL header */
00064   if (strncmp(s, TOP_LEVEL_MODULE_NAME, strlen(TOP_LEVEL_MODULE_NAME))==0)
00065     s += strlen(TOP_LEVEL_MODULE_NAME);
00066 
00067   /* skip : header */
00068   if (strncmp(s, MODULE_SEP_STRING, strlen(MODULE_SEP_STRING))==0)
00069     s += strlen(MODULE_SEP_STRING);
00070 
00071   len = strlen(s);
00072 
00073   /* skip surrounding quotes */
00074   if (len>=2 &&
00075       ((s[0]=='\'' && s[len-1]=='\'') || (s[0]=='"' && s[len-1]=='"')))
00076   {
00077     s++;
00078     len -= 2;
00079   }
00080 
00081   /* skip trailing *spaces* (are these blanks?) if any. */
00082   while (len>0 && s[len-1]==' ')
00083     len--;
00084 
00085   *plength = len;
00086   return s;
00087 }

Here is the caller graph for this function:

bool add_expression_p ( expression  e  ) 

Test if an expression is an addition.

Definition at line 784 of file ri-util/expression.c.

References operator_expression_p(), PLUS_C_OPERATOR_NAME, and PLUS_OPERATOR_NAME.

Referenced by incrementation_expression_to_increment().

00784                                     {
00785   return operator_expression_p(e, PLUS_OPERATOR_NAME)
00786     || operator_expression_p(e, PLUS_C_OPERATOR_NAME)
00787     ;
00788 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool array_argument_p ( expression  e  ) 

Definition at line 331 of file ri-util/expression.c.

References array_entity_p(), expression_reference(), expression_reference_p(), FALSE, ref, reference_variable, and TRUE.

Referenced by basic_ref_ptr_to_field(), emami_expression_type(), instrument_call_rwt(), interprocedural_abc_call(), points_to_assignment(), top_down_adn_call_flt(), and xml_Arguments().

00332 {
00333   if (expression_reference_p(e))
00334     {
00335       reference ref = expression_reference(e);
00336       entity ent = reference_variable(ref);
00337       if (array_entity_p(ent)) return TRUE;
00338     }
00339   return FALSE;
00340 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool array_reference_p ( reference  r  ) 

predicates on references

two possible meanings:

  • the referenced variable is declared as an array
  • the reference is to an array element

This makes a difference in procedure calls and IO statements

The second interpretation is chosen.

Definition at line 1686 of file ri-util/expression.c.

References NIL, and reference_indices.

Referenced by bottom_up_abc_reference(), bottom_up_abc_reference_implied_do(), claire_references(), constant_array_reference_p(), expression_in_array_subscript(), initial_code_abc_reference(), top_down_abc_flt(), xml_Pattern_Paving(), and xml_references().

01687 {
01688   /* two possible meanings:
01689    * - the referenced variable is declared as an array
01690    * - the reference is to an array element
01691    *
01692    * This makes a difference in procedure calls and IO statements
01693    *
01694    * The second interpretation is chosen.
01695    */
01696 
01697   return reference_indices(r) != NIL;
01698 }

Here is the caller graph for this function:

bool assignment_expression_p ( expression  e  ) 

Test if an expression is an assignment operation.

Definition at line 777 of file ri-util/expression.c.

References ASSIGN_OPERATOR_NAME, and operator_expression_p().

Referenced by expression_verbose_reduction_p_and_return_increment().

00777                                            {
00778   return operator_expression_p(e, ASSIGN_OPERATOR_NAME);
00779 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression bool_to_expression ( bool  b  ) 

Definition at line 996 of file ri-util/expression.c.

References FALSE_OPERATOR_NAME, is_basic_logical, MakeConstant(), MakeNullaryCall(), and TRUE_OPERATOR_NAME.

Referenced by generate_all_liveness_but(), generate_dynamic_liveness_for_primary(), generate_prelude(), generate_remapping_guard(), and set_live_status().

00997 {
00998     return MakeNullaryCall
00999         (MakeConstant(b ? TRUE_OPERATOR_NAME : FALSE_OPERATOR_NAME,
01000                       is_basic_logical));
01001 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool brace_expression_p ( expression  e  ) 

Return boolean indicating if expression e is a brace expression.

Definition at line 3015 of file ri-util/expression.c.

References call_function, ENTITY_BRACE_INTRINSIC_P, expression_call_p(), expression_syntax, f, FALSE, syntax_call, and TRUE.

Referenced by c_brace_expression_string(), erosion_optimization(), expression_is_C_rhs_p(), st_brace_expression_as_string(), st_declaration_init(), this_entity_cdeclaration(), words_assign_op(), and words_variable_or_function().

03016 {
03017     if (expression_call_p(e))
03018     {
03019         entity f = call_function(syntax_call(expression_syntax(e)));
03020         if (ENTITY_BRACE_INTRINSIC_P(f))
03021             return TRUE;
03022     }
03023     return FALSE;
03024 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool cabs_expression_p ( expression  e  ) 

Definition at line 840 of file ri-util/expression.c.

References CABS_OPERATOR_NAME, and operator_expression_p().

00842 {
00843     return operator_expression_p(e, CABS_OPERATOR_NAME);
00844 }

Here is the call graph for this function:

bool call_constant_p ( call  c  ) 

bool call_constant_p(call c): Returns TRUE if "c" is a call to a constant, that is, a constant number or a symbolic constant.

Definition at line 1790 of file ri-util/expression.c.

References call_function, entity_initial, is_value_constant, is_value_symbolic, and value_tag.

01791 {
01792   value cv = entity_initial(call_function(c));
01793   return( (value_tag(cv) == is_value_constant) ||
01794           (value_tag(cv) == is_value_symbolic)   );
01795 }

bool call_equal_p ( call  c1,
call  c2 
)

this should be a bug

Parameters:
c1 1
c2 2

Definition at line 1312 of file ri-util/expression.c.

References call_arguments, call_function, CAR, ENDP, EXPRESSION, expression_equal_p(), FALSE, gen_length(), POP, and TRUE.

Referenced by syntax_equal_p().

01313 {
01314   entity f1 = call_function(c1);
01315   entity f2 = call_function(c2);
01316   list args1 = call_arguments(c1);
01317   list args2 = call_arguments(c2);
01318 
01319   if(f1 != f2)
01320     return FALSE;
01321 
01322   if(gen_length(args1) != gen_length(args2)) /* this should be a bug */
01323     return FALSE;
01324 
01325   for(; !ENDP(args1); POP(args1), POP(args2))
01326     if(!expression_equal_p(EXPRESSION(CAR(args1)), EXPRESSION(CAR(args2))))
01327       return FALSE;
01328 
01329   return TRUE;
01330 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression call_to_expression ( call  c  ) 
bool cast_equal_p ( cast  c1,
cast  c2 
)
Parameters:
c1 1
c2 2

Definition at line 1240 of file ri-util/expression.c.

References cast_expression, cast_type, expression_equal_p(), and type_equal_p().

Referenced by syntax_equal_p().

01241 {
01242   return
01243     type_equal_p(cast_type(c1), cast_type(c2)) &&
01244     expression_equal_p(cast_expression(c1), cast_expression(c2));
01245 }

Here is the call graph for this function:

Here is the caller graph for this function:

void check_user_call_site ( entity  func,
list  args 
)

check the number of parameters

this is really a user error. if you move this as a user warning, the pips would drop effects about unbounded formals... why not? FC.

This can be survived...

Parameters:
func unc
args rgs

Definition at line 2725 of file ri-util/expression.c.

References dump_arguments(), fprintf(), gen_free_list(), gen_length(), module_formal_parameters(), module_local_name(), NIL, pips_user_error, pips_user_warning, and print_expressions().

Referenced by c_summary_to_proper_effects(), and fortran_summary_to_proper_effects().

02726 {
02727   /* check the number of parameters */
02728   list l_formals = module_formal_parameters(func);
02729   int n_formals = (int) gen_length(l_formals);
02730 
02731   if ((int) gen_length(args) < n_formals)
02732     {
02733       /* this is really a user error.
02734        * if you move this as a user warning, the pips would drop
02735        * effects about unbounded formals... why not? FC.
02736        */
02737       fprintf(stderr,"%d formal arguments for module %s:\n",
02738               n_formals,module_local_name(func));
02739       dump_arguments(l_formals);
02740       fprintf(stderr,"%zd actual arguments:\n",gen_length(args));
02741       print_expressions(args);
02742       pips_user_error("\nCall to module %s: "
02743                       "insufficient number of actual arguments.\n",
02744                       module_local_name(func));
02745     }
02746   else if ((int) gen_length(args) > n_formals)
02747     {
02748       /* This can be survived... */
02749       fprintf(stderr,"%d formal arguments for module%s:\n",
02750               n_formals,module_local_name(func));
02751       dump_arguments(l_formals);
02752       fprintf(stderr,"%zd actual arguments:\n",gen_length(args));
02753       print_expressions(args);
02754 
02755       pips_user_warning("\nCall to module %s: "
02756                         "too many actual arguments.\n",
02757                         module_local_name(func));
02758     }
02759   gen_free_list(l_formals), l_formals=NIL;
02760 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool comma_expression_p ( expression  e  ) 

Definition at line 646 of file ri-util/expression.c.

References call_function, ENTITY_COMMA_P, expression_call_p(), expression_syntax, f, FALSE, and syntax_call.

Referenced by any_expression_to_transformer().

00647 {
00648   bool result = FALSE;
00649 
00650   if (expression_call_p(e)) {
00651     call c = syntax_call(expression_syntax(e));
00652     entity f = call_function(c);
00653 
00654     result = ENTITY_COMMA_P(f);
00655   }
00656 
00657   return result;
00658 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression complex_to_expression ( float  re,
float  im 
)
Parameters:
re e
im m

Definition at line 992 of file ri-util/expression.c.

References float_to_expression(), and MakeComplexConstantExpression().

Referenced by make_0val_expression(), and make_1val_expression().

Here is the call graph for this function:

Here is the caller graph for this function:

expression convert_bound_expression ( expression  e,
bool  upper_p,
bool  non_strict_p 
)

Replace a C expression used as FOR bound by a Fortran DO bound expression, taking into account the C comparison operator used.

The offset might not be plus or minus one, unless we know the index is an integer? Does it depend on the step value? More thought needed than available tonight (FI)

Parameters:
upper_p pper_p
non_strict_p on_strict_p

Definition at line 2621 of file ri-util/expression.c.

References b, copy_expression(), entity_intrinsic(), expression_integer_value(), expression_undefined, int_to_expression(), intptr_t, MakeBinaryCall(), MINUS_OPERATOR_NAME, offset, and PLUS_OPERATOR_NAME.

Referenced by condition_expression_to_final_bound().

02622 {
02623   expression b = expression_undefined;
02624 
02625   if(non_strict_p) {
02626     b = copy_expression(e);
02627   }
02628   else {
02629     /* */
02630     intptr_t ib = 0;
02631     intptr_t nb = 0;
02632 
02633     if(expression_integer_value(e, &ib)) {
02634       /* The offset might not be plus or minus one, unless we know the
02635          index is an integer? Does it depend on the step value? More
02636          thought needed than available tonight (FI) */
02637       nb = upper_p? ib-1 : ib+1;
02638       b = int_to_expression(nb);
02639     }
02640     else {
02641       expression offset = int_to_expression(1);
02642       entity op = entity_intrinsic(upper_p? MINUS_OPERATOR_NAME : PLUS_OPERATOR_NAME);
02643 
02644       b = MakeBinaryCall(op, copy_expression(e), offset);
02645     }
02646   }
02647   return b;
02648 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool dabs_expression_p ( expression  e  ) 

Definition at line 834 of file ri-util/expression.c.

References DABS_OPERATOR_NAME, and operator_expression_p().

00836 {
00837     return operator_expression_p(e, DABS_OPERATOR_NAME);
00838 }

Here is the call graph for this function:

void davinci_dump_all_expressions ( FILE *  out,
statement  s 
)

dump all expressions in s to out.

Parameters:
out ut

Definition at line 2381 of file ri-util/expression.c.

References expr_flt(), expression_domain, gen_null(), gen_recurse, and NULL.

Referenced by davinci_dump_expressions().

02382 {
02383   out_flt = out;
02384   gen_recurse(s, expression_domain, expr_flt, gen_null);
02385   out_flt = NULL;
02386 }

Here is the call graph for this function:

Here is the caller graph for this function:

void davinci_dump_expression ( FILE *  out,
expression  e 
)

dump expression e in file out as a davinci graph.

Parameters:
out ut

Definition at line 2363 of file ri-util/expression.c.

References davinci_dump_expression_rc(), fprintf(), hash_pointer, hash_table_free(), hash_table_make(), and seen.

Referenced by expr_flt().

02364 {
02365   hash_table seen = hash_table_make(hash_pointer, 0);
02366   fprintf(out, "[\n");
02367   davinci_dump_expression_rc(out, e, seen);
02368   fprintf(out, "]\n\n");
02369   hash_table_free(seen);
02370 }

Here is the call graph for this function:

Here is the caller graph for this function:

static bool davinci_dump_expression_rc ( FILE *  out,
expression  e,
hash_table  seen 
) [static]

daVinci node prolog.

node epilog

Definition at line 2293 of file ri-util/expression.c.

References ALREADY_SEEN, call_arguments, call_function, DV_CIRCLE, DV_YELLOW, entity_local_name(), EXPRESSION, expression_syntax, FALSE, fprintf(), is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, MAP, NIL, pips_internal_error, pips_user_warning, reference_variable, s, SEEN, syntax_call, syntax_reference, syntax_tag, and TRUE.

Referenced by davinci_dump_expression().

02295 {
02296   syntax s;
02297   string name, shape, color;
02298   list sons = NIL;
02299   bool first = TRUE, something = TRUE;
02300 
02301   if (ALREADY_SEEN(e)) return FALSE;
02302   SEEN(e);
02303 
02304   s = expression_syntax(e);
02305   switch (syntax_tag(s))
02306   {
02307   case is_syntax_call:
02308     {
02309       call c = syntax_call(s);
02310       name = entity_local_name(call_function(c));
02311       sons = call_arguments(c);
02312       shape = "";
02313       color = "";
02314       break;
02315     }
02316   case is_syntax_range:
02317     name = "::";
02318     shape = "";
02319     color = "";
02320     break;
02321   case is_syntax_cast:
02322     pips_user_warning("skipping cast\n");
02323     break;
02324   case is_syntax_reference:
02325     name = entity_local_name(reference_variable(syntax_reference(s)));
02326     shape = DV_CIRCLE;
02327     color = DV_YELLOW;
02328     break;
02329   default:
02330     name = "";
02331     shape = "";
02332     color = "";
02333     pips_internal_error("unexpected syntax tag (%d)\n", syntax_tag(s));
02334   }
02335 
02336     /* daVinci node prolog. */
02337   fprintf(out, "l(\"%zx\",n(\"\",[a(\"OBJECT\",\"%s\")%s%s],[",
02338           (_uint) e, name, color, shape);
02339 
02340   MAP(EXPRESSION, son,
02341   {
02342     if (!first) fprintf(out, ",\n");
02343     else { fprintf(out, "\n"); first=FALSE; }
02344     fprintf(out, " l(\"%zx->%zx\",e(\"\",[],r(\"%zx\")))",
02345             (_uint) e, (_uint) son, (_uint) son);
02346   },
02347     sons);
02348 
02349     /* node epilog */
02350   fprintf(out, "]))\n");
02351 
02352   MAP(EXPRESSION, son,
02353   {
02354     if (something) fprintf(out, ",");
02355     something = davinci_dump_expression_rc(out, son, seen);
02356   }, sons);
02357 
02358   return TRUE;
02359 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool divide_expression_p ( expression  e  ) 

Definition at line 810 of file ri-util/expression.c.

References DIVIDE_OPERATOR_NAME, and operator_expression_p().

00812 {
00813     return operator_expression_p(e, DIVIDE_OPERATOR_NAME);
00814 }

Here is the call graph for this function:

expression entity_to_expression ( entity  e  ) 

if v is a constant, returns a constant call.

if v is a variable, returns a reference to v.

should be a scalar variable!

Definition at line 169 of file ri-util/expression.c.

References call_to_expression(), entity_constant_p, entity_symbolic_p, make_call(), make_reference(), NIL, and reference_to_expression().

Referenced by add_actual_return_code(), add_exec_mmcd(), add_index_out_effect_proc(), adg_dataflowgraph_with_extremities(), adg_enrichir(), adg_rename_entities(), any_basic_update_operation_to_transformer(), any_update_to_transformer(), atom_cse_expression(), buffer_full_condition(), bug_in_patch_outlined_reference(), build_call_STEP_AlltoAllRegion(), build_call_STEP_InitInterlaced(), build_call_STEP_MastertoAllRegion(), build_call_STEP_MastertoAllScalar(), build_mpi_loop(), build_new_loop_bounds(), build_statement_for_clone(), call_STEP_subroutine(), comEngine_generate_procCode(), compile_one_reduction(), compile_reduction(), compute_HRE_memory_mapping(), controlize_distribution(), convert_min_max_to_tests_in_loop(), define_node_processor_id(), distribute_code(), do_atomize_call(), do_clone_statement(), do_group_constants_terapix(), do_loop_expansion(), do_loop_unroll(), do_outliner_smart_replacment(), do_outlining(), do_split_structure(), do_symbolic_tiling(), effect_add_field_dimension(), effects_to_dma(), entities_to_expressions2(), entity_list_to_expression_list(), find_or_create_allocatable_struct(), for_to_do_loop_conversion(), freia_add_image_arguments(), freia_copy_image(), full_loop_unroll(), fusion(), fusion_buffer(), generate_code_loop(), generate_exec_statement(), generate_fifo_stat(), generate_fifo_stat2(), generate_ind_fifo_stat2(), generate_load_statement(), generate_mmcd_stat_from_ref(), generate_optimized_code_for_loop_nest(), generate_parallel_body(), generate_return_code_checks(), generate_save_statement(), generate_subarray_shift(), get_allocatable_data_expr(), get_fifoExp_from_ref(), get_indExp_from_ref(), gfc2pips_int2expression(), gfc2pips_logical2expression(), gfc2pips_real2expression(), gfc2pips_symbol2data_instruction(), hpfc_add_n(), hpfc_broadcast_buffers(), hpfc_broadcast_if_necessary(), hpfc_buffer_reference(), hpfc_compute_lid(), hpfc_gen_n_vars_expr(), hpfc_generate_message(), hpfc_hmessage(), hpfc_initsend(), hpfc_lazy_buffer_packing(), hpfc_lazy_guard(), hpfc_message(), hpfc_translate_call_with_distributed_args(), if_different_pe_and_not_twin(), index_set_split_loop(), initialize_scalar_variable(), inline_expression_call(), inline_return_crawler(), inline_split_declarations(), insert_check_alias_before_statement(), instrument_call_rwt(), integer_multiply_to_transformer(), isolate_indices_to_expressions(), isolate_make_call_array_transfer(), loop_bound_evaluation_to_transformer(), loop_flt(), loop_normalize_statement(), loop_rewrite(), loop_scalarization(), loop_strip_mine(), make_array_communication_statement(), make_assignement_statement(), make_body_from_loop(), make_C_print_statement(), make_communication_statement(), make_condition_from_loop(), make_exec_mmcd(), make_expression_with_state_variable(), make_fields_assignment_instruction(), make_guard_expression(), make_increment_statement(), make_init_newInd_stat(), make_initialization_from_loop(), make_lInitStats(), make_loop_nest_for_overlap(), make_loop_step_stat(), make_loopStat1(), make_lSwitchStats(), make_mmcd_load_store_stat(), make_mmcd_stats_from_ref(), make_scalar_communication_module(), make_scanning_over_tiles(), make_set_rc_statement(), make_simd_statements(), make_start_ru_module(), make_state_variable_assignement_statement(), make_step_inc_statement(), make_temporary_scalar_entity(), make_toggle_inc_statement(), make_toggle_init_statement(), make_toggle_mmcd(), make_transStat(), MakeAssignedGotoInst(), MakeAssignedOrComputedGotoInst(), MakeDoInst(), mylid_ne_lid(), outliner(), outliner_extract_loop_bound(), points_to_recursive_statement(), prepare_expansion(), process_innerStat1_proc(), process_opt_replace(), Pvecteur_to_assign_statement(), reduction_variable_expansion(), regenerate_toggles(), remove_if_statement_according_to_write_effects(), rename_statement_declarations(), replace_field_by_reference_walker(), scalopify(), sesamify(), simd_atomize_this_expression(), simplify_subscript(), split_complex_expression(), split_initializations_in_statement(), st_generate_packing(), statement_compute_bounds(), step_build_arrayRegion(), step_build_compute_region(), step_build_ComputeLoopSlices(), step_local_interlaced(), step_local_nb_request(), step_local_rank(), step_local_requests_array(), step_local_size(), step_parameter_max_nb_request(), step_reduction_after(), step_reduction_before(), step_symbolic(), string_to_expression(), struct_decomposition(), subtitute_induction_statement_in(), syn_parse(), systeme_to_loop_nest(), terapix_argument_handler(), terapix_loop_handler(), top_down_adn_callers_arrays(), translate_reference_to_callee_frame(), translate_to_module_frame(), try_to_recover_for_loop_in_a_while(), update_indices_for_local_computation(), usual_loop_tiling(), and verify_scalar_variable().

00170 {
00171   if(entity_symbolic_p(e))
00172     return call_to_expression(make_call(e, NIL));
00173   else if (entity_constant_p(e))
00174     return call_to_expression(make_call(e, NIL));
00175   else /* should be a scalar variable! */
00176     return reference_to_expression(make_reference(e, NIL));
00177 }

Here is the call graph for this function:

static bool expr_flt ( expression  e  )  [static]

Definition at line 2373 of file ri-util/expression.c.

References davinci_dump_expression(), and FALSE.

Referenced by davinci_dump_all_expressions().

02374 {
02375   davinci_dump_expression(out_flt, e);
02376   return FALSE;
02377 }

Here is the call graph for this function:

Here is the caller graph for this function:

call expression_call ( expression  e  ) 
bool expression_call_p ( expression  e  ) 

predicates and short cut accessors on expressions

Definition at line 306 of file ri-util/expression.c.

References expression_syntax, and syntax_call_p.

Referenced by actual_label_replacement_p(), alloc_instrumentation(), any_expression_to_transformer(), array_to_pointer_call_rewriter(), atomize_call(), atomize_call_filter(), atomize_call_statement(), atomize_this_expression(), brace_expression_p(), c_brace_expression_p(), c_parse(), change_basic_if_needed(), cleanup_call(), comma_expression_p(), complex_constant_expression_p(), condition_to_transformer(), convert_min_max_to_tests_in_loop(), do_group_constant_entity(), do_reduction_propagation(), expr_flt(), expression_allocatable_data_access_p(), expression_field_p(), expression_implied_do_p(), expression_list_directed_p(), expression_minmax_p(), expression_reference_number(), expression_to_int(), expression_try_find_size(), find_entities_to_wrap(), find_implicit_goto(), find_target_position(), generic_proper_effects_of_complex_address_expression(), guess_loop_increment(), guess_loop_increment_walker(), guess_loop_lower_bound(), ignore_call_flt(), inline_expression(), interprocedural_abc_expression(), is_this_op(), logical_operator_expression_p(), MakeReturn(), number_of_initial_values(), number_of_operators_flt(), parser_macro_expansion(), points_to_assignment(), points_to_general_assignment(), process_static_initialization(), reference_filter(), regenerate_call(), relational_expression_p(), remove_dereferencement(), remove_expression_from_comma_list(), remove_unread_variable(), replace_entity_by_expression_expression_walker(), replace_subscript(), sentence_data_statement(), simplify_complex_expression(), SizeOfArray(), statement_phi_function_p(), store_initial_value(), switch_specific_cmplx(), switch_specific_dcmplx(), this_expression_constant_p(), two_addresses_code_generator(), two_addresses_code_generator_split_p(), words_assign_op(), words_dimension(), words_infix_binary_op(), words_infix_nary_op(), words_regular_call(), words_subexpression(), and yyparse().

00307 {
00308   return(syntax_call_p(expression_syntax(e)));
00309 }

cast expression_cast ( expression  e  ) 

Definition at line 321 of file ri-util/expression.c.

References expression_syntax, and syntax_cast.

Referenced by words_subexpression().

00322 {
00323   return(syntax_cast(expression_syntax(e)));
00324 }

Here is the caller graph for this function:

bool expression_cast_p ( expression  e  ) 

Definition at line 316 of file ri-util/expression.c.

References expression_syntax, and syntax_cast_p.

Referenced by words_subexpression().

00317 {
00318   return(syntax_cast_p(expression_syntax(e)));
00319 }

Here is the caller graph for this function:

constant expression_constant ( expression  exp  ) 
Parameters:
exp xp

Definition at line 2032 of file ri-util/expression.c.

References binary_call_lhs, call_function, constant_undefined, entity_initial, ENTITY_UNARY_MINUS_P, ENTITY_UNARY_PLUS_P, expression_constant(), expression_syntax, is_value_constant, is_value_intrinsic, syntax_call, syntax_call_p, v, value_constant, and value_tag.

Referenced by expression_constant(), expression_constant_p(), and words_dimension().

02033 {
02034   if(syntax_call_p(expression_syntax(exp)))
02035   {
02036     call c = syntax_call(expression_syntax(exp));
02037     value v = entity_initial(call_function(c));
02038     switch(value_tag(v))
02039     {
02040       case is_value_constant:
02041         return value_constant(v);
02042       case is_value_intrinsic:
02043         if(ENTITY_UNARY_MINUS_P(call_function(c))||ENTITY_UNARY_PLUS_P(call_function(c)))
02044           return expression_constant(binary_call_lhs(c));
02045       default:
02046         ;
02047     }
02048   }
02049   return constant_undefined;
02050 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_constant_p ( expression  exp  ) 

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

Overlap Management Module for HPFC Fabien Coelho, August 1993.

HPFC module by Fabien COELHO.

bool expression_constant_p(expression exp) Returns TRUE if "exp" contains an (integer) constant value.

Note : A negativePositive constant can be represented with a call to the unary minus/plus intrinsic function upon a positive value.

Parameters:
exp xp

Definition at line 2058 of file ri-util/expression.c.

References constant_undefined_p, and expression_constant().

Referenced by add_const_expr_p(), analyze_expression(), array_indices_check(), array_size_stride(), atom_cse_expression(), atomize_this_expression(), compute_final_index_value(), constant_step_loop_p(), do_loop_expansion(), do_loop_expansion_init(), effect_field_dimension_entity(), expression_equal_integer_p(), expression_plusplus(), expression_to_int(), expression_try_find_size(), formal_variable_add_aliases(), freia_insert_added_stats(), inline_expression_call(), loop_normalize_of_loop(), loop_normalize_statement(), make_loadsave_statement(), make_max_exp(), MakeEquivAtom(), normalizable_loop_p(), overlap_redefine_expression(), padded_simd_statement_p(), plc_make_dim(), prepare_expansion(), process_true_call_stat(), pu_expression_to_polynome(), rational_op_exp(), references_do_not_conflict_p(), replace_subscript(), simplify_C_expression(), size_of_actual_array(), size_of_dummy_array(), size_of_unnormalized_dummy_array(), sp_feautrier_expression_p(), splc_feautrier_expression_p(), step_simple_expression_decision(), stmt_bdt_directions(), subscript_value(), subscript_value_stride(), this_expression_constant_p(), valuer(), and words_dimension().

02059 {
02060   return !constant_undefined_p(expression_constant(exp));
02061 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_equal_in_list_p ( expression  e,
list  le 
)

This function returns TRUE, if there exists an expression equal in the list FALSE, otherwise.

Parameters:
le e

Definition at line 384 of file ri-util/expression.c.

References EXPRESSION, expression_equal_p(), f, FALSE, MAP, and TRUE.

Referenced by pragma_omp_merge_expr().

00385 {
00386   MAP(EXPRESSION, f, if (expression_equal_p(e,f)) return TRUE, le);
00387   return FALSE;
00388 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_equal_integer_p ( expression  exp,
int  i 
)
bool expression_equal_p ( expression  e1,
expression  e2 
)

Add expression_undefined tests to avoid segmentation fault

let's assume that every expression has a correct syntax component

Parameters:
e1 1
e2 2

Definition at line 1189 of file ri-util/expression.c.

References expression_syntax, expression_undefined_p, FALSE, s1, syntax_equal_p(), and TRUE.

Referenced by basic_equal_strict_p(), bottom_up_abc_base_reference_implied_do(), call_equal_p(), cast_equal_p(), compact_phi_functions(), convex_cell_reference_preceding_p(), effect_comparable_p(), expr_rwt(), expression_eq_in_list_p(), expression_equal_in_list_p(), expression_flt(), expressions_to_vector(), find_equal_expression_not_in_list(), integer_multiply_to_transformer(), lexpression_equal_p(), loop_executed_once_p(), loop_rewrite(), lrange_larger_p(), make_simd_statement(), partial_eval_plus_or_minus_operator(), partial_redundancy_elimination_rwt(), range_equal_p(), reference_equal_p(), same_alignment_in_list_p(), same_alignment_p(), same_distribute_p(), same_distribution_p(), same_expression_p(), similarity(), simple_cell_reference_preceding_p(), sizeofexpression_equal_p(), and two_addresses_code_generator().

01190 {
01191   syntax s1, s2;
01192 
01193   /* Add expression_undefined tests to avoid segmentation fault */
01194 
01195   if (expression_undefined_p(e1) && expression_undefined_p(e2))
01196     return TRUE;
01197   if (expression_undefined_p(e1) || expression_undefined_p(e2))
01198     return FALSE;
01199 
01200   /* let's assume that every expression has a correct syntax component */
01201   s1 = expression_syntax(e1);
01202   s2 = expression_syntax(e2);
01203 
01204   return syntax_equal_p(s1, s2);
01205 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_field_p ( expression  e  ) 

Definition at line 326 of file ri-util/expression.c.

References call_function, ENTITY_FIELD_P, expression_call(), and expression_call_p().

Referenced by distance_between_expression(), expression_reference_or_field_p(), make_loadsave_statement(), points_to_assignment(), and replace_subscript().

00327 {
00328     return expression_call_p(e) && ENTITY_FIELD_P(call_function(expression_call(e)));
00329 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_implied_do_p ( e   ) 
bool expression_intrinsic_operation_p ( expression  exp  ) 

bool expression_intrinsic_operation_p(expression exp): Returns TRUE if "exp" is an expression with a call to an intrinsic operation.

Parameters:
exp xp

Definition at line 1774 of file ri-util/expression.c.

References call_function, e, entity_initial, expression_syntax, FALSE, is_syntax_call, is_value_intrinsic, syntax_call, syntax_tag, and value_tag.

Referenced by atomizer_of_test().

01775 {
01776   entity e;
01777   syntax syn = expression_syntax(exp);
01778 
01779   if (syntax_tag(syn) != is_syntax_call)
01780     return (FALSE);
01781 
01782   e = call_function(syntax_call(syn));
01783 
01784   return(value_tag(entity_initial(e)) == is_value_intrinsic);
01785 }

Here is the caller graph for this function:

bool expression_is_C_rhs_p ( expression  exp  ) 

Not all expressions can be used as right-hand side (rhs) in C assignments.

PIPS expressions used to encode initializations such as

"{ 1, 2, 3}"

in

"int k[] = { 1, 2, 3 };" cannot be used as rhs.

There are probably many more cases, especially with Fortran-specific expressions, e.g. IO expressions. But we do not have a way to know if an intrinsic is a Fortran or a C or a shared intrinsic. The information is not carried by PIPS internal representation and hence not initialized in bootstrap.

Note: this test is too restrictive as the condition depends on the type of the lhs. A struct can be assigned a brace expression. So a type argument should be passed to make such decisions.

"s = { 1, 2, 3};" is ok if s is a struct with three integer compatible fields.

Parameters:
exp xp

Definition at line 2174 of file ri-util/expression.c.

References brace_expression_p(), and FALSE.

Referenced by redeclaration_enter_statement(), and split_initializations_in_statement().

02175 {
02176   bool is_rhs_p = FALSE;
02177 
02178   is_rhs_p = !brace_expression_p(exp);
02179 
02180   return is_rhs_p;
02181 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_list_directed_p ( e   ) 

Definition at line 660 of file ri-util/expression.c.

References call_function, entity_local_name(), expression_call_p(), expression_syntax, FALSE, LIST_DIRECTED_FORMAT_NAME, and syntax_call.

Referenced by io_effects().

00662 {
00663     if (expression_call_p(e)) {
00664         call c = syntax_call(expression_syntax(e));
00665         entity e = call_function(c);
00666 
00667         return(strcmp(entity_local_name(e), LIST_DIRECTED_FORMAT_NAME) == 0);
00668     }
00669 
00670     return(FALSE);
00671 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression expression_list_to_binary_operator_call ( list  l,
entity  op 
)
Parameters:
op p

Definition at line 1742 of file ri-util/expression.c.

References CAR, CDR, EXPRESSION, expression_undefined, gen_length(), MakeBinaryCall(), MAPL, and pips_assert.

Referenced by expression_list_to_conjonction(), and top_down_abc_not_exact_case().

01743 {
01744   int
01745     len = gen_length(l);
01746   expression
01747     result = expression_undefined;
01748 
01749   pips_assert("list_to_binary_operator_call", len!=0);
01750 
01751   result = EXPRESSION(CAR(l));
01752 
01753   MAPL(ce,
01754        {
01755          result = MakeBinaryCall(op, EXPRESSION(CAR(ce)), result);
01756        },
01757        CDR(l));
01758 
01759   return(result);
01760 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression expression_list_to_conjonction ( list  l  ) 
expression expression_mult ( expression  ex  ) 
Parameters:
ex x

Definition at line 160 of file ri-util/expression.c.

References pips_error().

00161 {
00162   pips_error("expression_mult", "not implemented\n");
00163   return ex;
00164 }

Here is the call graph for this function:

bool expression_one_p ( expression  exp  ) 
Parameters:
exp xp

Definition at line 2183 of file ri-util/expression.c.

References call_function, constant_int, constant_int_p, entity_initial, expression_syntax, FALSE, syntax_call, syntax_call_p, v, value_constant, and value_constant_p.

Referenced by text_forloop().

02184 {
02185   bool one_p = FALSE;
02186 
02187   if(syntax_call_p(expression_syntax(exp))) {
02188     call c = syntax_call(expression_syntax(exp));
02189     value v = entity_initial(call_function(c));
02190 
02191     if(value_constant_p(v)) {
02192       constant c = value_constant(v);
02193       one_p = constant_int_p(c) && (constant_int(c)==1);
02194     }
02195   }
02196   return one_p;
02197 }

Here is the caller graph for this function:

reference expression_reference ( expression  e  ) 

Short cut, meaningful only if expression_reference_p(e) holds.

Definition at line 1679 of file ri-util/expression.c.

References expression_syntax, and syntax_reference.

Referenced by add_aliases_for_current_call_site(), array_argument_p(), array_to_pointer_fix_call_site(), atomize_call(), c_parse(), call_flt(), call_rwt(), comEngine_replace_reference_in_stat_rwt(), compact_phi_functions(), contiguous_array_reference_p(), da_process_list(), distance_between_expression(), do_atomize_call(), do_grouping_filter_out_self(), do_grouping_replace_reference_by_expression_walker(), do_reduction_propagation(), do_split_structure_return_hook_walker(), entity_in_call_arguments_p(), entity_used_in_calls_walker(), expression_allocatable_data_access_p(), expression_array_to_pointer(), expression_equal_in_context_p(), expression_reference_number(), expression_try_find_string_size(), expression_verbose_reduction_p_and_return_increment(), FindDefinitionsOf_rewrite(), flint_cons_actual_argument(), full_copy_p(), generate_deducables(), guess_loop_increment_walker(), guess_loop_lower_bound(), guess_write_effect_on_entity_walker(), instrument_call_rwt(), interprocedural_abc_call(), invalidate_expressions_in_statement(), isolate_merge_offsets(), isolate_patch_reference(), list_of_same_or_equivalence_arguments(), make_loadsave_statement(), offset_in_caller(), outliner(), padded_simd_statement_p(), partial_eval_update_operators(), patch_outlined_reference(), perform_expansion_and_unstack_index_and_dimension(), perform_substitution_in_assign(), points_to_general_assignment(), process_static_initialization(), process_true_call_stat(), put_variables_in_ordered_lists(), real_simple_effects_forward_translation(), region_reference_to_expression(), region_remove_fields(), remove_unread_variable(), replace_entity_by_expression_expression_walker(), replace_field_by_reference_walker(), sac_aligned_expression_p(), sac_expression_reduction_p(), same_or_equivalence_argument_add_aliases(), same_section_common_variable_in_list_p(), same_section_formal_variable_in_list_p(), simd_trace_call(), simple_reference_to_convex_reference_conversion(), simplify_complex_expression(), split_complex_expression(), statement_insertion_fix_access_in_callers(), strcpy_check_expression(), subscripted_field_list_to_type(), summary_effect_to_proper_effect(), terapix_loop_handler(), this_expression_constant_p(), top_down_adn_call_flt(), update_functional_type_with_actual_arguments(), verify_array_element(), written_before_read_p(), and yyparse().

01680 {
01681     return syntax_reference(expression_syntax(e));
01682 }

bool expression_reference_p ( expression  e  ) 

Test if an expression is a reference.

Definition at line 346 of file ri-util/expression.c.

References expression_syntax, and syntax_reference_p.

Referenced by add_aliases_for_current_call_site(), alloc_instrumentation(), array_argument_p(), array_indices_check(), array_to_pointer_fix_call_site(), assign_operation_to_transformer(), atomize_call(), atomize_condition(), c_parse(), call_flt(), cleanup_call(), cleanup_subscript(), comEngine_replace_reference_in_stat_rwt(), compact_phi_functions(), contiguous_array_reference_p(), continue_propagation_p(), cstr_args_check(), distance_between_expression(), do_atomize_call(), do_grouping_filter_out_self(), do_grouping_replace_reference_by_expression_walker(), do_reduction_propagation(), do_split_structure_return_hook_walker(), effect_to_store_independent_sdfi_list(), entity_in_call_arguments_p(), entity_used_in_calls_walker(), erosion_optimization(), expr_flt(), expr_rwt(), expression_array_to_pointer(), expression_equal_in_context_p(), expression_number_for_index(), expression_reference_number(), expression_reference_or_field_p(), expression_simple_nondist_p(), expression_try_find_size(), expression_verbose_reduction_p_and_return_increment(), flint_cons_actual_argument(), full_copy_p(), guess_loop_increment_walker(), guess_loop_lower_bound(), guess_write_effect_on_entity_walker(), hpfc_overlap_kill_unused_scalars_rewrite(), invalidate_expressions_in_statement(), is_expression_reference_to_entity_p(), is_left_part_of_assignment(), list_of_same_or_equivalence_arguments(), make_loadsave_statement(), padded_simd_statement_p(), parser_macro_expansion(), partial_eval_call(), partial_eval_update_operators(), patch_outlined_reference(), points_to_assignment(), points_to_general_assignment(), process_static_initialization(), process_true_call_stat(), proper_to_summary_simple_effect(), r_effect_pointer_type_p(), real_simple_effects_forward_translation(), reference_filter(), references_aligned_p(), regenerate_call(), remove_unread_variable(), replace_entity_by_expression_expression_walker(), replace_field_by_reference_walker(), sac_aligned_expression_p(), sac_expression_reduction_p(), same_section_common_variable_in_list_p(), same_section_formal_variable_in_list_p(), simple_cell_reference_with_address_of_cell_reference_translation(), simple_effect_reference_type(), simple_reference_to_convex_reference_conversion(), simplify_complex_expression(), statement_insertion_fix_access_in_callers(), step_expression_atomize_filter(), struct_double_pointer(), subarray_shift_assignment_p(), subscripted_field_list_to_type(), summary_effect_to_proper_effect(), terapix_loop_handler(), this_expression_constant_p(), update_functional_type_with_actual_arguments(), update_operation_to_transformer(), variable_references_may_conflict_p(), written_before_read_p(), and yyparse().

00346                                           {
00347   return(syntax_reference_p(expression_syntax(e)));
00348 }

bool expression_similar_get_context_p ( expression  target,
expression  pattern,
hash_table symbol_table 
)

similar to expression_similar_p but the hash_map containing the crossref value is retured for further use

Parameters:
target expression to compare
pattern expression serving as pattern
symbol_table pointer to unallocated hash_map, in the end it will contain a set of pair (original syntax reference name, substituted syntax element). Must be freed, but only if expressions are similar
Returns:
true if expressions are similar
Parameters:
target arget
pattern attern
symbol_table ymbol_table

Definition at line 2970 of file ri-util/expression.c.

References _expression_similar_p(), HASH_DEFAULT_SIZE, hash_string, hash_table_free(), and hash_table_make().

Referenced by replace_expression_similar_to_pattern().

02971 {
02972     *symbol_table = hash_table_make(hash_string,HASH_DEFAULT_SIZE);
02973     bool similar = _expression_similar_p(target,pattern,*symbol_table);
02974     if( !similar) hash_table_free(*symbol_table);
02975     return similar;
02976 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_similar_p ( expression  target,
expression  pattern 
)

compare if two expressions are similar that is can we exchange target and pattern by substituing variables examples: 1+2 ~ a+b a+b !~ a+2 1+b ~ 1+c

Parameters:
target expression that sould match with pattern
pattern the pattern to match
Returns:
true if expressions are similar
Parameters:
target arget
pattern attern

Definition at line 2991 of file ri-util/expression.c.

References _expression_similar_p(), HASH_DEFAULT_SIZE, hash_pointer, hash_table_free(), and hash_table_make().

02992 {
02993   hash_table symbol_table = hash_table_make(hash_pointer,HASH_DEFAULT_SIZE);
02994   bool similar = _expression_similar_p(target,pattern,symbol_table);
02995   hash_table_free(symbol_table);
02996   return similar;
02997 }

Here is the call graph for this function:

entity expression_to_entity ( expression  e  ) 

just returns the entity of an expression, or entity_undefined SG: moved here from hpfc

Definition at line 2765 of file ri-util/expression.c.

References call_function, entity_undefined, expression_syntax, 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, reference_variable, s, syntax_call, syntax_reference, and syntax_tag.

Referenced by continue_propagation_p(), do_group_statement_constant(), do_simdizer_init(), effect_field_dimension_entity(), expression_list_to_entity_list(), expressions_to_entities(), freia_extract_params(), get_assigned_variable(), handle_align_and_realign_directive(), HANDLER_PROTOTYPE(), hpf_compile_call(), hpfc_translate_call_with_distributed_args(), instrument_call_rwt(), is_expression_omp_for_p(), is_expression_omp_if_p(), is_expression_omp_omp_p(), is_expression_omp_parallel_p(), is_expression_omp_private_p(), is_expression_omp_reduction_p(), lUpdateExpr_but_distributed(), make_loadsave_statement(), make_simd_statement(), new_dynamic(), new_fake_function(), new_io_function(), new_processor(), new_pure_function(), new_template(), outliner_smart_references_computation(), partial_eval_binary_operator(), region_to_minimal_dimensions(), sac_get_current_lhs(), statement_to_directive_txt(), step_expression_atomize_filter(), struct_decomposition(), test_rewrite(), top_down_adn_call_flt(), and update_overlaps_in_caller().

02766 {
02767     syntax s = expression_syntax(e);
02768 
02769     switch (syntax_tag(s))
02770     {
02771     case is_syntax_call:
02772         return call_function(syntax_call(s));
02773     case is_syntax_reference:
02774         return reference_variable(syntax_reference(s));
02775     case is_syntax_range:
02776     case is_syntax_cast:
02777     case is_syntax_sizeofexpression:
02778     case is_syntax_subscript:
02779     case is_syntax_application:
02780     case is_syntax_va_arg:
02781     default:
02782         return entity_undefined;
02783     }
02784 }

Here is the caller graph for this function:

int expression_to_int ( expression  exp  ) 

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

int expression_to_int(expression exp): returns the integer value of "exp".

Note: "exp" is supposed to contain an integer value which means that the function expression_constant_p() has returned TRUE with "exp" in argument. This implies that if "exp" is not a "value_constant", it must be a "value_intrinsic". In that case it is an unary minus operation upon an expression for which the function expression_constant_p() returns TRUE (See the commentary given for it).

Is it an integer parameter?

Parameters:
exp xp

Definition at line 1992 of file ri-util/expression.c.

References binary_call_lhs, call_function, constant_int, constant_int_p, debug(), entity_initial, expression_call_p(), expression_constant_p(), expression_syntax, expression_to_int(), is_value_constant, is_value_intrinsic, pips_error(), symbolic_constant, syntax_call, v, value_constant, value_symbolic, value_symbolic_p, and value_tag.

Referenced by adg_get_conjonctions(), analyze_expression(), array_indices_check(), array_size_stride(), compute_final_index_value(), do_outlining(), effect_field_dimension_entity(), expression_equal_integer_p(), expression_plusplus(), expression_to_int(), expression_try_find_size(), find_target_position(), formal_variable_add_aliases(), incrementation_expression_to_increment(), loop_normalize_of_loop(), loop_normalize_statement(), make_max_exp(), MakeEquivAtom(), pu_expression_to_polynome(), rational_op_exp(), references_do_not_conflict_p(), sentence_data_statement(), size_of_actual_array(), size_of_dummy_array(), size_of_unnormalized_dummy_array(), subscript_value(), subscript_value_stride(), system_new_var_subst(), this_expression_constant_p(), valuer(), vect_partial_eval(), and words_dimension().

01993 {
01994   int rv = 0;
01995 
01996   debug( 7, "expression_to_int", "doing\n");
01997   if(expression_constant_p(exp)) {
01998     call c = syntax_call(expression_syntax(exp));
01999     switch(value_tag(entity_initial(call_function(c)))) {
02000     case is_value_constant:     {
02001       rv = constant_int(value_constant(entity_initial(call_function(c))));
02002       break;
02003     }
02004     case is_value_intrinsic: {
02005       rv = 0 - expression_to_int(binary_call_lhs(c));
02006       break;
02007     }
02008     default:
02009       pips_error("expression_to_int",
02010                  "expression is not an integer constant");
02011     }
02012   }
02013   else if(expression_call_p(exp)) {
02014     /* Is it an integer parameter? */
02015     entity p = call_function(syntax_call(expression_syntax(exp)));
02016     value v = entity_initial(p);
02017 
02018     if(value_symbolic_p(v) && constant_int_p(symbolic_constant(value_symbolic(v)))) {
02019       rv = constant_int(symbolic_constant(value_symbolic(v)));
02020     }
02021     else {
02022       pips_error("expression_to_int",
02023                  "expression is not an integer constant");
02024     }
02025   }
02026   else
02027     pips_error("expression_to_int",
02028                "expression is not an integer constant");
02029   return(rv);
02030 }

Here is the call graph for this function:

Here is the caller graph for this function:

list expression_to_reference_list ( expression  e,
list  lr 
)

conversion of an expression into a list of references; references are appended to list lr as they are encountered; array references are added before their index expressions are scanned;

references to functions and constants (which are encoded as null-ary functions) are not recorded

Parameters:
lr r

Definition at line 1021 of file ri-util/expression.c.

References expression_syntax, s, and syntax_to_reference_list().

Referenced by array_indice_in_list_p(), check_loop_distribution_feasability(), effect_interference(), effects_interfere_p(), loop_nest_to_local_variables(), self_initialization_p(), syntax_to_reference_list(), verify_used_before_set_call(), and written_before_read_p().

01022 {
01023     syntax s = expression_syntax(e);
01024     lr = syntax_to_reference_list(s, lr);
01025     return lr;
01026 }

Here is the call graph for this function:

Here is the caller graph for this function:

entity expression_variable ( expression  e  ) 
expression expression_verbose_reduction_p_and_return_increment ( expression  incr,
bool   filterexpression 
)

Test if an expression is a verbose reduction of the form : "i = i op v" or "i = v op i".

Parameters:
e is the expression to analyse
filter is a function that take an expression and return TRUE iff expression is of the form "op(a,b,c...)". The filter may not be specific to binary operators, even if this function only deal with binary patterns. Use for example add_expression_p() to detect "i = i + v" or "i = v + i".
Returns:
the v expression if e is of the requested form or expression_undefined if not

The expression is an assignment, it is a good start.

Only deal with simple references right now:

Operation found.

Only deal with binary operators

If arg1 is the same reference as lhs, we are in the "i = i op v" case:

If arg2 is the same reference as lhs, we are in the "i = v op i" case:

Definition at line 596 of file ri-util/expression.c.

References assignment_expression_p(), call_arguments, CAR, CDR, EXPRESSION, expression_reference(), expression_reference_p(), expression_syntax, expression_undefined, gen_length(), reference_equal_p(), and syntax_call.

Referenced by incrementation_expression_to_increment().

00597                                                                              {
00598   if (assignment_expression_p(incr)) {
00599     /* The expression is an assignment, it is a good start. */
00600     list assign_params = call_arguments(syntax_call(expression_syntax(incr)));
00601     expression lhs = EXPRESSION(CAR(assign_params));
00602 
00603     /* Only deal with simple references right now: */
00604     if (expression_reference_p(lhs)) {
00605       expression rhs = EXPRESSION(CAR(CDR(assign_params)));
00606       if (filter(rhs)) {
00607         /* Operation found. */
00608         list op_params = call_arguments(syntax_call(expression_syntax(rhs)));
00609         /* Only deal with binary operators */
00610         if (gen_length(op_params) == 2) {
00611           expression arg1 = EXPRESSION(CAR(op_params));
00612           expression arg2 = EXPRESSION(CAR(CDR(op_params)));
00613           if (expression_reference_p(arg1)
00614               && reference_equal_p(expression_reference(lhs),
00615                                    expression_reference(arg1)))
00616             /* If arg1 is the same reference as lhs,
00617                we are in the "i = i op v" case: */
00618             return arg2;
00619           else if (expression_reference_p(arg2)
00620                    && reference_equal_p(expression_reference(lhs),
00621                                         expression_reference(arg2)))
00622             /* If arg2 is the same reference as lhs,
00623                we are in the "i = v op i" case: */
00624             return arg1;
00625         }
00626       }
00627     }
00628   }
00629   return expression_undefined;
00630 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool expression_with_constant_signed_integer_value_p ( expression  e  ) 

The expression may be complicated but all its leaves are constants or parameters.

It evaluates to a signed integer constant. I am too lazy to fully implement it as I should and I only take care of affine expressions (Francois).

No vecteur_constant_p() in linear library?

Definition at line 758 of file ri-util/expression.c.

References constant_p(), FALSE, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, term_cst, VECTEUR_NUL_P, vecteur_succ, and VECTEUR_UNDEFINED_P.

Referenced by array_with_numerical_bounds_p().

00760 {
00761   normalized ne = NORMALIZE_EXPRESSION(e);
00762   bool constant_p = FALSE;
00763 
00764   if(normalized_linear_p(ne)) {
00765     Pvecteur ve = normalized_linear(ne);
00766     /* No vecteur_constant_p() in linear library? */
00767     constant_p = VECTEUR_NUL_P(ve)
00768       || (term_cst(ve) && VECTEUR_UNDEFINED_P(vecteur_succ(ve)));
00769   }
00770 
00771   return constant_p;
00772 }

Here is the call graph for this function:

Here is the caller graph for this function:

list expressions_to_entities ( list  expressions  ) 

map expression_to_entity on expressions

Parameters:
expressions xpressions

Definition at line 2786 of file ri-util/expression.c.

References CONS, ENTITY, exp, EXPRESSION, expression_to_entity(), FOREACH, gen_nreverse(), and NIL.

Referenced by statement_insertion_fix_access().

02787 {
02788     list entities =NIL;
02789     FOREACH(EXPRESSION,exp,expressions)
02790         entities=CONS(ENTITY,expression_to_entity(exp),entities);
02791     return gen_nreverse(entities);
02792 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression expressions_to_operation ( const list  l_exprs,
entity  op 
)

take a list of expression and apply a binary operator between all of them and return it as an expression

Returns:
the operations as an expression
Parameters:
l_exprs,the list of expressions to compute with the operator
op,the binary operator to apply
Parameters:
l_exprs _exprs
op p

Definition at line 3042 of file ri-util/expression.c.

References call_to_expression(), CAR, entity_undefined, EXPRESSION, expression_undefined, FOREACH, gen_expression_cons(), make_call(), NIL, and POP.

Referenced by add_loop_parallel_threshold(), and merge_conditions().

03042                                                                     {
03043   expression result = expression_undefined;
03044   if ((l_exprs != NIL) && (op != entity_undefined)){
03045     list l_src = l_exprs;
03046     result = EXPRESSION (CAR (l_src));
03047     POP(l_src);
03048     FOREACH (EXPRESSION, ex, l_src) {
03049       list args =  gen_expression_cons (result, NIL);
03050       args = gen_expression_cons (ex, args);
03051       call c = make_call (op, args);
03052       result = call_to_expression (c);
03053     }
03054   }
03055   return result;
03056 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool extended_expression_constant_p ( expression  exp  ) 

Returns true if the value of the expression does not depend syntactically on the current store.

Returns FALSE when this has not been proved.

The only constant references in PIPS internal representation are references to functions.

Check that all arguments are constant

Certainly TRUE for Fortran. Quid for C?

does not make much sense... for a function!

Let's be conservative

There might be another case of constant expressions: all that are casted to void... Usage?

Parameters:
exp xp

Definition at line 2066 of file ri-util/expression.c.

References call_arguments, call_function, cast_expression, constant_p(), entity_initial, entity_type, EXPRESSION, expression_syntax, extended_expression_constant_p(), f, FALSE, FOREACH, 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, is_value_code, is_value_constant, is_value_expression, is_value_intrinsic, is_value_symbolic, is_value_unknown, pips_internal_error, range_increment, range_lower, range_upper, reference_variable, s, syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_tag, t, TRUE, type_functional_p, ultimate_type(), v, value_expression, and value_tag.

Referenced by all_array_references_constant_walker(), do_simdizer_init(), do_terapix_remove_divide(), extended_expression_constant_p(), and redeclaration_enter_statement().

02067 {
02068   syntax s = expression_syntax(exp);
02069   bool constant_p = FALSE;
02070 
02071   switch(syntax_tag(s)) {
02072   case is_syntax_reference: {
02073     /* The only constant references in PIPS internal representation
02074        are references to functions. */
02075     reference r = syntax_reference(s);
02076     entity v = reference_variable(r);
02077     type t = ultimate_type(entity_type(v));
02078 
02079     constant_p = type_functional_p(t);
02080     break;
02081   }
02082   case is_syntax_range: {
02083     range r = syntax_range(s);
02084     expression lb = range_lower(r);
02085     expression ub = range_upper(r);
02086     expression inc = range_increment(r);
02087 
02088     constant_p = extended_expression_constant_p(lb)
02089       && extended_expression_constant_p(ub)
02090       && extended_expression_constant_p(inc);
02091     break;
02092   }
02093   case is_syntax_call: {
02094     call c = syntax_call(s);
02095     entity f = call_function(c);
02096     value v = entity_initial(f);
02097     switch(value_tag(v)) {
02098     case is_value_constant:
02099       constant_p = TRUE;
02100       break;
02101     case is_value_intrinsic: {
02102       /* Check that all arguments are constant */
02103       list args = call_arguments(c);
02104       constant_p = TRUE;
02105       FOREACH(EXPRESSION, sub_exp, args) {
02106         constant_p = constant_p && extended_expression_constant_p(sub_exp);
02107       }
02108       break;
02109     }
02110     case is_value_symbolic:
02111       /* Certainly TRUE for Fortran. Quid for C? */
02112       constant_p = TRUE;
02113       break;
02114     case is_value_expression: {
02115       /* does not make much sense... for a function! */
02116       expression sub_exp = value_expression(v);
02117       constant_p = extended_expression_constant_p(sub_exp);
02118       break;
02119     }
02120     case is_value_unknown:
02121     case is_value_code:
02122     default:
02123       /* Let's be conservative */
02124       constant_p = FALSE;
02125     }
02126     break;
02127   }
02128   case is_syntax_cast: {
02129     /* There might be another case of constant expressions: all that
02130        are casted to void... Usage? */
02131     cast c = syntax_cast(s);
02132     expression sub_exp = cast_expression(c);
02133     constant_p = extended_expression_constant_p(sub_exp);
02134     break;
02135   }
02136   case is_syntax_sizeofexpression:
02137     break;
02138   case is_syntax_subscript:
02139     break;
02140   case is_syntax_application:
02141     break;
02142   case is_syntax_va_arg:
02143     break;
02144   default:
02145     pips_internal_error("Unexpected syntax tag %d", syntax_tag(s));
02146   }
02147   return constant_p;
02148 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool extended_integer_constant_expression_p ( expression  e  ) 

More extensive than next function.

Definition at line 674 of file ri-util/expression.c.

References constant_int_p, EvalExpression(), FALSE, free_value(), v, value_constant, and value_constant_p.

Referenced by effect_to_store_independent(), effect_to_store_independent_sdfi_list(), incrementation_expression_to_increment(), proper_to_summary_simple_effect(), reference_with_constant_indices_p(), reference_with_store_independent_indices(), and reference_with_unbounded_indices_p().

00675 {
00676   value v = EvalExpression(e);
00677   bool ice_p = FALSE;
00678 
00679   if(value_constant_p(v)) {
00680     constant c = value_constant(v);
00681 
00682     ice_p = constant_int_p(c);
00683   }
00684   free_value(v);
00685   return ice_p;
00686 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool false_expression_p ( expression  e  ) 

Definition at line 910 of file ri-util/expression.c.

References FALSE_OPERATOR_NAME, and operator_expression_p().

Referenced by MakeInvertExpression(), partial_redundancy_elimination_expression(), and partial_redundancy_elimination_rwt().

00911 {
00912   return operator_expression_p(e,FALSE_OPERATOR_NAME);
00913 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression find_ith_argument ( list  args,
int  n 
)
expression find_ith_expression ( list  le,
int  r 
)

find_ith_expression() is obsolet; use find_ith_argument() instead

the first element is one

two local variables, useless but for debugging

Parameters:
le e

Definition at line 953 of file ri-util/expression.c.

References CAR, ENDP, EXPRESSION, i, pips_assert, pips_error(), and POP.

Referenced by set_dimensions_of_local_variable_family().

00954 {
00955     /* the first element is one */
00956     /* two local variables, useless but for debugging */
00957     list cle;
00958     int i;
00959 
00960     pips_assert("find_ith_expression", r > 0);
00961 
00962     for(i=r, cle=le ; i>1 && !ENDP(cle); i--, POP(cle))
00963         ;
00964 
00965     if(ENDP(cle))
00966         pips_error("find_ith_expression",
00967                    "not enough elements in expresion list\n");
00968 
00969     return EXPRESSION(CAR(cle));
00970 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression float_to_expression ( float  c  ) 

Definition at line 987 of file ri-util/expression.c.

References call_to_expression(), e, float_to_entity(), make_call(), and NIL.

Referenced by complex_to_expression(), make_0val_expression(), make_1val_expression(), and set_the_i().

00988 {
00989     entity e = float_to_entity(c);
00990     return call_to_expression(make_call(e,NIL));
00991 }

Here is the call graph for this function:

Here is the caller graph for this function:

int fortran_string_compare ( string  fs1,
string  fs2 
)

compare pips fortran string constants from the fortran point of view.

expression.c

as of 3.1 and 6.3.5 of the Fortran 77 standard, the character order is not fully specified. It states:

  • A < B < C ... < Z
  • 0 < 1 < 2 ... < 9
  • blank < 0
  • blank < A
  • 9 < A *OR* Z < 0 since these rules are ascii compatible, we'll take ascii. in practice, this may be implementation dependent?
Parameters:
fs1 constant fortran string (entity name is fine)
fs2 constant fortran string (entity name is fine)
Returns:
-n 0 +n depending on < == >, n first differing char.

skip headers, trailers...

collating sequence comparison.

equal string header case.

Parameters:
fs1 s1
fs2 s2

Definition at line 105 of file ri-util/expression.c.

References actual_fortran_string_to_compare(), i, and s1.

Referenced by constant_constraint_check().

00106 {
00107   int l1, l2, i, c = 0;
00108   string s1, s2;
00109 
00110   /* skip headers, trailers... */
00111   s1 = actual_fortran_string_to_compare(fs1, &l1);
00112   s2 = actual_fortran_string_to_compare(fs2, &l2);
00113 
00114   /* collating sequence comparison. */
00115   for (i=0; c==0 && i<l1 && i<l2; i++)
00116   {
00117     if (s1[i] < s2[i]) c = -i-1;
00118     if (s1[i] > s2[i]) c = i+1;
00119   }
00120 
00121   /* equal string header case. */
00122   if (c==0 && l1!=l2)
00123     c = (l1<l2)? -l1-1: l2+1;
00124 
00125   return c;
00126 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool iabs_expression_p ( expression  e  ) 

Definition at line 828 of file ri-util/expression.c.

References IABS_OPERATOR_NAME, and operator_expression_p().

00830 {
00831     return operator_expression_p(e, IABS_OPERATOR_NAME);
00832 }

Here is the call graph for this function:

expression int_to_expression ( _int  i  ) 

transform an int into an expression and generate the corresponding entity if necessary; it is not clear if strdup() is always/sometimes necessary and if a memory leak occurs; wait till syntax/expression.c is merged with ri-util/expression.c

Negative constants do not seem to be included in PIPS internal representation.

Definition at line 981 of file ri-util/expression.c.

References call_to_expression(), e, int_to_entity(), make_call(), and NIL.

Referenced by abc_with_allocation_size(), add_reduction(), ajoute_constante(), ajoute_new_var(), alias_check(), alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_and_scalar_variable_in_module_flt(), alias_check_array_variable_in_caller_flt(), alias_check_array_variable_in_module_flt(), alias_check_scalar_and_array_variables_in_caller(), alias_check_scalar_and_array_variables_in_module(), analyze_expression(), any_basic_update_operation_to_transformer(), any_basic_update_to_transformer(), array_access_to_array_ranges(), array_as_template(), array_indices_check(), array_ranges_to_template_ranges(), array_size_stride(), array_to_pointer_fix_call_site(), bottom_up_abc_expression_implied_do(), bound_to_statement(), bounds_of_expression(), build_call_STEP_AlltoAllRegion(), build_call_STEP_MastertoAllRegion(), build_call_STEP_WaitALL(), build_mpi_after_master(), build_mpi_master(), build_new_loop_bounds(), build_statement_for_clone(), c_convex_effects_on_actual_parameter_forward_translation(), c_dim_string(), c_parse(), c_summary_effect_to_proper_effects(), call_nary_rwt(), compile_one_reduction(), compile_reduction(), complementary_range(), compute_receive_content(), compute_receive_domain(), contraintes_to_expression(), convert_bound_expression(), convex_effect_field_to_rank_conversion(), create_externalized_function_common(), CreateLogicalUnits(), cstr_args_check(), DeclarePointer(), define_node_processor_id(), dimension_to_range(), distance_between_entity(), do_group_constants_terapix(), do_group_count_elements(), do_group_count_elements_reduce(), do_loop_expansion(), do_loop_expansion_init(), do_loop_unroll(), do_terapix_remove_divide(), dynamic_alias_check_flt(), ecrit_une_var(), ecrit_une_var_neg(), effect_add_dereferencing_dimension(), effects_of_C_ioelem(), effects_to_dma(), entity_ith_bounds(), expand_call(), expr_compute_local_index(), expression_plusplus(), expression_try_find_size(), expression_try_find_string_size(), extract_the_align(), fix_if_condition(), full_loop_unroll(), fusion_buffer(), generate_compact(), generate_copy_loop_nest(), generate_full_copy(), generate_monome(), generate_one_message(), generate_prelude(), generate_remapping_guard(), generate_subarray_shift(), GenerateReturn(), generic_io_effects(), generic_proper_effects_of_complex_address_expression(), gfc2pips_array_ref2indices(), gfc2pips_code2instruction_(), gfc2pips_get_list_of_dimensions2(), gfc2pips_int2dimension(), gfc2pips_vars_(), Hierarchical_tiling(), hpfc_add_2(), hpfc_add_n(), hpfc_broadcast_buffers(), hpfc_buffer_initialization(), hpfc_compute_lid(), hpfc_init_run_time_entities(), if_different_pe_and_not_twin(), impact_check(), incrementation_expression_to_increment(), InitializeEnumMemberValues(), instrument_call_rwt(), interprocedural_abc_arrays(), io_effects(), isolate_make_call_array_transfer(), live_mapping_expression(), loop_flt(), loop_strip_mine(), make_0val_expression(), make_1val_expression(), make_abc_count_statement(), make_c_stop_statement(), make_condition_from_loop(), make_datum_movement(), make_emulated_shared_variable(), make_exit_statement(), make_expression_with_state_variable(), make_global_common_and_initialize(), make_guard_expression(), make_increment_statement(), make_list_of_constant(), make_list_of_flags(), make_loadsave_statement(), make_loop_skeleton(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), make_mypos_expression(), make_new_simd_vector(), make_pointer_from_variable(), make_reduction_vector_entity(), make_reindex(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_set_rc_statement(), make_simd_statements(), make_special_value(), make_state_variable_assignement_statement(), MakeArithmIfInst(), MakeAssignedOrComputedGotoInst(), MakeAtom(), MakeDataValueSet(), MakeDimension(), MakeIoInstA(), MakeWhileDoInst(), NewDeclarationOfDistributedArray(), NormalizeOneTemplateDistribution(), offset_in_caller(), offset_of_struct(), outliner_smart_references_computation(), overlap_redefine_expression(), pragma_build_if_condition(), prepare_expansion(), ram_variable_add_aliases(), range_to_expression(), rational_sol_edit(), reduce_array_declaration_dimension(), reduction_variable_expansion(), reference_offset(), regenerate_expression(), region_to_minimal_dimensions(), rename_reduction_ref_walker(), safe_static_domain_bound(), same_or_equivalence_argument_add_aliases(), sesamify(), set_array_status_to_target(), set_dimensions_of_local_variable_family(), shape_one_message(), simple_cell_reference_with_address_of_cell_reference_translation(), simple_effect_field_to_rank_conversion(), simplify_complex_entity(), simplify_complex_expression(), simplify_relational_expression(), size_of_actual_array(), size_of_dummy_array(), size_of_unnormalized_dummy_array(), SizeOfDimension(), SizeOfDimensions(), some_io_effects(), split_complex_expression(), sprintf_check_expression(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), statement_compute_bounds(), step_build_arrayRegion(), step_build_assigne_region0(), step_build_ComputeLoopSlices(), step_handle_comm_requests(), step_local_loopSlices(), step_local_requests_array(), step_local_SR(), step_parameter(), step_parameter_max_nb_request(), step_sizevariable_in_expression(), storage_ram_offset(), strcpy_check_expression(), subscript_value(), subscript_value_stride(), substitute_and_create(), subtitute_induction_statement_in(), syn_parse(), systeme_to_loop_nest(), template_ranges_to_processors_ranges(), terapix_loop_handler(), tiling(), Tiling2_buffer(), Tiling_buffer_allocation(), top_down_abc_dimension(), top_down_adn_call_flt(), translate_array_effect(), translate_call_to_callee_frame(), update_indices_for_local_computation(), update_range(), Value_to_expression(), variable_initial_expression(), verify_array_element(), verify_array_variable(), verify_scalar_variable(), words_dimension(), and yyparse().

00982 {
00983     entity e = int_to_entity(i);
00984     return call_to_expression(make_call(e,NIL));
00985 }

Here is the call graph for this function:

bool integer_constant_expression_p ( expression  e  ) 

positive integer constant expression: call to a positive constant or to a sum of positive integer constant expressions (much too restrictive, but enough for the source codes submitted to PIPS up to now).

Likely to fail and need further extension if subtraction and multiplication are used as probably allowed by C standard.

NormalizeExpression() could be used instead, as it is in fact to compute the value of the expression.

Use previous function instead of this one, and -1 will be a constant...

Definition at line 701 of file ri-util/expression.c.

References call_arguments, call_function, CAR, CDR, ENTITY_PLUS_C_P, ENTITY_PLUS_P, EXPRESSION, expression_syntax, FALSE, i, integer_constant_expression_p(), integer_constant_p(), integer_symbolic_constant_p(), s, syntax_call, syntax_call_p, and TRUE.

Referenced by full_define_p(), get_final_offset(), integer_constant_expression_p(), integer_constant_expression_value(), integer_divide_to_transformer(), modulo_to_transformer(), sentence_data_statement(), and signed_integer_constant_expression_p().

00703 {
00704   syntax s = expression_syntax(e);
00705   bool ice = FALSE;
00706 
00707   if(syntax_call_p(s)) {
00708     call c = syntax_call(s);
00709     entity cst = call_function(c);
00710     list args = call_arguments(c);
00711     int i;
00712 
00713     if(integer_constant_p(cst, &i)) {
00714       ice = TRUE;
00715     }
00716     else if(integer_symbolic_constant_p(cst, &i)) {
00717       ice = TRUE;
00718     }
00719     else if(ENTITY_PLUS_P(cst)||ENTITY_PLUS_C_P(cst)) {
00720       expression e1 = EXPRESSION(CAR(args));
00721       expression e2 = EXPRESSION(CAR(CDR(args)));
00722 
00723       ice = integer_constant_expression_p(e1) && integer_constant_expression_p(e2);
00724     }
00725   }
00726 
00727   return ice;
00728 }

Here is the call graph for this function:

Here is the caller graph for this function:

int integer_constant_expression_value ( expression  e  ) 

Definition at line 1349 of file ri-util/expression.c.

References integer_constant_expression_p(), pips_assert, and signed_integer_constant_expression_value().

Referenced by full_define_p(), get_final_offset(), integer_divide_to_transformer(), and modulo_to_transformer().

01350 {
01351   pips_assert("is constant", integer_constant_expression_p(e));
01352   return signed_integer_constant_expression_value(e);
01353 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool integer_expression_p ( expression  e  ) 

Definition at line 418 of file ri-util/expression.c.

References b, basic_int_p, basic_of_expression(), and free_basic().

Referenced by fix_if_condition().

00419 {
00420   basic b = basic_of_expression(e);
00421   bool integer_p = basic_int_p(b);
00422 
00423   free_basic(b);
00424   return integer_p;
00425 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_expression_reference_to_entity_p ( expression  e,
entity  v 
)

Test if an expression is a reference to a given variable entity.

Definition at line 359 of file ri-util/expression.c.

References expression_reference_p(), expression_syntax, FALSE, reference_variable, and syntax_reference.

Referenced by incrementation_expression_to_increment(), and is_left_part_of_assignment().

00360 {
00361   bool is_e_reference_to_v = FALSE;
00362 
00363   if(expression_reference_p(e)) {
00364     reference r = syntax_reference(expression_syntax(e));
00365 
00366     is_e_reference_to_v = (reference_variable(r)==v);
00367   }
00368   return is_e_reference_to_v;
00369 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool logical_expression_p ( expression  e  ) 

A logical expression is either one of the following:

  • a logical constant
  • the symbolic name of a logical constant
  • a logical variable name
  • a logical array element name
  • a logical function reference
  • a relational expression (.LT.,.LE.,.EQ.,.NE.,.GT.,.GE.)
  • is formed by combining together one or more of the above entities using parentheses and the logical operators .NOT.,.AND.,.OR.,.EQV.,.NEQV.

NN: In fact, I didn't use the PIPS function : basic_of_expression because of 2 reasons :

  • the function basic_of_intrinsic use the macro : ENTITY_LOGICAL_OPERATOR_P which is not like the Fortran Standard definition (the above comments)
  • the case where an expression is a range is not considered here for a logical expression

The case of symbolic name of a logical constant is not treated here

Definition at line 427 of file ri-util/expression.c.

References b, basic_logical_p, call_function, debug(), entity_type, expression_syntax, FALSE, FALSE_OPERATOR_NAME, functional_result, is_syntax_call, is_syntax_range, is_syntax_reference, logical_operator_expression_p(), operator_expression_p(), pips_debug, pips_error(), reference_variable, relational_expression_p(), s, syntax_call, syntax_reference, syntax_tag, TRUE, TRUE_OPERATOR_NAME, type_functional, type_variable, and variable_basic.

Referenced by fix_if_condition(), MakeInvertExpression(), MakeWhileDoInst(), and partial_redundancy_elimination_rwt().

00428 {
00429   /* A logical expression is either one of the following:
00430    * - a logical constant
00431    * - the symbolic name of a logical constant
00432    * - a logical variable name
00433    * - a logical array element name
00434    * - a logical function reference
00435    * - a relational expression (.LT.,.LE.,.EQ.,.NE.,.GT.,.GE.)
00436    * - is formed by combining together one or more of the above
00437    *   entities using parentheses and the logical operators
00438    *   .NOT.,.AND.,.OR.,.EQV.,.NEQV. */
00439 
00440   /* NN:  In fact, I didn't use the PIPS function : basic_of_expression because of 2 reasons :
00441    * - the function basic_of_intrinsic use the macro : ENTITY_LOGICAL_OPERATOR_P
00442    *   which is not like the Fortran Standard definition (the above comments)
00443    * - the case where an expression is a range is not considered here for a
00444    *   logical expression */
00445 
00446   syntax s = expression_syntax(e);
00447   basic b;
00448   entity func;
00449 
00450   pips_debug(2, "\n");
00451 
00452   switch(syntax_tag(s)) {
00453   case is_syntax_reference:
00454     {
00455       b = variable_basic(type_variable(entity_type(reference_variable(syntax_reference(s)))));
00456       if (basic_logical_p(b))
00457         return TRUE;
00458       return FALSE;
00459     }
00460   case is_syntax_call:
00461     {
00462       if (operator_expression_p(e,TRUE_OPERATOR_NAME) ||
00463           operator_expression_p(e,FALSE_OPERATOR_NAME) ||
00464           relational_expression_p(e)||
00465           logical_operator_expression_p(e) )
00466         return TRUE;
00467       func = call_function(syntax_call(expression_syntax(e)));
00468       b = variable_basic(type_variable(functional_result(type_functional(entity_type(func)))));
00469       if (basic_logical_p(b)) return TRUE;
00470 
00471       /* The case of symbolic name of a logical constant is not treated here */
00472 
00473       return FALSE;
00474     }
00475   case is_syntax_range:
00476     return FALSE;
00477   default: pips_error("basic_of_expression", "Bad syntax tag");
00478     return FALSE;
00479   }
00480 
00481   debug(2, "logical expression", " ends\n");
00482 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool logical_operator_expression_p ( expression  e  ) 

Logical operators are : .NOT.,.AND.,.OR.,.EQV.,.NEQV.

Definition at line 390 of file ri-util/expression.c.

References call_function, ENTITY_AND_P, ENTITY_EQUIV_P, ENTITY_NON_EQUIV_P, ENTITY_NOT_P, ENTITY_OR_P, expression_call_p(), expression_syntax, FALSE, syntax_call, and TRUE.

Referenced by logical_expression_p(), MakeInvertExpression(), number_of_operators_flt(), and partial_redundancy_elimination_expression().

00391 {
00392   /* Logical operators are : .NOT.,.AND.,.OR.,.EQV.,.NEQV.*/
00393   if (expression_call_p(e))
00394     {
00395       entity op = call_function(syntax_call(expression_syntax(e)));
00396       if (ENTITY_AND_P(op) || ENTITY_OR_P(op) || ENTITY_NOT_P(op) ||
00397           ENTITY_EQUIV_P(op) ||ENTITY_NON_EQUIV_P(op))
00398         return TRUE;
00399       return FALSE;
00400     }
00401   return FALSE;
00402 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_assign_expression ( expression  lhs,
expression  rhs 
)

Make an assign expression, since in C the assignment is a side effect operator.

Useful in for-loops.

Parameters:
lhs must be a reference
rhs is the expression to assign
Returns:
the expression "lhs = rhs"

RK: this assert should be relaxed to deal with *p and so on. pips_assert("Need a reference as lhs", expression_reference_p(lhs));

Parameters:
lhs hs
rhs hs

Definition at line 296 of file ri-util/expression.c.

References ASSIGN_OPERATOR_NAME, CreateIntrinsic(), and MakeBinaryCall().

Referenced by bug_in_patch_outlined_reference(), try_to_recover_for_loop_in_a_while(), and yyparse().

00297                                        {
00298   /* RK: this assert should be relaxed to deal with *p and so on.
00299      pips_assert("Need a reference as lhs", expression_reference_p(lhs)); */
00300   return MakeBinaryCall(CreateIntrinsic(ASSIGN_OPERATOR_NAME), lhs, rhs);
00301 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_call_expression ( entity  e,
list  l 
)
expression make_constraint_expression ( Pvecteur  v,
Variable  index 
)

Make an expression from a constraint v for a given index.

For example: for a constraint of index I : aI + linear_expr(J,K,TCST) <=0

Returns:
the new expression for I that is -expr_linear(J,K,TCST)/a

earch the couple (var,val) where var is equal to index and extract it

If the vector wihout the index is the vector null, we have simply index = 0:

If the coefficient for the index is positive, inverse all the vector since the index goes at the other side of "=":

If coeff is negative, correct the future division rounding (by -coeff) by adding (coeff - 1) to the vector first:

If the vector is simply coeff.index=c, directly generate and return c/coeff:

Generate an expression from the linear vector:

If coeff > 1, divide all the expression by coeff:

FI->YY: before generating a division, you should test if it could not be performed statically; you have to check if ex1 is not a constant expression, which is fairly easy since you still have its linear form, pv

Parameters:
index ndex

Definition at line 1505 of file ri-util/expression.c.

References CONS, entity_domain, entity_undefined, EXPRESSION, gen_find_tabulated(), is_syntax_call, make_call(), make_expression(), make_integer_constant_expression(), make_syntax(), make_vecteur_expression(), NIL, normalized_undefined, pips_assert, TCST, value_absolute, value_gt, value_minus, VALUE_ONE, value_pdiv, value_pos_p, VALUE_TO_INT, vect_add_elem(), vect_chg_sgn(), vect_coeff(), vect_dup(), vect_erase_var(), vect_size(), VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by make_bound_expression(), make_contrainte_expression(), and try_to_recover_for_loop_in_a_while().

01506 {
01507   Pvecteur pv;
01508   expression ex1, ex2, ex;
01509   entity div;
01510   Value coeff;
01511 
01512   /*search the couple (var,val) where var is equal to index and extract it */
01513   pv = vect_dup(v);
01514   coeff = vect_coeff(index, pv);
01515   vect_erase_var(&pv, index);
01516 
01517   if (VECTEUR_NUL_P(pv))
01518     /* If the vector wihout the index is the vector null, we have simply
01519        index = 0: */
01520     return make_integer_constant_expression(0);
01521 
01522   /* If the coefficient for the index is positive, inverse all the
01523      vector since the index goes at the other side of "=": */
01524   if (value_pos_p(coeff))
01525     vect_chg_sgn(pv);
01526   else {
01527     /* If coeff is negative, correct the future division rounding (by
01528        -coeff) by adding (coeff - 1) to the vector first: */
01529     value_absolute(coeff);
01530     vect_add_elem(&pv, TCST, value_minus(coeff, VALUE_ONE));
01531   }
01532 
01533   if(vect_size(pv) == 1 && vecteur_var(pv) == TCST) {
01534     /* If the vector is simply coeff.index=c, directly generate and
01535        return c/coeff: */
01536     vecteur_val(pv) = value_pdiv(vecteur_val(pv), coeff);
01537     return make_vecteur_expression(pv);
01538   }
01539 
01540   /* Generate an expression from the linear vector: */
01541   ex1 = make_vecteur_expression(pv);
01542 
01543   if (value_gt(coeff, VALUE_ONE)) {
01544     /* If coeff > 1, divide all the expression by coeff: */
01545     /* FI->YY: before generating a division, you should test if it could
01546        not be performed statically; you have to check if ex1 is not a
01547        constant expression, which is fairly easy since you still have
01548        its linear form, pv */
01549     div = gen_find_tabulated("TOP-LEVEL:/",entity_domain);
01550     pips_assert("Division operator not found", div != entity_undefined);
01551 
01552     ex2 = make_integer_constant_expression(VALUE_TO_INT(coeff));
01553     ex = make_expression(make_syntax(is_syntax_call,
01554                                      make_call(div,
01555                                                CONS(EXPRESSION,ex1,
01556                                                     CONS(EXPRESSION,
01557                                                          ex2,NIL)))),
01558                          normalized_undefined);
01559     return(ex);
01560   }
01561   else
01562     return(ex1);
01563 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_contrainte_expression ( Pcontrainte  pc,
Variable  index 
)

A wrapper around make_contrainte_expression() for compatibility.

Simply call the function on the vector in the constrain system:

Parameters:
pc c
index ndex

Definition at line 1568 of file ri-util/expression.c.

References make_constraint_expression(), and Scontrainte::vecteur.

Referenced by free_guards().

01568                                                                       {
01569   /* Simply call the function on the vector in the constrain system: */
01570   return make_constraint_expression(pc->vecteur, index);
01571 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_entity_expression ( entity  e,
cons inds 
)
expression make_factor_expression ( int  coeff,
entity  vari 
)

Some functions to generate expressions from vectors and constraint systems.

expression make_factor_expression(int coeff, entity vari) make the expression "coeff*vari" where vari is an entity.

a constant only

Parameters:
coeff oeff
vari ari

Definition at line 1390 of file ri-util/expression.c.

References CONS, entity_domain, EXPRESSION, gen_find_tabulated(), is_syntax_call, is_syntax_reference, make_call(), make_expression(), make_integer_constant_expression(), make_reference(), make_syntax(), NIL, normalized_undefined, and NULL.

Referenced by ecrit_une_var(), icm_loop_rwt(), make_vecteur_expression(), remove_dead_loop(), and remove_loop_statement().

01391 {
01392   expression e1, e2, e3;
01393   entity operateur_multi;
01394 
01395   e1 = make_integer_constant_expression(coeff);
01396   if (vari==NULL)
01397     return(e1);                 /* a constant only */
01398   else {
01399     e2 = make_expression(make_syntax(is_syntax_reference,
01400                                      make_reference(vari, NIL)),
01401                          normalized_undefined);
01402     if (coeff == 1) return(e2);
01403     else {
01404       operateur_multi = gen_find_tabulated("TOP-LEVEL:*",entity_domain);
01405       e3 = make_expression(make_syntax(is_syntax_call,
01406                                        make_call(operateur_multi,
01407                                                  CONS(EXPRESSION, e1,
01408                                                       CONS(EXPRESSION, e2,
01409                                                            NIL)))),
01410                            normalized_undefined);
01411       return (e3);
01412     }
01413   }
01414 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_false_expression ( void   ) 

Definition at line 900 of file ri-util/expression.c.

References FALSE_OPERATOR_NAME, is_basic_logical, make_call_expression(), MakeConstant(), and NIL.

Referenced by MakeInvertExpression(), and partial_redundancy_elimination_expression().

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_integer_constant_expression ( int  c  ) 

expression make_integer_constant_expression(int c) make expression for integer

make expression for the constant c

Definition at line 1335 of file ri-util/expression.c.

References is_syntax_call, make_call(), make_expression(), make_integer_constant_entity(), make_syntax(), NIL, and normalized_undefined.

Referenced by array_indices_communication(), array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), bdt_save_int(), bdt_save_pred(), bound_generation(), build_bdt_null(), build_first_comb(), build_flag_assign(), build_flag_test(), build_local_time_test(), build_third_comb(), check_loop_distribution_feasability(), code_generation(), comEngine_generate_procCode(), complex_bound_generation(), compute_final_index_value(), free_guards(), fusion(), fusion_buffer(), gener_DOSEQ(), generate_code(), generate_fifo_stat(), generate_ind_fifo_stat2(), generate_io_wp65_code(), generate_mmcd_stat_from_ref(), generate_stat_from_ref_list_proc(), generate_stat_from_ref_list_proc_list(), get_fifo_from_ref(), get_indExp_from_ref(), Hierarchical_tiling(), loop_annotate(), loop_nest_to_wp65_code(), loop_normalize_of_loop(), loop_normalize_statement(), lower_bound_generation(), make_array_bounds(), make_bounds(), make_constraint_expression(), make_exec_mmcd(), make_factor_expression(), make_increment_instruction(), make_init_newInd_stat(), make_lInitStats(), make_lSwitchStats(), make_max_exp(), make_maxval_expression(), make_minval_expression(), make_mmcd_load_store_stat(), make_op_exp(), make_rational_exp(), make_step_inc_statement(), make_toggle_inc_statement(), make_toggle_init_statement(), make_toggle_mmcd(), make_transStat(), make_vecteur_expression(), merge_lists(), ndf_normalized_test(), normalize_test_leaves(), predicate_to_expression(), prepare_array_bounds(), prgm_mapping(), psystem_to_expression(), Pvecteur_to_expression(), rational_op_exp(), re_do_it(), reference_filter(), save_int(), save_pred(), sc_opposite_exp_of_conjunction(), simplify_dimension(), test_bound_generation(), Tiling2_buffer(), Tiling_buffer_allocation(), unary_into_binary_ref(), upper_bound_generation(), and usual_loop_tiling().

01336 {
01337   expression ex_cons;
01338   entity ce;
01339 
01340   ce = make_integer_constant_entity(c);
01341   /* make expression for the constant c*/
01342   ex_cons = make_expression(
01343                             make_syntax(is_syntax_call,
01344                                         make_call(ce,NIL)),
01345                             normalized_undefined);
01346   return (ex_cons);
01347 }

Here is the call graph for this function:

expression make_lin_op_exp ( entity  op_ent,
expression  exp1,
expression  exp2 
)

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

expression make_lin_op_exp(entity op_ent, expression exp1 exp2): returns the expression resulting of the linear operation (ie. + or -) "op_ent" between two integer linear expressions "exp1" and "exp2".

This function uses the linear library for manipulating Pvecteurs.

Pvecteur_to_expression() is a function that rebuilds an expression from a Pvecteur.

Parameters:
op_ent p_ent
exp1 xp1
exp2 xp2

Definition at line 1955 of file ri-util/expression.c.

References debug(), ENTITY_MINUS_P, ENTITY_PLUS_P, expression_normalized, free_expression(), is_normalized_complex, normalized_linear, normalized_tag, pips_error(), Pvecteur_to_expression(), user_error(), vect_add(), vect_substract(), and VECTEUR_NUL.

Referenced by make_op_exp(), and rational_op_exp().

01956 {
01957   Pvecteur V1, V2, newV = VECTEUR_NUL;
01958 
01959   debug( 7, "make_lin_op_exp", "doing\n");
01960   if((normalized_tag(expression_normalized(exp1)) == is_normalized_complex) ||
01961      (normalized_tag(expression_normalized(exp2)) == is_normalized_complex))
01962     user_error("make_lin_op_exp",
01963                "expressions MUST be linear and normalized");
01964 
01965   V1 = (Pvecteur) normalized_linear(expression_normalized(exp1));
01966   V2 = (Pvecteur) normalized_linear(expression_normalized(exp2));
01967 
01968   if (ENTITY_PLUS_P(op_ent))
01969     newV = vect_add(V1, V2);
01970   else if (ENTITY_MINUS_P(op_ent))
01971     newV = vect_substract(V1, V2);
01972   else
01973     pips_error("make_lin_op_exp", "operation must be : + or -");
01974   free_expression(exp1);
01975   free_expression(exp2);
01976 
01977   return(Pvecteur_to_expression(newV));
01978 }

Here is the call graph for this function:

Here is the caller graph for this function:

list make_list_of_constant ( int  val,
int  number 
)

of expression

the length of the created list

Parameters:
val al
number the constant value

Definition at line 3000 of file ri-util/expression.c.

References CONS, EXPRESSION, int_to_expression(), NIL, and pips_assert.

Referenced by hpfc_compute_lid(), st_compute_current_computer(), st_compute_current_owners(), translate_reference_to_callee_frame(), and translate_to_module_frame().

03002 {
03003   list l=NIL;
03004 
03005   pips_assert("valid number", number>=0);
03006   for(; number; number--)
03007     l = CONS(EXPRESSION, int_to_expression(val), l);
03008 
03009   return l;
03010 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_op_exp ( char *  op_name,
expression  exp1,
expression  exp2 
)

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

expression make_op_exp(char *op_name, expression exp1 exp2): Returns an expression containing the operation "op_name" between "exp1" and "exp2". "op_name" must be one of the four classic operations : +, -, * or /.

If both expressions are integer constant values and the operation result is an integer then the returned expression contained the calculated result.

Else, we treat five special cases : _ exp1 and exp2 are integer linear and op_name is + or -. This case is resolved by make_lin_op_exp(). _ exp1 = 0 _ exp1 = 1 _ exp2 = 0 _ exp2 = 1

Else, we create a new expression with a binary call.

Note: The function MakeBinaryCall() comes from Pips/.../syntax/expression.c The function make_integer_constant_expression() comes from ri-util.

Warning: using the same semantic as MakeBinaryCall, make_op_exp owns the pointer exp1 and exp2 after the call, beware of not sharing them !

ENTITY_DIVIDE_P(op_ent)

we compute here as FORTRAN would do

We need to know the integer linearity of both expressions.

ENTITY_MULTIPLY_P(op_ent) || ENTITY_DIVIDE_P(op_ent)

ENTITY_DIVIDE_P(op_ent)

Parameters:
op_name p_name
exp1 xp1
exp2 xp2

Definition at line 1837 of file ri-util/expression.c.

References debug(), ENTITY_DIVIDE_P, entity_domain, ENTITY_FIVE_OPERATION_P, ENTITY_MINUS_P, ENTITY_MODULO_P, ENTITY_MULTIPLY_P, ENTITY_PLUS_P, expression_equal_integer_p(), expression_integer_value(), expression_undefined, free_expression(), gen_find_tabulated(), intptr_t, is_normalized_linear, make_entity_fullname(), make_integer_constant_expression(), make_lin_op_exp(), MakeBinaryCall(), MakeUnaryCall(), NIL, NORMALIZE_EXPRESSION, normalized_tag, pips_debug, TOP_LEVEL_MODULE_NAME, UNARY_MINUS_OPERATOR_NAME, user_error(), words_expression(), and words_to_string().

Referenced by ajoute_constante(), ajoute_new_var(), bdt_save_pred(), build_third_comb(), compute_final_index_value(), contraintes_to_expression(), distance_between_entity(), distance_between_expression(), do_group_constants_terapix(), do_group_count_elements_reduce(), do_grouping_replace_reference_by_expression_walker(), do_loop_expansion(), do_loop_expansion_init(), do_sizeofdimension_reduction(), ecrit_une_var(), ecrit_une_var_neg(), effects_to_dma(), isolate_merge_offsets(), loop_annotate(), loop_normalize_of_loop(), loop_normalize_statement(), loop_strip_mine(), make_pointer_from_variable(), ndf_normalized_test(), normalize_test_leaves(), offset_of_struct(), partial_eval_min_or_max_operator(), prepare_expansion(), put_source_ind(), range_to_expression(), rational_sol_edit(), reduce_array_declaration_dimension(), reduction_variable_expansion(), reference_offset(), region_to_minimal_dimensions(), save_pred(), sc_opposite_exp_of_conjunction(), sesamify(), SizeOfDimension(), step_parameter_max_nb_request(), and terapix_loop_handler().

01838 {
01839   expression result_exp = expression_undefined;
01840   entity op_ent, unary_minus_ent;
01841 
01842   debug( 7, "make_op_exp", "doing\n");
01843   op_ent = gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01844                                                    op_name), entity_domain);
01845   unary_minus_ent =
01846     gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01847                                             UNARY_MINUS_OPERATOR_NAME),
01848                        entity_domain);
01849 
01850   pips_debug(5, "begin OP EXP : %s  %s  %s\n",
01851         words_to_string(words_expression(exp1, NIL)),
01852         op_name,
01853         words_to_string(words_expression(exp2, NIL)));
01854 
01855   if( ! ENTITY_FIVE_OPERATION_P(op_ent) )
01856     user_error("make_op_exp", "operation must be : +, -, *, MOD, or /");
01857 
01858   intptr_t val1, val2;
01859   if( expression_integer_value(exp1,&val1) && expression_integer_value(exp2,&val2) )
01860     {
01861 
01862       debug(6, "make_op_exp", "Constant expressions\n");
01863 
01864       if (ENTITY_PLUS_P(op_ent))
01865         result_exp = make_integer_constant_expression(val1 + val2);
01866       else if(ENTITY_MINUS_P(op_ent))
01867         result_exp = make_integer_constant_expression(val1 - val2);
01868       else if(ENTITY_MULTIPLY_P(op_ent))
01869         result_exp = make_integer_constant_expression(val1 * val2);
01870       else if(ENTITY_MODULO_P(op_ent))
01871           result_exp = make_integer_constant_expression(val1 % val2);
01872       else /* ENTITY_DIVIDE_P(op_ent) */
01873         /* we compute here as FORTRAN would do */
01874         result_exp = make_integer_constant_expression((int) (val1 / val2));
01875       free_expression(exp1);
01876       free_expression(exp2);
01877     }
01878   else
01879     {
01880       /* We need to know the integer linearity of both expressions. */
01881       normalized nor1 = NORMALIZE_EXPRESSION(exp1);
01882       normalized nor2 = NORMALIZE_EXPRESSION(exp2);
01883 
01884       if((normalized_tag(nor1) == is_normalized_linear) &&
01885          (normalized_tag(nor2) == is_normalized_linear) &&
01886          (ENTITY_PLUS_P(op_ent) || ENTITY_MINUS_P(op_ent)) )
01887         {
01888           pips_debug(6, "Linear operation\n");
01889 
01890           result_exp = make_lin_op_exp(op_ent, exp1, exp2);
01891         }
01892       else if(expression_equal_integer_p(exp1, 0))
01893         {
01894           if (ENTITY_PLUS_P(op_ent)) {
01895             result_exp = exp2;
01896         free_expression(exp1);
01897       }
01898           else if(ENTITY_MINUS_P(op_ent)) {
01899             result_exp = MakeUnaryCall(unary_minus_ent, exp2);
01900         free_expression(exp1);
01901       }
01902           else /* ENTITY_MULTIPLY_P(op_ent) || ENTITY_DIVIDE_P(op_ent) */ {
01903             result_exp = make_integer_constant_expression(0);
01904         free_expression(exp1);free_expression(exp2);
01905       }
01906         }
01907       else if(expression_equal_integer_p(exp1, 1))
01908         {
01909           if(ENTITY_MULTIPLY_P(op_ent)) {
01910             result_exp = exp2;
01911         free_expression(exp1);
01912       }
01913         }
01914       else if(expression_equal_integer_p(exp2, 0))
01915         {
01916       free_expression(exp2);
01917           if (ENTITY_PLUS_P(op_ent) || ENTITY_MINUS_P(op_ent)) 
01918             result_exp = exp1;
01919           else if (ENTITY_MULTIPLY_P(op_ent)) {
01920             result_exp = make_integer_constant_expression(0);
01921         free_expression(exp1);
01922       }
01923           else /* ENTITY_DIVIDE_P(op_ent) */
01924             user_error("make_op_exp", "division by zero");
01925         }
01926       else if(expression_equal_integer_p(exp2, 1))
01927         {
01928           if(ENTITY_MULTIPLY_P(op_ent) || ENTITY_DIVIDE_P(op_ent)) {
01929             result_exp = exp1;
01930         free_expression(exp2);
01931       }
01932         }
01933     }
01934 
01935   if(result_exp == expression_undefined)
01936     result_exp = MakeBinaryCall(op_ent, exp1, exp2);
01937 
01938   pips_debug(5, "end   OP EXP : %s\n",
01939         words_to_string(words_expression(result_exp, NIL)));
01940 
01941   return (result_exp);
01942 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression make_true_expression ( void   ) 
expression make_vecteur_expression ( Pvecteur  pv  ) 

make expression for vector (Pvecteur)

sort: to insure a deterministic generation of the expression. note: the initial system is *NOT* touched. ??? Sometimes the vectors are shared, so you cant modify them that easily. Many cores in Hpfc (deducables), Wp65, and so. ok, I'm responsible for some of them:-)

(c) FC 24/11/94

let us avoid -1*var, we prefer -var

Parameters:
pv v

Definition at line 1418 of file ri-util/expression.c.

References ABS, call_to_expression(), compare_Pvecteur(), CONS, entity_intrinsic(), EXPRESSION, make_call(), make_factor_expression(), make_integer_constant_expression(), MINUS_OPERATOR_NAME, NIL, NULL, pips_assert, PLUS_OPERATOR_NAME, UNARY_MINUS_OPERATOR_NAME, v, VALUE_TO_INT, vect_rm(), vect_sort(), VECTEUR_NUL_P, vecteur_val, and vecteur_var.

Referenced by array_indices_communication(), array_scalar_access_to_bank_communication(), build_esv_list(), build_third_comb(), complex_bound_generation(), constraints_to_loop_bound(), contraintes_to_expression(), eval_var(), expression_to_expression_newbase(), generate_subarray_shift(), get_exp_schedule(), lower_bound_generation(), make_array_bounds(), make_constraint_expression(), make_datum_movement(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), make_rational_exp(), negate_expression(), partial_eval_expression(), Pcontrainte_to_expression_list(), predicate_to_expression(), psystem_to_expression(), put_source_ind(), Pvecteur_to_assign_statement(), reduce_loop_bound(), reference_conversion_computation(), test_bound_generation(), upper_bound_generation(), vect_to_string(), and vectors_to_expressions().

01419 {
01420   /* sort: to insure a deterministic generation of the expression.
01421    * note: the initial system is *NOT* touched.
01422    * ??? Sometimes the vectors are shared, so you cant modify them
01423    *     that easily. Many cores in Hpfc (deducables), Wp65, and so.
01424    * ok, I'm responsible for some of them:-)
01425    *
01426    *  (c) FC 24/11/94
01427    */
01428   Pvecteur
01429     v_sorted = vect_sort(pv, compare_Pvecteur),
01430     v = v_sorted;
01431   expression factor1, factor2;
01432   entity op_add, op_sub;
01433   int coef;
01434 
01435   op_add = entity_intrinsic(PLUS_OPERATOR_NAME);
01436   op_sub = entity_intrinsic(MINUS_OPERATOR_NAME);
01437 
01438   if (VECTEUR_NUL_P(v))
01439     return make_integer_constant_expression(0);
01440 
01441   coef = VALUE_TO_INT(vecteur_val(v));
01442 
01443   if (coef==-1) /* let us avoid -1*var, we prefer -var */
01444     {
01445       entity op_ums = entity_intrinsic(UNARY_MINUS_OPERATOR_NAME);
01446       factor1 = make_factor_expression(1, (entity) vecteur_var(v));
01447       factor1 = call_to_expression
01448         (make_call(op_ums, CONS(EXPRESSION, factor1, NIL)));
01449     }
01450   else
01451     factor1 = make_factor_expression(coef, (entity) vecteur_var(v));
01452 
01453   for (v=v->succ; v!=NULL; v=v->succ)
01454     {
01455       coef = VALUE_TO_INT(vecteur_val(v));
01456       pips_assert("some coefficient", coef!=0);
01457       factor2 = make_factor_expression(ABS(coef), (entity) vecteur_var(v));
01458       factor1 = call_to_expression
01459         (make_call(coef>0? op_add: op_sub,
01460                    CONS(EXPRESSION, factor1,
01461                         CONS(EXPRESSION, factor2,
01462                              NIL))));
01463     }
01464 
01465   vect_rm(v_sorted);
01466 
01467   return factor1;
01468 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression MakeBinaryCall ( entity  f,
expression  eg,
expression  ed 
)

Creates a call expression to a function with 2 arguments.

Parameters:
f is the function entity to call
eg is the first argument expression given to the function to call
ed is the second argument expression given to the function to call
Parameters:
eg g
ed d

Definition at line 260 of file ri-util/expression.c.

References CONS, EXPRESSION, make_call_expression(), and NIL.

Referenced by any_basic_update_operation_to_transformer(), any_basic_update_to_transformer(), any_update_to_transformer(), array_scalar_access_to_bank_communication(), buffer_full_condition(), bug_in_patch_outlined_reference(), build_mpi_master(), build_statement_for_clone(), c_dim_string(), c_parse(), c_reference(), c_summary_effect_to_proper_effects(), call_rwt(), compute_final_index_value(), constraints_to_loop_bound(), convert_bound_expression(), do_loop_expansion(), do_loop_unroll(), do_split_structure(), do_terapix_remove_divide(), expand_call(), expr_compute_local_index(), expression_array_to_pointer(), expression_list_to_binary_operator_call(), fix_if_condition(), generate_monome(), get_allocatable_data_expr(), gfc2pips_buildCaseTest(), gfc2pips_code2instruction_(), gfc2pips_dumpSELECT(), gfc2pips_expr2expression(), gfc2pips_reduce_repeated_values(), gfc2pips_symbol2data_instruction(), guard_expanded_statement(), hpfc_add_2(), hpfc_add_n(), loop_annotate(), loop_strip_mine(), make_assign_expression(), make_body_from_loop(), make_condition_from_loop(), make_expression_with_state_variable(), make_fields_assignment_instruction(), make_increment_statement(), make_max_exp(), make_movements_loop_body_wp65(), make_op_exp(), make_scalar_communication_module(), make_scanning_over_tiles(), make_start_ru_module(), MakeArithmIfInst(), MakeAssignedOrComputedGotoInst(), MakeComplexConstantExpression(), MakeDimension(), MakeFortranBinaryCall(), MakeWhileDoInst(), my_list_combination(), ndf_normalized_test(), normalize_test_leaves(), overlap_redefine_expression(), partial_eval_binary_operator_old(), partial_eval_mult_operator(), partial_eval_plus_or_minus_operator(), Pcontrainte_to_expression_list(), perform_reference_expansion_in_loop(), predicate_to_expression(), psystem_to_expression(), Pvecteur_to_expression(), rational_op_exp(), reduction_variable_expansion(), regenerate_expression(), sc_conditional(), sc_opposite_exp_of_conjunction(), sesamify(), simple_cell_reference_with_address_of_cell_reference_translation(), simplify_complex_expression(), split_complex_expression(), split_update_call(), st_send_to_computer_if_necessary(), struct_decomposition(), subtitute_induction_statement_in(), terapix_loop_handler(), translate_to_module_frame(), update_indices_for_local_computation(), update_operation_to_transformer(), update_range(), update_test_condition(), words_dimension(), and yyparse().

00260                                                                   {
00261   return make_call_expression(f, CONS(EXPRESSION, eg,
00262                                       CONS(EXPRESSION, ed, NIL)));
00263 }

Here is the call graph for this function:

expression MakeNullaryCall ( entity  f  ) 

Creates a call expression to a function with zero arguments.

Parameters:
f is the function entity to call

Definition at line 237 of file ri-util/expression.c.

References make_call_expression(), and NIL.

Referenced by bool_to_expression(), c_parse(), DeclarePointer(), dims_array_init(), expression_list_to_conjonction(), gfc2pips_array_ref2indices(), gfc2pips_code2instruction_(), gfc2pips_expr2expression(), gfc2pips_exprIO2(), gfc2pips_exprIO3(), gfc2pips_get_list_of_dimensions2(), make_unbounded_expression(), MakeAtom(), MakeCharacterConstantExpression(), MakeSimpleIoInst1(), MakeSimpleIoInst2(), syn_parse(), and yyparse().

00238 {
00239   return make_call_expression(f, NIL);
00240 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression MakeTernaryCall ( entity  f,
expression  e1,
expression  e2,
expression  e3 
)

Creates a call expression to a function with 3 arguments.

Parameters:
f is the function entity to call
e1 is the first argument expression given to the function to call
e2 is the second argument expression given to the function to call
e3 is the second argument expression given to the function to call
Parameters:
e1 1
e2 2
e3 3

Definition at line 273 of file ri-util/expression.c.

References CONS, EXPRESSION, make_call_expression(), and NIL.

Referenced by expr_compute_local_index(), make_phi_assign_instruction(), and yyparse().

00276                                               {
00277   return make_call_expression(f,
00278                               CONS(EXPRESSION, e1,
00279                                    CONS(EXPRESSION, e2,
00280                                         CONS(EXPRESSION, e3,
00281                                              NIL))));
00282 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression MakeUnaryCall ( entity  f,
expression  a 
)
bool max0_expression_p ( expression  e  ) 

Definition at line 853 of file ri-util/expression.c.

References MAX0_OPERATOR_NAME, MAX_OPERATOR_NAME, and operator_expression_p().

Here is the call graph for this function:

bool min0_expression_p ( expression  e  ) 

Definition at line 846 of file ri-util/expression.c.

References MIN0_OPERATOR_NAME, MIN_OPERATOR_NAME, and operator_expression_p().

Here is the call graph for this function:

bool modulo_expression_p ( expression  e  ) 

Definition at line 804 of file ri-util/expression.c.

References MODULO_OPERATOR_NAME, and operator_expression_p().

00806 {
00807     return operator_expression_p(e, MODULO_OPERATOR_NAME);
00808 }

Here is the call graph for this function:

bool operator_expression_p ( expression  e,
string  op_name 
)
Parameters:
op_name p_name

Definition at line 879 of file ri-util/expression.c.

References call_function, entity_local_name(), expression_syntax, FALSE, s, syntax_call, and syntax_call_p.

Referenced by abs_expression_p(), add_expression_p(), assignment_expression_p(), cabs_expression_p(), dabs_expression_p(), divide_expression_p(), false_expression_p(), iabs_expression_p(), logical_expression_p(), max0_expression_p(), min0_expression_p(), modulo_expression_p(), power_expression_p(), sub_expression_p(), substraction_expression_p(), top_down_adn_callers_arrays(), and true_expression_p().

00882 {
00883     syntax s = expression_syntax(e);
00884 
00885     if(syntax_call_p(s)) {
00886         call c = syntax_call(s);
00887         entity op = call_function(c);
00888 
00889         return strcmp(op_name, entity_local_name(op)) == 0;
00890     }
00891     else
00892         return FALSE;
00893 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool power_expression_p ( expression  e  ) 

Definition at line 816 of file ri-util/expression.c.

References operator_expression_p(), and POWER_OPERATOR_NAME.

00818 {
00819     return operator_expression_p(e, POWER_OPERATOR_NAME);
00820 }

Here is the call graph for this function:

void print_expression ( expression  e  ) 

no file descriptor is passed to make is easier to use in a debugging stage.

Do not make macros of those printing functions

Definition at line 1108 of file ri-util/expression.c.

References expression_normalized, expression_syntax, expression_undefined, fprintf(), n, normalized_undefined, print_normalized(), and print_syntax().

Referenced by abc_with_allocation_size(), affine_expression_of_loop_index_p(), alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_variable_in_caller_flt(), any_expression_to_transformer(), array_size_stride(), atom_cse_expression(), atomize_this_expression(), basic_of_intrinsic(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), c_parse(), call_rwt(), condition_expression_to_final_bound(), cse_expression_flt(), debug_cost_expression_array(), expr_cse_flt(), expression_equal_in_context_p(), expression_in_array_subscript(), expression_less_than_in_context(), expression_to_expression_newbase(), expression_to_type(), expression_to_uncasted_type(), find_entities_to_wrap(), forloop_inc(), forloop_test(), formal_variable_add_aliases(), generic_proper_effects_of_complex_address_expression(), gfc2pips_code2instruction_(), Hierarchical_tiling(), HpfcExpressionToInt(), ifdebug(), impact_check_two_scalar_variables_in_path(), instrument_call_rwt(), integer_expression_to_transformer(), interprocedural_abc_arrays(), intrinsic_call_to_type(), invariant_expression_p(), loop_flt(), loop_strip_mine(), make_bound_expression(), make_list_of_flags(), MakeDimension(), MemberIdentifierToExpression(), normalize_first_expressions_filter(), partial_eval_reference(), partial_redundancy_elimination_expression(), partial_redundancy_elimination_rwt(), pragma_omp_merge_expr(), print_alias_association(), print_alignment(), print_dimension(), print_distribution(), print_eformat(), print_expressions(), proper_to_summary_simple_effect(), ram_variable_add_aliases(), reduce_array_declaration_dimension(), reference_substitute(), remove_minmax(), rename_statement_declarations(), same_or_equivalence_argument_add_aliases(), set_entity_initial(), size_of_actual_array(), size_of_dummy_array(), size_of_unnormalized_dummy_array(), some_basic_of_any_expression(), split_update_call(), store_initial_value(), subscript_value(), subscript_value_stride(), substitute_and_create(), substitute_expression_in_expression(), substitute_ghost_variable_in_expression(), Tiling_buffer_allocation(), top_down_abc_array(), top_down_abc_call(), top_down_adn_call_flt(), transformer_add_condition_information_updown(), transformer_add_integer_relation_information(), translate_call_to_callee_frame(), translate_reference_to_callee_frame(), translate_to_callee_frame(), translate_to_module_frame(), trivial_expression_p(), verify_array_element(), verify_used_before_set_call(), verify_used_before_set_expression(), and yyparse().

01109 {
01110     normalized n;
01111 
01112     if(e==expression_undefined)
01113         (void) fprintf(stderr,"EXPRESSION UNDEFINED\n");
01114     else {
01115         (void) fprintf(stderr,"syntax = ");
01116         print_syntax(expression_syntax(e));
01117         (void) fprintf(stderr,"\nnormalized = ");
01118         if((n=expression_normalized(e))!=normalized_undefined)
01119             print_normalized(n);
01120         else
01121             (void) fprintf(stderr,"NORMALIZED UNDEFINED\n");
01122     }
01123 }

Here is the call graph for this function:

void print_expressions ( list  le  ) 
Parameters:
le e

Definition at line 1125 of file ri-util/expression.c.

References e, EXPRESSION, MAP, and print_expression().

Referenced by c_summary_to_proper_effects(), check_user_call_site(), generic_c_effects_backward_translation(), generic_c_effects_forward_translation(), MakeFunctionExpression(), reference_to_type(), top_down_adn_call_flt(), top_down_adn_caller_array(), top_down_adn_callers_arrays(), and verify_used_before_set_call().

01126 {
01127 
01128   MAP(EXPRESSION, e , {
01129     print_expression(e);
01130       },
01131     le);
01132 
01133 }

Here is the call graph for this function:

Here is the caller graph for this function:

void print_normalized ( normalized  n  ) 

should be replaced by a call to expression_fprint() if it's ever added to linear library

Definition at line 1179 of file ri-util/expression.c.

References fprintf(), normalized_complex_p, normalized_linear, and vect_debug().

Referenced by print_expression(), and trivial_expression_p().

01180 {
01181     if(normalized_complex_p(n))
01182         (void) fprintf(stderr,"COMPLEX\n");
01183     else
01184         /* should be replaced by a call to expression_fprint() if it's
01185            ever added to linear library */
01186         vect_debug((Pvecteur)normalized_linear(n));
01187 }

Here is the call graph for this function:

Here is the caller graph for this function:

void print_reference ( reference  r  ) 
void print_reference_list ( list  lr  ) 
Parameters:
lr r

Definition at line 1158 of file ri-util/expression.c.

References CAR, e, ENDP, entity_local_name(), fprintf(), MAPL, REFERENCE, and reference_variable.

Referenced by call_instruction_to_communications(), loop_nest_to_local_variables(), and print_references().

01159 {
01160     if(ENDP(lr))
01161         fputs("NIL", stderr);
01162     else
01163         MAPL(cr,
01164          {
01165              reference r = REFERENCE(CAR(cr));
01166              entity e = reference_variable(r);
01167              (void) fprintf(stderr,"%s, ", entity_local_name(e));
01168          },
01169              lr);
01170 
01171     (void) putc('\n', stderr);
01172 }

Here is the call graph for this function:

Here is the caller graph for this function:

void print_references ( list  rl  ) 
void print_syntax ( syntax  s  ) 

Definition at line 1148 of file ri-util/expression.c.

References NIL, print_words(), and words_syntax().

Referenced by print_expression(), print_syntax_expressions(), and subtitute_induction_statement_in().

01149 {
01150   print_words(stderr,words_syntax(s, NIL));
01151 }

Here is the call graph for this function:

Here is the caller graph for this function:

void print_syntax_expressions ( list  le  ) 
Parameters:
le e

Definition at line 1135 of file ri-util/expression.c.

References CDR, e, ENDP, EXPRESSION, expression_syntax, fprintf(), MAP, and print_syntax().

01136 {
01137 
01138   MAP(EXPRESSION, e , {
01139     print_syntax(expression_syntax(e));
01140     if(!ENDP(CDR(le))) {
01141         (void) fprintf(stderr, ", ");
01142     }
01143       },
01144     le);
01145 
01146 }

Here is the call graph for this function:

statement Pvecteur_to_assign_statement ( entity  var,
Pvecteur  v 
)

generates var = linear expression from the Pvecteur.

var is removed if necessary.

??? should manage an (positive remainder) integer divide ? Have a look to make_constraint_expression instead?

Parameters:
var ar

Definition at line 1477 of file ri-util/expression.c.

References assert, entity_to_expression(), make_assign_statement(), make_vecteur_expression(), value_abs, value_le, value_notzero_p, VALUE_ONE, value_one_p, vect_chg_sgn(), vect_coeff(), vect_dup(), vect_erase_var(), and vect_rm().

Referenced by generate_deducables(), and hpfc_compute_lid().

01479 {
01480   statement result;
01481   Pvecteur vcopy;
01482   Value coef;
01483 
01484   coef = vect_coeff((Variable) var, v);
01485   assert(value_le(value_abs(coef),VALUE_ONE));
01486 
01487   vcopy = vect_dup(v);
01488 
01489   if (value_notzero_p(coef)) vect_erase_var(&vcopy, (Variable) var);
01490   if (value_one_p(coef)) vect_chg_sgn(vcopy);
01491 
01492   result = make_assign_statement(entity_to_expression(var),
01493                                  make_vecteur_expression(vcopy));
01494   vect_rm(vcopy);
01495 
01496   return result;
01497 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression Pvecteur_to_expression ( Pvecteur  vect  ) 

AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.

================================================================expression Pvecteur_to_expression(Pvecteur vect): returns an expression equivalent to "vect".

A Pvecteur is a list of variables, each with an associated value. Only one term of the list may have an undefined variables, it is the constant term of the vector : (var1,val1) , (var2,val2) , (var3,val3) , ...

An equivalent expression is the addition of all the variables, each multiplied by its associated value : (...((val1*var1 + val2*var2) + val3*var3) +...)

Two special cases are treated in order to get a more simple expression : _ if the sign of the value associated to the variable is negative, the addition is replaced by a substraction and we change the sign of the value (e.g. 2*Y + (-3)*X == 2*Y - 3*X). This optimization is of course not done for the first variable. _ the values equal to one are eliminated (e.g. 1*X == X).

Note (IMPORTANT): if the vector is equal to zero, then it returns an "expression_undefined", not an expression equal to zero.rather use make_vecteur_expression which was already there

We get the entities corresponding to the three operations +, - and *.

Computation of the first variable of the vector.

Special case of the constant term.

We eliminate this value equal to one.

val == -1

Computation of the rest of the vector.

Special case of the constant term.

We eliminate this value equal to one.

Parameters:
vect ect

Definition at line 1602 of file ri-util/expression.c.

References debug(), entity_domain, expression_undefined, gen_find_tabulated(), make_entity_expression(), make_entity_fullname(), make_integer_constant_expression(), MakeBinaryCall(), MakeUnaryCall(), MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, NIL, PLUS_OPERATOR_NAME, term_cst, TOP_LEVEL_MODULE_NAME, UNARY_MINUS_OPERATOR_NAME, VALUE_TO_INT, and VECTEUR_NUL_P.

Referenced by analyze_expression(), build_first_comb(), build_third_comb(), free_guards(), fusion(), fusion_buffer(), Hierarchical_tiling(), include_trans_on_LC_in_ref(), make_lin_op_exp(), make_reindex(), new_array_declaration_from_region(), outliner_smart_references_computation(), prgm_mapping(), reconfig_expression(), simplify_dimension(), simplify_relational_expression(), Tiling2_buffer(), Tiling_buffer_allocation(), top_down_adn_callers_arrays(), translate_call_to_callee_frame(), translate_reference_to_callee_frame(), and translate_to_module_frame().

01603 {
01604   Pvecteur Vs;
01605   expression aux_exp, new_exp;
01606   entity plus_ent, mult_ent, minus_ent, unary_minus_ent, op_ent;
01607 
01608   new_exp = expression_undefined;
01609   Vs = vect;
01610 
01611   debug( 7, "Pvecteur_to_expression", "doing\n");
01612   if(!VECTEUR_NUL_P(Vs))
01613     {
01614       entity var = (entity) Vs->var;
01615       int val = VALUE_TO_INT(Vs->val);
01616 
01617       /* We get the entities corresponding to the three operations +, - and *. */
01618       plus_ent = gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01619                                                          PLUS_OPERATOR_NAME),
01620                                     entity_domain);
01621       minus_ent = gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01622                                                           MINUS_OPERATOR_NAME),
01623                                      entity_domain);
01624       mult_ent = gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01625                                                          MULTIPLY_OPERATOR_NAME),
01626                                     entity_domain);
01627       unary_minus_ent =
01628         gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
01629                                                 UNARY_MINUS_OPERATOR_NAME),
01630                            entity_domain);
01631 
01632       /* Computation of the first variable of the vector. */
01633       if(term_cst(Vs))
01634         /* Special case of the constant term. */
01635         new_exp = make_integer_constant_expression(val);
01636       else if( (val != 1) && (val != -1) )
01637         new_exp = MakeBinaryCall(mult_ent,
01638                                  make_integer_constant_expression(val),
01639                                  make_entity_expression(var, NIL));
01640       else if (val == 1)
01641         /* We eliminate this value equal to one. */
01642         new_exp = make_entity_expression(var, NIL);
01643       else /* val == -1 */
01644         new_exp = MakeUnaryCall(unary_minus_ent, make_entity_expression(var, NIL));
01645 
01646       /* Computation of the rest of the vector. */
01647       for(Vs = vect->succ; !VECTEUR_NUL_P(Vs); Vs = Vs->succ)
01648         {
01649           var = (entity) Vs->var;
01650           val = VALUE_TO_INT(Vs->val);
01651 
01652           if (val < 0)
01653             {
01654               op_ent = minus_ent;
01655               val = -val;
01656             }
01657           else
01658             op_ent = plus_ent;
01659 
01660           if(term_cst(Vs))
01661             /* Special case of the constant term. */
01662             aux_exp = make_integer_constant_expression(val);
01663           else if(val != 1)
01664             aux_exp = MakeBinaryCall(mult_ent,
01665                                      make_integer_constant_expression(val),
01666                                      make_entity_expression(var, NIL));
01667           else
01668             /* We eliminate this value equal to one. */
01669             aux_exp = make_entity_expression(var, NIL);
01670 
01671           new_exp = MakeBinaryCall(op_ent, new_exp, aux_exp);
01672         }
01673     }
01674   return(new_exp);
01675 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool range_equal_p ( range  r1,
range  r2 
)
Parameters:
r1 1
r2 2

Definition at line 1305 of file ri-util/expression.c.

References expression_equal_p(), range_increment, range_lower, and range_upper.

Referenced by free_guards(), and syntax_equal_p().

01306 {
01307   return expression_equal_p(range_lower(r1), range_lower(r2))
01308     && expression_equal_p(range_upper(r1), range_upper(r2))
01309     && expression_equal_p(range_increment(r1), range_increment(r2));
01310 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool reference_equal_p ( reference  r1,
reference  r2 
)
Parameters:
r1 1
r2 2

Definition at line 1279 of file ri-util/expression.c.

References CAR, ENDP, EXPRESSION, expression_equal_p(), FALSE, gen_length(), POP, reference_indices, reference_variable, and TRUE.

Referenced by adg_write_reference_list(), attach_ref_to_stat(), build_successors_with_rhs(), call_flt(), cell_equal_p(), check_for_conflict(), checkReplaceReference(), comEngine_replace_reference_in_stat_rwt(), compact_phi_functions(), count_dataflows_on_ref(), create_realFifo_proc(), da_process_list(), daExpressionReplaceReference(), dataflows_on_ref(), dataflows_on_reference(), do_reduction_propagation(), expression_verbose_reduction_p_and_return_increment(), find_or_create_fifo_from_ref(), fsr_reference_flt(), generate_fifo_stats(), generate_fifo_stats2(), generate_scalar_variables(), generate_scalar_variables_from_list(), get_fifoExp_from_ref(), get_HRE_buff_ent_from_ref(), get_indExp_from_ref(), in_effect_list_p(), merge_two_reductions(), perform_substitution_in_expression(), points_to_filter_with_effects(), process_ref_lists(), reduction_in_statement_walker(), ref_subs_in_exp(), reference_conflicting_p(), reference_conflicting_test_and_update(), reference_in_list_p(), reference_list_update(), reference_substitute(), rename_reduction_ref_walker(), same_reduction_p(), similarity(), stats_has_rw_conf_p(), and syntax_equal_p().

01280 {
01281   entity v1 = reference_variable(r1);
01282   entity v2 = reference_variable(r2);
01283 
01284   list dims1 = reference_indices(r1);
01285   list dims2 = reference_indices(r2);
01286 
01287   if(v1 != v2)
01288     return FALSE;
01289 
01290   if(gen_length(dims1) != gen_length(dims2))
01291     return FALSE;
01292   /*
01293     pips_internal_error("Different dimensions for %s: %d and %d\n",
01294     entity_local_name(v1), gen_length(dims1), gen_length(dims2));
01295   */
01296 
01297   for(; !ENDP(dims1); POP(dims1), POP(dims2))
01298     if(!expression_equal_p(EXPRESSION(CAR(dims1)), EXPRESSION(CAR(dims2))))
01299       return FALSE;
01300 
01301   return TRUE;
01302 }

Here is the call graph for this function:

Here is the caller graph for this function:

boolean reference_scalar_p ( reference  r  ) 

This function returns TRUE if Reference r is scalar.

Definition at line 3028 of file ri-util/expression.c.

References assert, entity_scalar_p(), NIL, NULL, reference_indices, reference_undefined_p, reference_variable, and v.

Referenced by call_instruction_to_communications(), do_reduction_propagation(), loop_nest_movement_generation(), loop_nest_to_wp65_code(), partial_eval_update_operators(), references_must_conflict_p(), single_assign_statement(), and written_before_read_p().

03029 {
03030   entity v = reference_variable(r);
03031   assert(!reference_undefined_p(r) && r!=NULL && v!=NULL);
03032   return (reference_indices(r) == NIL &&  entity_scalar_p(v));
03033 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression reference_to_expression ( reference  r  ) 

Definition at line 200 of file ri-util/expression.c.

References e, is_syntax_reference, make_expression(), make_syntax(), normalize_reference(), and s.

Referenced by alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_variable_in_caller_flt(), bound_to_statement(), build_call_STEP_AlltoAllRegion(), build_call_STEP_MastertoAllRegion(), build_new_loop_bounds(), define_node_processor_id(), do_group_constants_terapix(), do_reduction_propagation(), effects_to_dma(), entity_to_expr(), entity_to_expression(), expression_array_to_pointer(), freeze_variables_in_statement(), generate_c1_alpha(), generate_compact(), generate_copy_loop_nest(), generate_full_copy(), generate_get_value_locally(), generate_mmcd_stat_from_ref(), generate_parallel_body(), generate_prelude(), generate_remapping_guard(), generate_update_values_on_computer_and_nodes(), hpfc_buffer_reference(), hpfc_generate_message(), initialize_array_variable(), live_mapping_expression(), loop_annotate(), loop_scalarization(), make_abc_count_statement(), make_check_io_statement(), make_lInitStats(), make_list_of_flags(), make_loadsave_statement(), make_lSwitchStats(), make_mypos_expression(), make_phi_assign_instruction(), make_reference_expression(), MakeArrayExpression(), outliner_smart_references_computation(), process_true_call_stat(), reduction_variable_expansion(), region_reference_to_expression(), replace_array_ref_with_fifos(), replace_array_ref_with_fifos2(), set_array_status_to_target(), split_complex_expression(), st_call_send_or_receive(), st_compute_current_computer(), st_compute_current_owners(), st_compute_ith_local_index(), step_build_arrayRegion(), Tiling_buffer_allocation(), translate_reference_to_callee_frame(), translate_to_module_frame(), and verify_array_variable().

00201 {
00202   expression e;
00203   syntax s = make_syntax(is_syntax_reference, r);
00204 
00205   e = make_expression(s, normalize_reference(r));
00206 
00207   return e;
00208 }

Here is the call graph for this function:

bool reference_with_constant_indices_p ( reference  r  ) 

Definition at line 2650 of file ri-util/expression.c.

References constant_p(), EXPRESSION, extended_integer_constant_expression_p(), FALSE, MAP, reference_indices, and TRUE.

Referenced by store_independent_effect_p(), store_independent_reference_p(), and translate_effect_to_sdfi_effect().

02651 {
02652   list sel = reference_indices(r);
02653   bool constant_p = TRUE;
02654 
02655   MAP(EXPRESSION, se, {
02656       if(!extended_integer_constant_expression_p(se)) {
02657         constant_p = FALSE;
02658         break;
02659       }
02660     }, sel);
02661   return constant_p;
02662 }

Here is the call graph for this function:

Here is the caller graph for this function:

reference reference_with_store_independent_indices ( reference  r  ) 

Return by side effect a reference whose memory locations includes the memory locations of r in case the subcript expressions are changed by a store change.

Constant subscript expressions are preserved.

Store varying subscript expressions are replaced by unbounded expressions.

Definition at line 2672 of file ri-util/expression.c.

References CAR, ENDP, EXPRESSION, EXPRESSION_, extended_integer_constant_expression_p(), free_expression(), list_undefined, make_unbounded_expression(), POP, and reference_indices.

Referenced by effect_to_non_pointer_store_independent_effect().

02673 {
02674   list sel = reference_indices(r);
02675   list sec = list_undefined;
02676 
02677   for(sec = sel; !ENDP(sec); POP(sec)) {
02678     expression se = EXPRESSION(CAR(sec));
02679 
02680     if(!extended_integer_constant_expression_p(se)) {
02681       free_expression(se);
02682       EXPRESSION_(CAR(sec)) = make_unbounded_expression();
02683     }
02684   }
02685 
02686   return r;
02687 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool reference_with_unbounded_indices_p ( reference  r  ) 

indices can be constant or unbounded: they are store independent.

Definition at line 2690 of file ri-util/expression.c.

References EXPRESSION, extended_integer_constant_expression_p(), FALSE, MAP, reference_indices, TRUE, and unbounded_expression_p().

Referenced by translate_effect_to_sdfi_effect().

02691 {
02692   list sel = reference_indices(r);
02693   bool unbounded_p = TRUE;
02694 
02695   MAP(EXPRESSION, se, {
02696       if(!extended_integer_constant_expression_p(se)
02697          && !unbounded_expression_p(se)) {
02698         unbounded_p = FALSE;
02699         break;
02700       }
02701     }, sel);
02702   return unbounded_p;
02703 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool references_do_not_conflict_p ( reference  r1,
reference  r2 
)

If TRUE is returned, the two references cannot conflict unless array bound declarations are violated.

If FALSE is returned, the two references may conflict.

TRUE is returned if the two references are array references and if the two references entities are equal and if at least one dimension can be used to desambiguate the two references using constant subscript expressions. This test is store independent and certainly does not replace a dependence test. It may beused to compute ude-def chains.

If needed, an extra effort could be made for aliased arrays.

FI: OK, it would be better to use their normalized forms

Parameters:
r1 1
r2 2

Definition at line 1713 of file ri-util/expression.c.

References CAR, ENDP, EXPRESSION, expression_constant_p(), expression_to_int(), FALSE, gen_length(), POP, reference_indices, reference_variable, and s1.

01714 {
01715   bool do_not_conflict = FALSE;
01716   entity v1 = reference_variable(r1);
01717   entity v2 = reference_variable(r2);
01718 
01719   if(v1==v2) {
01720     list s1 = reference_indices(r1);
01721     list s2 = reference_indices(r2);
01722     if(!ENDP(s1) && gen_length(s1)==gen_length(s2)) {
01723       list cs1, cs2;
01724       for(cs1=s1, cs2=s2; !ENDP(cs1) && !do_not_conflict; POP(cs1), POP(cs2)) {
01725         expression sub1 = EXPRESSION(CAR(cs1));
01726         expression sub2 = EXPRESSION(CAR(cs2));
01727         if(expression_constant_p(sub1) && expression_constant_p(sub2)) {
01728           /* FI: OK, it would be better to use their normalized forms */
01729           do_not_conflict = (expression_to_int(sub1)!=expression_to_int(sub2));
01730         }
01731       }
01732     }
01733   }
01734 
01735   return do_not_conflict;
01736 }

Here is the call graph for this function:

bool relational_expression_p ( expression  e  ) 

A relational expression is a call whose function is either one of the following : .LT.,.LE.,.EQ.,.NE.,.GT.,.GE.

Definition at line 404 of file ri-util/expression.c.

References call_function, ENTITY_RELATIONAL_OPERATOR_P, expression_call_p(), expression_syntax, FALSE, syntax_call, and TRUE.

Referenced by logical_expression_p(), MakeInvertExpression(), partial_redundancy_elimination_expression(), simplify_relational_expression(), and trivial_expression_p().

00405 {
00406   /* A relational expression is a call whose function is either one of the following :
00407    * .LT.,.LE.,.EQ.,.NE.,.GT.,.GE. */
00408   if (expression_call_p(e))
00409     {
00410       entity op = call_function(syntax_call(expression_syntax(e)));
00411       if (ENTITY_RELATIONAL_OPERATOR_P(op))
00412         return TRUE;
00413       return FALSE;
00414     }
00415   return FALSE;
00416 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_call_name_p ( call  c1,
call  c2 
)
Parameters:
c1 1
c2 2

Definition at line 2224 of file ri-util/expression.c.

References call_arguments, call_function, same_entity_lname_p(), and same_lexpr_name_p().

Referenced by same_syntax_name_p().

02225 {
02226   return same_entity_lname_p(call_function(c1), call_function(c2)) &&
02227     same_lexpr_name_p(call_arguments(c1), call_arguments(c2));
02228 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_entity_lname_p ( entity  e1,
entity  e2 
)
Parameters:
e1 1
e2 2

Definition at line 2219 of file ri-util/expression.c.

References entity_local_name(), and same_string_p.

Referenced by find_union_regions(), inline_should_inline(), same_call_name_p(), same_ref_name_p(), simd_replace_parameters(), and UseFormalArguments().

02220 {
02221   return same_string_p(entity_local_name(e1), entity_local_name(e2));
02222 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_expression_in_list_p ( expression  e,
list  le 
)

This function returns TRUE, if there exists a same expression in the list FALSE, otherwise.

Parameters:
le e

Definition at line 375 of file ri-util/expression.c.

References EXPRESSION, f, FALSE, MAP, same_expression_p(), and TRUE.

Referenced by add_array_dimension_bound_test(), add_array_test(), expression_in_array_subscript(), my_list_intersection(), top_down_abc_array(), and top_down_abc_call().

00376 {
00377   MAP(EXPRESSION, f, if (same_expression_p(e,f)) return TRUE, le);
00378   return FALSE;
00379 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_expression_name_p ( expression  e1,
expression  e2 
)

compare two entities for their appearance point of view.

used for putting common in includes.

Parameters:
e1 1
e2 2

Definition at line 2280 of file ri-util/expression.c.

References expression_syntax, and same_syntax_name_p().

Referenced by dimension_equal_p(), same_lexpr_name_p(), same_range_name_p(), and same_sizeofexpression_name_p().

02281 {
02282   return same_syntax_name_p(expression_syntax(e1), expression_syntax(e2));
02283 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_expression_p ( expression  e1,
expression  e2 
)

lazy normalization.

Parameters:
e1 1
e2 2

Definition at line 1207 of file ri-util/expression.c.

References expression_equal_p(), expression_normalized, normalize_all_expressions_of(), normalized_linear, normalized_linear_p, normalized_undefined_p, and vect_equal().

Referenced by alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_and_scalar_variable_in_module_flt(), alias_check_array_variable_in_caller_flt(), alias_check_array_variable_in_module_flt(), alias_check_scalar_and_array_variables_in_caller(), alias_check_scalar_and_array_variables_in_module(), bottom_up_abc_expression_implied_do(), check_loop_distribution_feasability(), compact_phi_functions(), dimension_equal_p(), distance_between_expression(), effects_reference_indices_may_equal_p(), expression_equal_in_context_p(), expression_in_array_subscript(), full_define_p(), interprocedural_abc_arrays(), make_loadsave_statement(), outliner_smart_references_computation(), same_dimension_p(), same_expression_in_list_p(), simd_do_atomize(), size_of_actual_array(), subscript_value(), subscript_value_stride(), and substitute_expression_walker().

01208 {
01209   normalized n1, n2;
01210 
01211   n1 = expression_normalized(e1);
01212   n2 = expression_normalized(e2);
01213 
01214   /* lazy normalization.
01215    */
01216   if (normalized_undefined_p(n1)) {
01217     normalize_all_expressions_of(e1);
01218     n1 = expression_normalized(e1);
01219   }
01220 
01221   if (normalized_undefined_p(n2)) {
01222     normalize_all_expressions_of(e2);
01223     n2 = expression_normalized(e2);
01224   }
01225 
01226   if (normalized_linear_p(n1) && normalized_linear_p(n2))
01227     return vect_equal(normalized_linear(n1), normalized_linear(n2));
01228   else
01229     return expression_equal_p(e1, e2);
01230 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_lexpr_name_p ( list  l1,
list  l2 
)

else

Parameters:
l1 1
l2 2

Definition at line 2208 of file ri-util/expression.c.

References CAR, EXPRESSION, FALSE, gen_length(), POP, same_expression_name_p(), and TRUE.

Referenced by same_call_name_p(), and same_ref_name_p().

02209 {
02210   if (gen_length(l1)!=gen_length(l2))
02211     return FALSE;
02212   /* else */
02213   for(; l1 && l2; POP(l1), POP(l2))
02214     if (!same_expression_name_p(EXPRESSION(CAR(l1)), EXPRESSION(CAR(l2))))
02215       return FALSE;
02216   return TRUE;
02217 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_range_name_p ( range  r1,
range  r2 
)
Parameters:
r1 1
r2 2

Definition at line 2236 of file ri-util/expression.c.

References range_increment, range_lower, range_upper, and same_expression_name_p().

Referenced by same_syntax_name_p().

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_ref_name_p ( reference  r1,
reference  r2 
)
Parameters:
r1 1
r2 2

Definition at line 2230 of file ri-util/expression.c.

References reference_indices, reference_variable, same_entity_lname_p(), and same_lexpr_name_p().

Referenced by same_syntax_name_p().

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_sizeofexpression_name_p ( sizeofexpression  s0,
sizeofexpression  s1 
)
Parameters:
s0 0
s1 1

Definition at line 2250 of file ri-util/expression.c.

References same_expression_name_p(), same_type_name_p(), sizeofexpression_expression, sizeofexpression_expression_p, sizeofexpression_type, and sizeofexpression_type_p.

Referenced by same_syntax_name_p().

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_syntax_name_p ( syntax  s1,
syntax  s2 
)

else

Parameters:
s1 1
s2 2

Definition at line 2259 of file ri-util/expression.c.

References FALSE, is_syntax_call, is_syntax_range, is_syntax_reference, is_syntax_sizeofexpression, pips_internal_error, same_call_name_p(), same_range_name_p(), same_ref_name_p(), same_sizeofexpression_name_p(), syntax_call, syntax_range, syntax_reference, syntax_sizeofexpression, and syntax_tag.

Referenced by same_expression_name_p().

02260 {
02261   if (syntax_tag(s1)!=syntax_tag(s2))
02262     return FALSE;
02263   /* else */
02264   switch (syntax_tag(s1))
02265     {
02266     case is_syntax_call:
02267       return same_call_name_p(syntax_call(s1), syntax_call(s2));
02268     case is_syntax_reference:
02269       return same_ref_name_p(syntax_reference(s1), syntax_reference(s2));
02270     case is_syntax_range:
02271       return same_range_name_p(syntax_range(s1), syntax_range(s2));
02272     case is_syntax_sizeofexpression:
02273       return same_sizeofexpression_name_p(syntax_sizeofexpression(s1),syntax_sizeofexpression(s2));
02274     default:
02275       pips_internal_error("unexpected syntax tag\n");
02276     }
02277   return FALSE;
02278 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool same_type_name_p ( type  t0,
type  t1 
)
Parameters:
t0 0
t1 1

Definition at line 2242 of file ri-util/expression.c.

References s1, same_string_p, and type_to_string().

Referenced by same_sizeofexpression_name_p().

02243 {
02244     string s0 = type_to_string(t0),
02245            s1 = type_to_string(t1);
02246     bool same = same_string_p(s0,s1);
02247     return same;
02248 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool signed_integer_constant_expression_p ( expression  e  ) 

Definition at line 730 of file ri-util/expression.c.

References binary_call_lhs, call_function, entity_domain, expression_syntax, FALSE, gen_find_tabulated(), integer_constant_expression_p(), make_entity_fullname(), s, syntax_call, syntax_call_p, TOP_LEVEL_MODULE_NAME, TRUE, and UNARY_MINUS_OPERATOR_NAME.

Referenced by integer_power_to_transformer(), and signed_integer_constant_expression_value().

00731 {
00732   if(!integer_constant_expression_p(e)) {
00733     syntax s = expression_syntax(e);
00734 
00735     if(syntax_call_p(s)) {
00736         call c = syntax_call(s);
00737         entity um = call_function(c);
00738 
00739         if(um == gen_find_tabulated(make_entity_fullname(TOP_LEVEL_MODULE_NAME,
00740                                                          UNARY_MINUS_OPERATOR_NAME),
00741                                     entity_domain)) {
00742           expression e2 = binary_call_lhs(c);
00743 
00744           return integer_constant_expression_p(e2);
00745         }
00746     }
00747     return FALSE;
00748   }
00749   else {
00750     return TRUE;
00751   }
00752 }

Here is the call graph for this function:

Here is the caller graph for this function:

int signed_integer_constant_expression_value ( expression  e  ) 

could be coded by geting directly the value of the constant entity...

also available as integer_constant_p() which has *two* arguments

Definition at line 1355 of file ri-util/expression.c.

References n, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, normalized_undefined, pips_assert, pips_internal_error, signed_integer_constant_expression_p(), TCST, v, VALUE_TO_INT, vect_coeff(), vect_constant_p(), and x.

Referenced by integer_constant_expression_value(), and integer_power_to_transformer().

01356 {
01357   /* could be coded by geting directly the value of the constant entity... */
01358   /* also available as integer_constant_p() which has *two* arguments */
01359 
01360   normalized n = normalized_undefined;
01361   int val = 0;
01362 
01363   pips_assert("is signed constant", signed_integer_constant_expression_p(e));
01364 
01365   n = NORMALIZE_EXPRESSION(e);
01366   if(normalized_linear_p(n)) {
01367     Pvecteur v = (Pvecteur) normalized_linear(n);
01368 
01369     if(vect_constant_p(v)) {
01370       Value x = vect_coeff(TCST, v);
01371       val = VALUE_TO_INT(x);
01372     }
01373     else
01374       pips_internal_error("non constant expression\n");
01375   }
01376   else
01377     pips_internal_error("non affine expression\n");
01378 
01379   return val;
01380 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool simplify_C_expression ( expression  e  ) 

Replace C operators "+C" and "-C" which can handle pointers by arithmetic operators "+" and "-" when it is safe to do so, i.e.

when no pointer arithmetic is involved.

FI: Also, it might be useful to normalize the expression in order not to leave an undefined field in it. But this is a recursive function and probably not the right place to cope with this.

FI: see C_syntax/block_scope12.c. The source code line number where the problem occurs cannot be given because we are not in the c_syntax library.

FI: What if not? core dump?

The variable type can hide a functional type via a typedef

Might be wrong, but necessary

Should not occur in old C code

Should not occur in old C code

FI: The index expressions should be simplified too...

What is the type of the constant?

Should not occur in C, before C99

Check "+C" and "-C"

Try to simplify the arguments, do not hope much from the result type because of overloading.

a void expression such as (void) 0 results in an undefined basic.

FI: I guess, typedef equivalent to those could also be declared substituable

Should not occur in C

e must be a void expression, i.e. an expression returning no value

for gcc

Definition at line 2474 of file ri-util/expression.c.

References basic_complex_p, basic_float_p, basic_int_p, basic_logical_p, basic_of_expression(), basic_overloaded_p, basic_undefined, basic_undefined_p, binary_call_lhs, binary_call_rhs, bool_to_string(), call_arguments, call_function, call_to_functional_type(), copy_basic(), entity_intrinsic(), entity_local_name(), ENTITY_MINUS_C_P, ENTITY_PLUS_C_P, entity_type, entity_user_name(), EXPRESSION, expression_constant_p(), expression_syntax, FALSE, free_basic(), functional_result, gen_length(), 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, MAP, MINUS_OPERATOR_NAME, pips_debug, pips_internal_error, pips_user_warning, PLUS_OPERATOR_NAME, range_increment, range_lower, range_upper, reference_variable, rt, s, simplify_C_expression(), syntax_call, syntax_range, syntax_reference, syntax_tag, TRUE, type_functional, type_undefined_p, type_variable, type_variable_p, ultimate_type(), and variable_basic.

Referenced by c_parse(), simplify_C_expression(), and yyparse().

02475 {
02476   syntax s = expression_syntax(e);
02477   bool can_be_substituted_p = FALSE;
02478 
02479   pips_debug(9, "Begin\n");
02480 
02481   switch(syntax_tag(s)) {
02482   case is_syntax_reference:
02483     {
02484       entity re = reference_variable(syntax_reference(s));
02485       type rt = entity_type(re);
02486 
02487       if(type_undefined_p(rt)) {
02488         /* FI: see C_syntax/block_scope12.c. The source code line
02489            number where the problem occurs cannot be given because we
02490            are not in the c_syntax library. */
02491         pips_user_warning("Variable \"%s\" is probably used before it is defined\n",
02492                           entity_user_name(re));
02493         can_be_substituted_p = FALSE;
02494       }
02495       else {
02496         basic bt = basic_undefined;
02497 
02498         if(type_variable_p(rt)) { /* FI: What if not? core dump? */
02499           /* The variable type can hide a functional type via a
02500              typedef */
02501           type urt = ultimate_type(rt);
02502           if(type_variable_p(urt)) {
02503             bt = variable_basic(type_variable(urt));
02504 
02505             can_be_substituted_p =
02506               basic_int_p(bt)
02507               || basic_float_p(bt)
02508               || basic_overloaded_p(bt) /* Might be wrong, but necessary */
02509               || basic_complex_p(bt) /* Should not occur in old C code */
02510               || basic_logical_p(bt); /* Should not occur in old C code */
02511 
02512             pips_debug(9, "Variable %s is an arithmetic variable: %s\n",
02513                        entity_local_name(re), bool_to_string(can_be_substituted_p));
02514           }
02515         }
02516       }
02517       break; /* FI: The index expressions should be simplified too... */
02518     }
02519   case is_syntax_call:
02520     {
02521       call c = syntax_call(s);
02522 
02523       if(expression_constant_p(e)) {
02524         /* What is the type of the constant? */
02525         entity cste = call_function(c);
02526         basic rb = variable_basic(type_variable(functional_result(type_functional(entity_type(cste)))));
02527 
02528         can_be_substituted_p =
02529           basic_int_p(rb)
02530           || basic_float_p(rb)
02531           || basic_complex_p(rb); /* Should not occur in C, before C99 */
02532       }
02533       else if(gen_length(call_arguments(c))==2) {
02534         /* Check "+C" and "-C" */
02535         expression e1 = binary_call_lhs(c);
02536         expression e2 = binary_call_rhs(c);
02537         bool can_be_substituted_p1 = simplify_C_expression(e1);
02538         bool can_be_substituted_p2 = simplify_C_expression(e2);
02539         can_be_substituted_p = can_be_substituted_p1 && can_be_substituted_p2;
02540         if(can_be_substituted_p) {
02541           entity op = call_function(c);
02542           if(ENTITY_PLUS_C_P(op)) {
02543             call_function(c) = entity_intrinsic(PLUS_OPERATOR_NAME);
02544           }
02545           else if(ENTITY_MINUS_C_P(op)) {
02546             call_function(c) = entity_intrinsic(MINUS_OPERATOR_NAME);
02547           }
02548         }
02549       }
02550       else {
02551         /* Try to simplify the arguments, do not hope much from the result
02552            type because of overloading. */
02553         type ft = call_to_functional_type(c, TRUE);
02554         type rt = ultimate_type(functional_result(type_functional(ft)));
02555 
02556         //pips_assert("The function type is functional", type_functional_p(entity_type(f)));
02557 
02558         MAP(EXPRESSION, se, {
02559             (void) simplify_C_expression(se);
02560           }, call_arguments(c));
02561 
02562         if(type_variable_p(rt)) {
02563           basic rb = variable_basic(type_variable(rt));
02564 
02565           if(basic_overloaded_p(rb)) {
02566             /* a void expression such as (void) 0 results in an undefined basic. */
02567             rb = basic_of_expression(e);
02568           }
02569           else
02570             rb = copy_basic(rb);
02571 
02572           if(!basic_undefined_p(rb)) {
02573             /* FI: I guess, typedef equivalent to those could also be declared substituable */
02574             can_be_substituted_p =
02575               basic_int_p(rb)
02576               || basic_float_p(rb)
02577               || basic_complex_p(rb); /* Should not occur in C */
02578             free_basic(rb);
02579           }
02580           else {
02581             /* e must be a void expression, i.e. an expression returning no value */
02582             can_be_substituted_p = FALSE;
02583           }
02584         }
02585         else {
02586           can_be_substituted_p = FALSE;
02587         }
02588       }
02589       break;
02590     }
02591   case is_syntax_range:
02592     {
02593       range r = syntax_range(s);
02594       expression le = range_lower(r);
02595       expression ue = range_upper(r);
02596       expression ince = range_increment(r);
02597       (void) simplify_C_expression(le);
02598       (void) simplify_C_expression(ue);
02599       (void) simplify_C_expression(ince);
02600       can_be_substituted_p = FALSE;
02601       break;
02602       }
02603   case is_syntax_cast:
02604   case is_syntax_sizeofexpression:
02605   case is_syntax_subscript:
02606   case is_syntax_application:
02607   case is_syntax_va_arg:
02608       can_be_substituted_p = FALSE;
02609       break;
02610   default: pips_internal_error("Bad syntax tag");
02611     can_be_substituted_p = FALSE; /* for gcc */
02612   }
02613 
02614   pips_debug(9, "End: %s\n", bool_to_string(can_be_substituted_p));
02615   return can_be_substituted_p;
02616 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool sizeofexpression_equal_p ( sizeofexpression  s0,
sizeofexpression  s1 
)
Parameters:
s0 0
s1 1

Definition at line 1231 of file ri-util/expression.c.

References expression_equal_p(), sizeofexpression_expression, sizeofexpression_expression_p, sizeofexpression_type, sizeofexpression_type_p, and type_equal_p().

Referenced by syntax_equal_p().

Here is the call graph for this function:

Here is the caller graph for this function:

bool store_independent_reference_p ( reference  r  ) 

Does this reference define the same set of memory locations regardless of the current (environment and) memory state?

Definition at line 2708 of file ri-util/expression.c.

References entity_type, FALSE, pointer_type_p(), reference_variable, reference_with_constant_indices_p(), t, TRUE, ultimate_type(), and v.

02709 {
02710   bool independent_p = TRUE;
02711   //list ind = reference_indices(r);
02712   entity v = reference_variable(r);
02713   type t = ultimate_type(entity_type(v));
02714 
02715   if(pointer_type_p(t)) {
02716     independent_p = FALSE;
02717   }
02718   else {
02719     independent_p = reference_with_constant_indices_p(r);
02720   }
02721 
02722   return independent_p;
02723 }

Here is the call graph for this function:

entity string_to_entity ( const char *  s,
entity  module 
)

very simple conversion from string to expression only handles entities and numeric values at the time being

try float conversion

first find all relevent entities

this an heuristic to find the one with a suiting scope error prone

try at the compilation unit level

try at top level

Parameters:
module odule

Definition at line 3072 of file ri-util/expression.c.

References compilation_unit_of_module(), e, ENTITY, entity_declarations, entity_name, entity_undefined, entity_undefined_p, entity_user_name(), f, FindEntity(), float_to_entity(), FOREACH, int_to_entity(), module_local_name(), module_name(), same_string_p, and TOP_LEVEL_MODULE_NAME.

Referenced by do_solve_hardware_constraints(), and string_to_expression().

03073 {
03074     /* try float conversion */
03075     string endptr,module_name=module_local_name(module);
03076     long int l = strtol(s,&endptr,10);
03077     if(!*endptr) return int_to_entity(l);
03078     float f = strtof(s,&endptr);
03079     if(!*endptr) return float_to_entity(f);
03080 
03081     entity candidate = entity_undefined;
03082     /* first find all relevent entities */
03083     FOREACH(ENTITY,e,entity_declarations(module))
03084     {
03085         /* this an heuristic to find the one with a suiting scope
03086          * error prone*/
03087         if(same_string_p(entity_user_name(e),s) )
03088             if(entity_undefined_p(candidate) ||
03089                     strlen(entity_name(candidate)) > strlen(entity_name(e)))
03090                 candidate=e;
03091     }
03092     /* try at the compilation unit level */
03093     if(entity_undefined_p(candidate))
03094         candidate=FindEntity(compilation_unit_of_module(module_name),s);
03095     /* try at top level */
03096     if(entity_undefined_p(candidate))
03097         candidate=FindEntity(TOP_LEVEL_MODULE_NAME,s);
03098     return entity_undefined_p(candidate)?
03099         entity_undefined:
03100         candidate;
03101 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression string_to_expression ( const char *  s,
entity  module 
)
Parameters:
module odule

Definition at line 3102 of file ri-util/expression.c.

References e, entity_to_expression(), entity_undefined_p, expression_undefined, and string_to_entity().

Referenced by do_symbolic_tiling(), loop_expansion(), and loop_expansion_init().

03103 {
03104     entity e = string_to_entity(s,module);
03105     return entity_undefined_p(e)?expression_undefined:entity_to_expression(e);
03106 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool sub_expression_p ( expression  e  ) 

Definition at line 789 of file ri-util/expression.c.

References MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, and operator_expression_p().

Referenced by incrementation_expression_to_increment().

00789                                     {
00790   return operator_expression_p(e, MINUS_OPERATOR_NAME)
00791     || operator_expression_p(e, MINUS_C_OPERATOR_NAME)
00792     ;
00793 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression substitute_entity_in_expression ( entity  old,
entity  new,
expression  e 
)

This function replaces all the occurences of an old entity in the expression exp by the new entity.

It returns the expression modified. I think we can write this function by using gen_context_multi_recurse ... * To do .... NN

Parameters:
old ld
new ew

Definition at line 2391 of file ri-util/expression.c.

References call_arguments, call_function, CAR, CDR, CONS, copy_expression(), ENDP, exp, EXPRESSION, expression_syntax, gen_nconc(), is_syntax_call, is_syntax_range, is_syntax_reference, NIL, range_increment, range_lower, range_upper, reference_indices, reference_variable, s, same_entity_p(), substitute_entity_in_expression(), syntax_call, syntax_range, syntax_reference, syntax_tag, t, and tag.

Referenced by substitute_entity_in_call_arguments(), substitute_entity_in_expression(), and try_to_recover_for_loop_in_a_while().

02392 {
02393   syntax s;
02394   tag t;
02395   call c;
02396   range ra;
02397   reference re;
02398   list args,tempargs= NIL;
02399   expression retour = copy_expression(e), exp,temp,low,up,inc;
02400 
02401   s = expression_syntax(e);
02402   t = syntax_tag(s);
02403   switch (t){
02404   case is_syntax_call:
02405     {
02406       c = syntax_call(s);
02407       args = call_arguments(c);
02408       while (!ENDP(args))
02409         {
02410           exp = EXPRESSION(CAR(args));
02411           temp = substitute_entity_in_expression(old,new,exp);
02412           tempargs = gen_nconc(tempargs,CONS(EXPRESSION,temp,NIL));
02413           args = CDR(args);
02414         }
02415 
02416       call_arguments(syntax_call(expression_syntax(retour))) = tempargs;
02417 
02418       if (same_entity_p(call_function(c),old))
02419         call_function(syntax_call(expression_syntax(retour))) = new;
02420       else
02421         call_function(syntax_call(expression_syntax(retour))) = call_function(c);
02422 
02423       break;
02424     }
02425   case is_syntax_reference:
02426     {
02427       re = syntax_reference(s);
02428       args = reference_indices(re);
02429       while (!ENDP(args))
02430         {
02431           exp = EXPRESSION(CAR(args));
02432           temp = substitute_entity_in_expression(old,new,exp);
02433           tempargs = gen_nconc(tempargs,CONS(EXPRESSION,temp,NIL));
02434           args = CDR(args);
02435         }
02436 
02437       reference_indices(syntax_reference(expression_syntax(retour))) = tempargs;
02438 
02439       if (same_entity_p(reference_variable(re),old))
02440         reference_variable(syntax_reference(expression_syntax(retour))) = new;
02441       else
02442         reference_variable(syntax_reference(expression_syntax(retour))) = reference_variable(re);
02443 
02444       break;
02445     }
02446   case is_syntax_range:
02447     {
02448       ra = syntax_range(s);
02449       low = range_lower(ra);
02450       range_lower(syntax_range(expression_syntax(retour))) = substitute_entity_in_expression(old,new,low);
02451 
02452       up = range_upper(ra);
02453       range_upper(syntax_range(expression_syntax(retour))) = substitute_entity_in_expression(old,new,up);
02454 
02455 
02456       inc = range_increment(ra);
02457       range_increment(syntax_range(expression_syntax(retour))) = substitute_entity_in_expression(old,new,inc);
02458 
02459       break;
02460     }
02461   }
02462 
02463   return retour;
02464 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool substraction_expression_p ( expression  e  ) 

Test if an expression is an substraction.

Definition at line 798 of file ri-util/expression.c.

References MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, and operator_expression_p().

Here is the call graph for this function:

tag suggest_basic_for_expression ( expression  e  ) 

a BASIC tag is returned for the expression this is a preliminary version.

should be improved. was in HPFC.

must be a call

else some clever analysis could be done

Definition at line 134 of file ri-util/expression.c.

References assert, basic_tag, call_function, ENTITY_RELATIONAL_OPERATOR_P, expression_basic(), expression_syntax, is_basic_int, is_basic_logical, is_basic_overloaded, pips_user_warning, s, syntax_call, syntax_call_p, and tag.

00135 {
00136   tag   result = basic_tag(expression_basic(e));
00137 
00138   if (result==is_basic_overloaded)
00139     {
00140       syntax s = expression_syntax(e);
00141 
00142       /*  must be a call
00143        */
00144       assert(syntax_call_p(s));
00145 
00146       if (ENTITY_RELATIONAL_OPERATOR_P(call_function(syntax_call(s))))
00147         result = is_basic_logical;
00148       else
00149         {
00150           /* else some clever analysis could be done
00151            */
00152           pips_user_warning("an overloaded is turned into an int...\n");
00153           result = is_basic_int;
00154         }
00155     }
00156 
00157   return result;
00158 }

Here is the call graph for this function:

bool syntax_equal_p ( syntax  s1,
syntax  s2 
)
Parameters:
s1 1
s2 2

Definition at line 1247 of file ri-util/expression.c.

References call_equal_p(), cast_equal_p(), FALSE, 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, pips_internal_error, range_equal_p(), reference_equal_p(), sizeofexpression_equal_p(), syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_tag, and tag.

Referenced by _expression_similar_p(), and expression_equal_p().

01248 {
01249   tag t1 = syntax_tag(s1);
01250   tag t2 = syntax_tag(s2);
01251 
01252   if(t1!=t2)
01253     return FALSE;
01254 
01255   switch(t1) {
01256   case is_syntax_reference:
01257     return reference_equal_p(syntax_reference(s1), syntax_reference(s2));
01258   case is_syntax_range:
01259     return range_equal_p(syntax_range(s1), syntax_range(s2));
01260   case is_syntax_call:
01261     return call_equal_p(syntax_call(s1), syntax_call(s2));
01262   case is_syntax_cast:
01263     return cast_equal_p(syntax_cast(s1), syntax_cast(s2));
01264   case is_syntax_sizeofexpression:
01265     return sizeofexpression_equal_p(syntax_sizeofexpression(s1),syntax_sizeofexpression(s2));
01266 
01267   case is_syntax_subscript:
01268   case is_syntax_application:
01269   case is_syntax_va_arg:
01270   default:
01271     return FALSE;
01272     break;
01273   }
01274 
01275   pips_internal_error("illegal. syntax tag %d\n", t1);
01276   return FALSE;
01277 }

Here is the call graph for this function:

Here is the caller graph for this function:

list syntax_to_reference_list ( syntax  s,
list  lr 
)
Parameters:
lr r

Definition at line 1028 of file ri-util/expression.c.

References application_arguments, application_function, call_arguments, CAR, cast_expression, CONS, e, EXPRESSION, expression_to_reference_list(), f, FOREACH, gen_nconc(), i, 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, MAPL, NIL, pips_error(), range_increment, range_lower, range_upper, REFERENCE, reference_indices, SIZEOFEXPRESSION, sizeofexpression_expression, sizeofexpression_expression_p, 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 expression_to_reference_list().

01029 {
01030     switch(syntax_tag(s)) {
01031     case is_syntax_reference:
01032         lr = gen_nconc(lr, CONS(REFERENCE, syntax_reference(s), NIL));
01033         MAPL(ce, {
01034             expression e = EXPRESSION(CAR(ce));
01035             lr = expression_to_reference_list(e, lr);
01036             },
01037              reference_indices(syntax_reference(s)));
01038         break;
01039     case is_syntax_range:
01040         lr = expression_to_reference_list(range_lower(syntax_range(s)), lr);
01041         lr = expression_to_reference_list(range_upper(syntax_range(s)), lr);
01042         lr = expression_to_reference_list(range_increment(syntax_range(s)),
01043                                           lr);
01044         break;
01045     case is_syntax_call:
01046         MAPL(ce, {
01047             expression e = EXPRESSION(CAR(ce));
01048             lr = expression_to_reference_list(e, lr);
01049             },
01050              call_arguments(syntax_call(s)));
01051         break;
01052     case is_syntax_cast: {
01053       cast c = syntax_cast(s);
01054       expression e = cast_expression(c);
01055       lr = expression_to_reference_list(e, lr);
01056       break;
01057     }
01058     case is_syntax_sizeofexpression: {
01059       sizeofexpression soe = syntax_sizeofexpression(s);
01060       if(sizeofexpression_expression_p(soe)) {
01061         expression e = sizeofexpression_expression(soe);
01062         lr = expression_to_reference_list(e, lr);
01063       }
01064       break;
01065     }
01066     case is_syntax_subscript: {
01067       subscript sub = syntax_subscript(s);
01068       expression e = subscript_array(sub);
01069       list il = subscript_indices(sub);
01070       lr = expression_to_reference_list(e, lr);
01071       FOREACH(EXPRESSION, i,il) {
01072       lr = expression_to_reference_list(i, lr);
01073       }
01074       break;
01075     }
01076     case is_syntax_application: {
01077       application app = syntax_application(s);
01078       expression f = application_function(app);
01079       list al = application_arguments(app);
01080       lr = expression_to_reference_list(f, lr);
01081       FOREACH(EXPRESSION, a,al) {
01082       lr = expression_to_reference_list(a, lr);
01083       }
01084       break;
01085     }
01086     case is_syntax_va_arg: {
01087       list two = syntax_va_arg(s);
01088       FOREACH(SIZEOFEXPRESSION, soe, two) {
01089         if(sizeofexpression_expression_p(soe)) {
01090           expression e = sizeofexpression_expression(soe);
01091           lr = expression_to_reference_list(e, lr);
01092         }
01093       }
01094       break;
01095     }
01096     default:
01097         pips_error("syntax_to_reference_list","illegal tag %d\n",
01098                    syntax_tag(s));
01099 
01100     }
01101     return lr;
01102 }

Here is the call graph for this function:

Here is the caller graph for this function:

int trivial_expression_p ( expression  e  ) 

This function returns:

1, if e is a relational expression that is always TRUE

-1, if e is a relational expression that is always FALSE

0, otherwise.

It should be called trivial_condition_p().

If e is a relational expression

The test if an expression is trivial (always TRUE or FALSE) or not depends on the operator of the expression : (op= {<=,<,>=,>,==,!=}) so we have to treat each different case

Expression : v != 0

Expression : v == 0

Expression : v >= 0

Expression : v <= 0

Expression : v < 0

Expression : v > 0

Definition at line 496 of file ri-util/expression.c.

References call_arguments, call_function, CAR, CDR, ENTITY_EQUAL_P, ENTITY_GREATER_OR_EQUAL_P, ENTITY_GREATER_THAN_P, ENTITY_LESS_OR_EQUAL_P, ENTITY_LESS_THAN_P, ENTITY_NON_EQUAL_P, EXPRESSION, expression_syntax, expression_undefined_p, fprintf(), ifdebug, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, print_expression(), print_normalized(), relational_expression_p(), syntax_call, v, val_of, value_neg_p, value_negz_p, value_notzero_p, value_pos_p, value_posz_p, value_zero_p, vect_constant_p(), vect_substract(), and VECTEUR_NUL_P.

Referenced by abc_with_allocation_size(), alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_and_scalar_variable_in_module_flt(), alias_check_array_variable_in_caller_flt(), alias_check_array_variable_in_module_flt(), alias_check_scalar_and_array_variables_in_caller(), alias_check_scalar_and_array_variables_in_module(), alias_check_two_array_variables_in_caller(), alias_check_two_array_variables_in_module(), alias_check_two_scalar_variables_in_caller(), alias_check_two_scalar_variables_in_module(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), impact_check_two_scalar_variables_in_path(), and top_down_abc_call().

00497 {
00498   if (relational_expression_p(e))
00499     {
00500       /* If e is a relational expression*/
00501       list args = call_arguments(syntax_call(expression_syntax(e)));
00502       expression e1 =  EXPRESSION(CAR(args));
00503       expression e2 = EXPRESSION(CAR(CDR(args)));
00504       normalized n1,n2;
00505       entity op;
00506       if (expression_undefined_p(e1) ||expression_undefined_p(e2) ) return 0;
00507       n1 = NORMALIZE_EXPRESSION(e1);
00508       n2 = NORMALIZE_EXPRESSION(e2);
00509       op = call_function(syntax_call(expression_syntax(e)));
00510 
00511       ifdebug(3) {
00512         fprintf(stderr, "Normalizes of  expression:");
00513         print_expression(e);
00514         print_normalized(n1);
00515         print_normalized(n2);
00516       }
00517 
00518       if (normalized_linear_p(n1) && normalized_linear_p(n2))
00519         {
00520           Pvecteur v1 = normalized_linear(n1);
00521           Pvecteur v2 = normalized_linear(n2);
00522           Pvecteur v = vect_substract(v1,v2);
00523 
00524           /* The test if an expression is trivial (always TRUE or FALSE) or not
00525            * depends on the operator of the expression :
00526            * (op= {<=,<,>=,>,==,!=}) so we have to treat each different case */
00527 
00528           if (vect_constant_p(v))
00529             {
00530               if (ENTITY_NON_EQUAL_P(op))
00531                 {
00532                   /* Expression :  v != 0 */
00533                   if (VECTEUR_NUL_P(v)) return -1;
00534                   if (value_zero_p(val_of(v))) return -1;
00535                   if (value_notzero_p(val_of(v))) return 1;
00536                 }
00537               if (ENTITY_EQUAL_P(op))
00538                 {
00539                   /* Expression :  v == 0 */
00540                   if (VECTEUR_NUL_P(v)) return 1;
00541                   if (value_zero_p(val_of(v))) return 1;
00542                   if (value_notzero_p(val_of(v))) return -1;
00543                 }
00544               if (ENTITY_GREATER_OR_EQUAL_P(op))
00545                 {
00546                   /* Expression :  v >= 0 */
00547                   if (VECTEUR_NUL_P(v)) return 1;
00548                   if (value_posz_p(val_of(v))) return 1;
00549                   if (value_neg_p(val_of(v))) return -1;
00550                 }
00551               if (ENTITY_LESS_OR_EQUAL_P(op))
00552                 {
00553                   /* Expression :  v <= 0 */
00554                   if (VECTEUR_NUL_P(v)) return 1;
00555                   if (value_negz_p(val_of(v))) return 1;
00556                   if (value_pos_p(val_of(v))) return -1;
00557                 }
00558               if (ENTITY_LESS_THAN_P(op))
00559                 {
00560                   /* Expression :  v < 0 */
00561                   if (VECTEUR_NUL_P(v)) return -1;
00562                   if (value_neg_p(val_of(v))) return 1;
00563                   if (value_posz_p(val_of(v))) return -1;
00564                 }
00565               if (ENTITY_GREATER_THAN_P(op))
00566                 {
00567                   /* Expression :  v > 0 */
00568                   if (VECTEUR_NUL_P(v)) return -1;
00569                   if (value_pos_p(val_of(v))) return 1;
00570                   if (value_negz_p(val_of(v))) return -1;
00571                 }
00572             }
00573           return 0;
00574         }
00575       return 0;
00576     }
00577   return 0;
00578 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool true_expression_p ( expression  e  ) 
boolean unbounded_dimension_p ( dimension  dim  ) 

boolean unbounded_dimension_p(dim) input : a dimension of an array entity.

output : TRUE if the last dimension is unbounded (*), FALSE otherwise. modifies : nothing comment :

Parameters:
dim im

Definition at line 922 of file ri-util/expression.c.

References call_function, dimension_upper, entity_local_name(), expression_syntax, FALSE, same_string_p, syntax_call, syntax_call_p, TRUE, and UNBOUNDED_DIMENSION_NAME.

Referenced by array_resizing_statistic(), assumed_size_array_p(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), entity_unbounded_p(), top_down_abc_call(), top_down_abc_dimension(), and words_dimension().

00924 {
00925     syntax dim_synt = expression_syntax(dimension_upper(dim));
00926     boolean res = FALSE;
00927 
00928     if (syntax_call_p(dim_synt)) {
00929         string dim_nom = entity_local_name(call_function(syntax_call(dim_synt)));
00930 
00931         if (same_string_p(dim_nom, UNBOUNDED_DIMENSION_NAME))
00932             res = TRUE;
00933     }
00934 
00935     return(res);
00936 }

Here is the call graph for this function:

Here is the caller graph for this function:

void update_expression_syntax ( expression  e,
syntax  s 
)

frees expression synatx and repalce it by the new syntax

Definition at line 3061 of file ri-util/expression.c.

References expression_syntax, free_syntax(), and unnormalize_expression().

Referenced by array_to_pointer_call_rewriter(), array_to_pointer_fix_call_site(), do_atomize_call(), do_symbolic_tiling(), isolate_patch_reference(), perform_substitution_in_expression(), remove_dereferencement(), replace_subscript(), and substitute_expression_walker().

03062 {
03063     unnormalize_expression(e);
03064     free_syntax(expression_syntax(e));
03065     expression_syntax(e)=s;
03066 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool user_function_call_p ( expression  e  ) 

Definition at line 860 of file ri-util/expression.c.

References call_function, entity_initial, expression_syntax, f, FALSE, s, syntax_call, syntax_call_p, user_function_call_p(), v, and value_code_p.

Referenced by points_to_general_assignment(), and user_function_call_p().

00862 {
00863     syntax s = expression_syntax(e);
00864     bool user_function_call_p = FALSE;
00865 
00866     if(syntax_call_p(s)) {
00867         call c = syntax_call(s);
00868         entity f = call_function(c);
00869         value v = entity_initial(f);
00870         user_function_call_p = value_code_p(v);
00871     }
00872     else {
00873         user_function_call_p = FALSE;
00874     }
00875 
00876     return user_function_call_p;
00877 }

Here is the call graph for this function:

Here is the caller graph for this function:

expression Value_to_expression ( Value  v  ) 

added interface for linear stuff.

it is not ok if Value is not an int, but if Value is changed sometime, I guess code that use this function will not need any change. FC.

Definition at line 1009 of file ri-util/expression.c.

References int_to_expression(), and VALUE_TO_INT.

Referenced by array_access_to_array_ranges(), constraints_to_loop_bound(), extract_the_align(), fusion(), fusion_buffer(), generate_one_message(), Hierarchical_tiling(), hpfc_broadcast_buffers(), make_rational_exp(), Tiling2_buffer(), Tiling_buffer_allocation(), and update_indices_for_local_computation().

01010 {
01011     return(int_to_expression(VALUE_TO_INT(v)));
01012 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

FILE* out_flt = NULL [static]

Definition at line 2372 of file ri-util/expression.c.

Generated on Tue Aug 24 13:13:55 2010 for PIPS by  doxygen 1.6.3