PIPS
|
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "ri-util.h"
#include "properties.h"
Go to the source code of this file.
Data Structures | |
struct | ctx_substitute |
Macros | |
#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\")" |
Typedefs | |
typedef struct ctx_substitute | ctx_substitute_t |
Functions | |
static string | actual_fortran_string_to_compare (string fs, int *plength) |
quite lazy... More... | |
int | fortran_string_compare (string fs1, string fs2) |
compare pips fortran string constants from the fortran point of view. More... | |
tag | suggest_basic_for_expression (expression e) |
a BASIC tag is returned for the expression this is a preliminary version. More... | |
expression | expression_mult (expression ex) |
expression | entity_to_expression (entity e) |
if v is a constant, returns a constant call. More... | |
expression | make_entity_expression (entity e, cons *inds) |
expression | reference_to_expression (reference r) |
reference | expression_to_reference (expression e) |
reference | add_subscript_to_reference (reference r, expression s) |
Add a last subscript expression s to a reference r. More... | |
void | generic_reference_add_fixed_subscripts (reference r, type t, bool zero_p) |
Add a set of zero subscripts to a reference "r" by side effect. More... | |
void | reference_add_zero_subscripts (reference r, type t) |
void | reference_add_zero_subscript (reference r) |
No check on reference r. More... | |
void | reference_complete_with_zero_subscripts (reference r) |
Reference r to an array maybe partial, as is possible in C: with declaration "int a[10][10]", references "a", "a[i]" and "a[i][j]" are all legal. More... | |
void | reference_add_unbounded_subscripts (reference r, type t) |
expression | call_to_expression (call c) |
Build an expression that call a function or procedure. More... | |
expression | make_call_expression (entity e, list l) |
Build an expression that call an function entity with an argument list. More... | |
expression | MakeNullaryCall (entity f) |
Creates a call expression to a function with zero arguments. More... | |
expression | MakeUnaryCall (entity f, expression a) |
Creates a call expression to a function with one argument. More... | |
expression | MakeBinaryCall (entity f, expression eg, expression ed) |
Creates a call expression to a function with 2 arguments. More... | |
expression | MakeTernaryCall (entity f, expression e1, expression e2, expression e3) |
Creates a call expression to a function with 3 arguments. More... | |
expression | make_assign_expression (expression lhs, expression rhs) |
Make an assign expression, since in C the assignment is a side effect operator. More... | |
expression | make_subscript_expression (expression a, list sl) |
bool | expression_brace_p (expression e) |
predicates and short cut accessors on expressions More... | |
bool | expression_call_p (expression e) |
bool | expression_address_of_p (expression e) |
call | expression_call (expression e) |
bool | expression_cast_p (expression e) |
cast | expression_cast (expression e) |
bool | expression_sizeofexpression_p (expression e) |
sizeofexpression | expression_sizeofexpression (expression e) |
bool | expression_application_p (expression e) |
Duplicate bool expression_subscript_p(expression e) { return(syntax_subscript_p(expression_syntax(e))); }. More... | |
application | expression_application (expression e) |
bool | expression_field_p (expression e) |
The expression is of kind "s.a", where "s" is a struct and a "a" field. More... | |
bool | field_expression_p (expression e) |
The expression is of kind "a", where "a" is a field of some struct "s". More... | |
bool | expression_pointer_p (expression e) |
we get the type of the expression by calling expression_to_type() which allocates a new one. More... | |
bool | array_argument_p (expression e) |
bool | expression_reference_p (expression e) |
Test if an expression is a reference. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | logical_operator_expression_p (expression e) |
C xor is missing. More... | |
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: More... | |
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". More... | |
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. More... | |
bool | extended_integer_constant_expression_p_to_int (expression e, int *result) |
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). More... | |
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. More... | |
bool | assignment_expression_p (expression e) |
Test if an expression is an assignment operation. More... | |
bool | add_expression_p (expression e) |
Test if an expression is an addition. More... | |
bool | sub_expression_p (expression e) |
bool | substraction_expression_p (expression e) |
Test if an expression is an substraction. More... | |
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 | unary_minus_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) |
bool | unbounded_dimension_p (dimension dim) |
bool unbounded_dimension_p(dim) input : a dimension of an array entity. More... | |
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 More... | |
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 More... | |
expression | make_zero_expression (void) |
Make a zero expression. More... | |
bool | zero_expression_p (expression e) |
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. More... | |
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; More... | |
list | syntax_to_reference_list (syntax s, list lr) |
bool | expression_equal_p (expression e1, expression e2) |
Syntactic equality e1==e2. More... | |
bool | expression_equal_or_opposite_p (expression e1, expression e2) |
e1==e2 or -e1==e2 or e1==-e2 syntactically More... | |
bool | expression_opposite_p (expression e1, expression e2) |
e1+e2==0, i.e. More... | |
bool | expression_lists_equal_p (list l1, list l2) |
bool | same_expression_p (expression e1, expression e2) |
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a More... | |
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 | subscript_equal_p (subscript s1, subscript 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) |
int | integer_constant_expression_value (expression e) |
int | signed_integer_constant_expression_value (expression e) |
expression | make_max_expression (expression e1, expression e2, enum language_utype lang) |
expression | make_min_expression (expression e1, expression e2, enum language_utype lang) |
expression | make_factor_expression (int coeff, entity vari) |
Some functions to generate expressions from vectors and constraint systems. More... | |
expression | make_vecteur_expression (Pvecteur pv) |
make expression for vector (Pvecteur) More... | |
statement | Pvecteur_to_assign_statement (entity var, Pvecteur v) |
generates var = linear expression from the Pvecteur. More... | |
expression | make_constraint_expression (Pvecteur v, Variable index) |
Make an expression from a constraint v for a given index. More... | |
expression | make_contrainte_expression (Pcontrainte pc, Variable index) |
A wrapper around make_constraint_expression() for compatibility. More... | |
expression | Pvecteur_to_expression (Pvecteur vect) |
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c. More... | |
reference | expression_reference (expression e) |
Short cut, meaningful only if expression_reference_p(e) holds. More... | |
bool | expression_subscript_p (expression e) |
subscript | expression_subscript (expression e) |
bool | expression_range_p (expression e) |
range | expression_range (expression e) |
bool | array_reference_p (reference r) |
predicates on references More... | |
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. More... | |
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. More... | |
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. More... | |
bool | expression_equal_integer_p (expression exp, int i) |
================================================================ More... | |
expression | make_op_exp (char *op_name, expression exp1, expression exp2) |
================================================================ More... | |
expression | add_integer_to_expression (expression exp, int val) |
expression | make_lin_op_exp (entity op_ent, expression exp1, expression exp2) |
================================================================ More... | |
int | expression_to_int (expression exp) |
================================================================ More... | |
float | expression_to_float (expression exp) |
Same as above for floating point constants. More... | |
constant | expression_constant (expression exp) |
This function returns a "constant" object if the expression is a constant such as 10, -11 or 2.345 or "foo". More... | |
bool | expression_string_constant_p (expression exp) |
char * | expression_string_constant (expression exp) |
returns a newly allocated string! More... | |
bool | expression_integer_constant_p (expression e) |
bool | expression_constant_p (expression exp) |
================================================================ More... | |
bool | extended_expression_constant_p (expression exp) |
Returns true if the value of the expression does not depend syntactically on the current store. More... | |
bool | expression_is_C_rhs_p (expression exp) |
Not all expressions can be used as right-hand side (rhs) in C assignments. More... | |
bool | expression_one_p (expression exp) |
bool | expression_null_p (expression exp) |
returns true if the expression is equal to zero or NULL (even if there is a cast before such as in (void *) 0). More... | |
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. More... | |
static bool | expr_flt (expression e) |
void | davinci_dump_all_expressions (FILE *out, statement s) |
dump all expressions in s to out. More... | |
static void | substitute_variable_in_reference (reference r, ctx_substitute_t *ctx) |
static void | substitute_entity_in_call (call c, ctx_substitute_t *ctx) |
expression | substitute_entity_variable_in_expression (entity old, entity new, expression e) |
(This function isn't use for the moment) This function replaces all the occurrences of an old entity in the expression exp by the new entity. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | reference_with_unbounded_indices_p (reference r) |
indices can be constant or unbounded: they are store independent. More... | |
bool | reference_with_unbounded_subscript_p (reference r) |
See if the reference uses the unbounded function '*'. More... | |
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? More... | |
entity | expression_to_entity (expression e) |
just returns the entity of an expression, or entity_undefined More... | |
list | expressions_to_entities (list expressions) |
map expression_to_entity on expressions More... | |
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 More... | |
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 More... | |
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 More... | |
list | make_list_of_constant (int val, int number) |
of expression More... | |
bool | brace_expression_p (expression e) |
Return bool indicating if expression e is a brace expression. More... | |
static list | do_brace_expression_to_statements (entity arr, expression e, list curr_indices) |
helper for brace_expression_to_statements More... | |
list | brace_expression_to_statements (entity arr, expression e) |
converts a brace expression used to initialize an array (not a struct yet) into a statement sequence More... | |
static void | do_brace_expression_to_updated_type (entity arr, expression e, list dl) |
helper for brace_expression_to_updated_type More... | |
void | brace_expression_to_updated_type (entity arr, expression e) |
use a brace expression to update the type of array "arr" if the dimensions are implicit More... | |
bool | reference_scalar_p (reference r) |
This function returns true if Reference r is scalar. More... | |
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 More... | |
void | update_expression_syntax (expression e, syntax s) |
frees expression syntax of e and replace it by the new syntax s More... | |
void | local_assign_expression (expression caller, expression field) |
replace expression caller by expression field , where field is contained by caller More... | |
expression | syntax_to_expression (syntax s) |
generates an expression from a syntax More... | |
expression | monome_to_expression (Pmonome pm) |
converts a monome to an expression More... | |
expression | polynome_to_expression (Ppolynome pp) |
converts a polynomial to expression More... | |
Ppolynome | expression_to_polynome (expression exp) |
=========================================================================== More... | |
bool | simplify_expression (expression *pexp) |
use polynomials to simplify an expression in some cases this operation can change the basic of the expression. More... | |
static void | do_simplify_expressions (call c) |
void | simplify_expressions (void *obj) |
expression | reference_offset (reference ref) |
computes the offset of a C reference with its origin More... | |
expression | replace_expression_content (expression e1, expression e2) |
Use side effects to move the content of e2, s2 and n2, into e1; s1 and n1 are freed, as well as e2. More... | |
bool | expression_minmax_p (expression e) |
expression | MakeSizeofExpression (expression e) |
expression | MakeSizeofType (type t) |
expression | MakeCastExpression (type t, expression e) |
expression | MakeCommaExpression (list l) |
expression | MakeBraceExpression (list l) |
expression | dereference_expression (expression e) |
generate a newly allocated expression for *(e) More... | |
expression | make_address_of_expression (expression e) |
generate a newly allocated expression for &(e) More... | |
list | subscript_expressions_to_constant_subscript_expressions (list sl) |
make a full copy of the subscript expression list, preserve constant subscripts, replace non-constant subscript by the star subscript expression. More... | |
expression | pointer_reference_to_expression (reference r) |
Assume p is a pointer. More... | |
expression | expression_to_dereferencing_expression (expression e) |
Reuse expression e to build expression *(e) without cheking the legality of the construct. More... | |
bool | C_initialization_expression_p (expression e) |
list | struct_initialization_expression_to_expressions (expression e) |
Returns a list of expressions hidden by the brace function. More... | |
void | free_expressions (list el) |
Free a list of expressions. More... | |
static void | expr_rwt (expression e) |
hack: clean all normalize fields... More... | |
void | clean_all_normalized (expression e) |
expression | subscript_value_stride (entity arr, list l_inds) |
expression | size_of_actual_array (entity actual_array, list l_actual_ref, int i) |
expression | make_ref_expr (entity ent, list args) |
bool | unbounded_entity_p (entity f) |
bool | unbounded_expression_p (expression e) |
expression | make_unbounded_expression () |
list | make_unbounded_subscripts (int d) |
FI: this piece of code must have been duplicated somewhere else in an effect library. More... | |
bool | user_call_p (call c) |
Test if a call is a user call. More... | |
void | normalize_subscript_expression (expression e) |
Normalization of subscript in expressions. More... | |
void | expression_normalize_subscripts (expression e) |
To be used for initialization expressions. More... | |
void | statement_normalize_subscripts (statement s) |
To be used for module statements. More... | |
Variables | |
static FILE * | out_flt = NULL |
#define ALREADY_SEEN | ( | node | ) | (hash_defined_p(seen, (char*)node)) |
Definition at line 2631 of file expression.c.
#define DV_CIRCLE ",a(\"_GO\",\"circle\")" |
Definition at line 2634 of file expression.c.
#define DV_YELLOW ",a(\"COLOR\",\"yellow\")" |
Definition at line 2635 of file expression.c.
Definition at line 2632 of file expression.c.
typedef struct ctx_substitute ctx_substitute_t |
|
static |
perform the real similarity comparaison between two expressions target is matched against pattern, and expression <> argument is stored in symbols
target | cheked expression |
pattern | pattern expression |
symbols | map storing entity <> expression tuple |
cast handler
we memorize reference from target and pattern in the symbol table similar to \1 in sed
scalar reference always matches. SG: in fact, you have to check for type compatibility too ... Allows to match malloc(a) with more complex expressions like malloc(1 + strlen("...")). Interferes incorrectly with commutativity.
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 3180 of file expression.c.
References basic_equal_p(), basic_maximum(), basic_of_expression(), basic_overloaded_p, binary_call_lhs, binary_call_rhs, call_arguments, call_function, CAR, cast_expression, commutative_call_p(), ENDP, entity_name, EXPRESSION, expression_scalar_p, expression_syntax, FOREACH, free_basic(), gen_length(), hash_put(), 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_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_range, syntax_range_p, syntax_reference, 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().
bool abs_expression_p | ( | expression | e | ) |
Definition at line 1024 of file expression.c.
References ABS_OPERATOR_NAME, and operator_expression_p().
quite lazy...
skip TOP-LEVEL header
skip : header
skip surrounding quotes
skip trailing spaces (are these blanks?) if any.
Definition at line 54 of file expression.c.
References MODULE_SEP_STRING, and TOP_LEVEL_MODULE_NAME.
Referenced by fortran_string_compare().
bool add_expression_p | ( | expression | e | ) |
Test if an expression is an addition.
Definition at line 986 of file expression.c.
References operator_expression_p(), PLUS_C_OPERATOR_NAME, and PLUS_OPERATOR_NAME.
Referenced by incrementation_expression_to_increment().
expression add_integer_to_expression | ( | expression | exp, |
int | val | ||
) |
e,the | expression to add |
n,the | integer to add |
exp | xp |
val | al |
Definition at line 2132 of file expression.c.
References exp, int_to_expression(), make_op_exp(), and PLUS_OPERATOR_NAME.
Referenced by do_linearize_array_reference(), and region_to_minimal_dimensions().
reference add_subscript_to_reference | ( | reference | r, |
expression | s | ||
) |
Add a last subscript expression s to a reference r.
The validity of the input reference is not checked. The validity of the output reference is not checked either.
Definition at line 224 of file expression.c.
References CONS, EXPRESSION, gen_nconc(), NIL, and reference_indices.
Referenced by substitute_struct_stub_in_transformer(), transformer_apply_field_assignments_or_equalities(), and transformer_apply_unknown_field_assignments_or_equalities().
bool array_argument_p | ( | expression | e | ) |
Definition at line 513 of file expression.c.
References array_entity_p(), expression_reference(), expression_reference_p(), ref, and reference_variable.
Referenced by interprocedural_abc_call(), xml_Argument(), xml_AssignArgument(), xml_Call(), and xml_Transposition().
predicates on references
two possible meanings:
This makes a difference in procedure calls and IO statements
The second interpretation is chosen.
Definition at line 1861 of file expression.c.
References NIL, and reference_indices.
Referenced by array_to_constant_paths(), bottom_up_abc_reference(), bottom_up_abc_reference_implied_do(), dmas_invert_p(), expression_in_array_subscript(), initial_code_abc_reference(), and top_down_abc_flt().
bool assignment_expression_p | ( | expression | e | ) |
Test if an expression is an assignment operation.
Definition at line 979 of file expression.c.
References ASSIGN_OPERATOR_NAME, and operator_expression_p().
Referenced by expression_verbose_reduction_p_and_return_increment(), and step_directive_basic_workchunk_index().
expression bool_to_expression | ( | bool | b | ) |
Definition at line 1238 of file 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().
bool brace_expression_p | ( | expression | e | ) |
Return bool indicating if expression e is a brace expression.
Definition at line 3384 of file expression.c.
References call_function, ENTITY_BRACE_INTRINSIC_P, expression_call_p(), expression_syntax, f(), and syntax_call.
Referenced by brace_expression_to_statements(), brace_expression_to_updated_type(), c_brace_expression_string(), do_brace_expression_to_statements(), expression_is_C_rhs_p(), freia_extract_kernel(), st_brace_expression_as_string(), st_declaration_init(), this_entity_cdeclaration(), words_assign_op(), and words_variable_or_function().
list brace_expression_to_statements | ( | entity | arr, |
expression | e | ||
) |
converts a brace expression used to initialize an array (not a struct yet) into a statement sequence
arr | rr |
Definition at line 3480 of file expression.c.
References brace_expression_p(), do_brace_expression_to_statements(), NIL, out, and pips_assert.
Referenced by split_initializations_in_statement().
void brace_expression_to_updated_type | ( | entity | arr, |
expression | e | ||
) |
use a brace expression to update the type of array "arr" if the dimensions are implicit
arr | rr |
Definition at line 3517 of file expression.c.
References brace_expression_p(), do_brace_expression_to_updated_type(), entity_type, pips_assert, type_variable, and variable_dimensions.
Referenced by split_initializations_in_statement().
bool C_initialization_expression_p | ( | expression | e | ) |
Definition at line 4056 of file expression.c.
References call_function, ENTITY_BRACE_INTRINSIC_P, expression_syntax, f(), syntax_call, and syntax_call_p.
Referenced by struct_assignment_to_points_to(), and struct_initialization_expression_to_expressions().
bool cabs_expression_p | ( | expression | e | ) |
Definition at line 1048 of file expression.c.
References CABS_OPERATOR_NAME, and operator_expression_p().
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 1965 of file expression.c.
References call_function, entity_initial, is_value_constant, is_value_symbolic, and value_tag.
Referenced by logical_expression_to_transformer().
c1 | 1 |
c2 | 2 |
Definition at line 1529 of file expression.c.
References call_arguments, call_function, expression_equal_p(), f2(), and gen_equals().
Referenced by syntax_equal_p().
expression call_to_expression | ( | call | c | ) |
Build an expression that call a function or procedure.
c | is the call |
Definition at line 309 of file expression.c.
References is_syntax_call, make_expression(), make_syntax(), and normalized_undefined.
Referenced by add_exec_mmcd(), atom_cse_expression(), bound_to_statement(), call_nary_rwt(), call_to_transformer(), compute_constant(), do_point_to(), entity_to_expression(), expressions_to_operation(), float_to_expression(), freia_cleanup_status(), generate_compact(), generate_fifo_stat(), generate_mmcd_stat_from_ref(), get_fifoExp_from_ref(), gfc2pips_code2instruction_(), hwac_replace_statement(), if_different_pe_and_not_twin(), inline_statement_crawler(), int_to_expression(), inv_call_flt(), make_call_expression(), make_lInitStats(), make_loadsave_statement(), make_loop_step_stat(), make_lSwitchStats(), make_mmcd_load_store_stat(), make_read_write_fifo_stat(), make_send_receive_conversion(), make_step_inc_statement(), make_toggle_inc_statement(), make_transStat(), make_vecteur_expression(), MakeCaseStatement(), MakeForloopWithIndexDeclaration(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), mpic_make_mpi_finalize(), mpic_make_mpi_init(), mpic_make_mpi_irecv(), mpic_make_mpi_isend(), mpic_make_mpi_recv(), mpic_make_mpi_send(), new_local_image_variable(), pragma_build_if_condition(), pragma_if_as_expr(), process_innerStat1_proc(), replace_instruction_similar_to_pattern(), sesamify(), split_update_call(), and words_brace_op().
c1 | 1 |
c2 | 2 |
Definition at line 1455 of file expression.c.
References cast_expression, cast_type, expression_equal_p(), and type_equal_p().
Referenced by syntax_equal_p().
void clean_all_normalized | ( | expression | e | ) |
Definition at line 4102 of file expression.c.
References expr_rwt(), expression_domain, gen_recurse, and gen_true().
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(), expression_equal_in_context_p(), impact_check_two_scalar_variables_in_path(), top_down_abc_dimension(), and translate_to_module_frame().
bool comma_expression_p | ( | expression | e | ) |
Definition at line 830 of file expression.c.
References call_function, ENTITY_COMMA_P, expression_call_p(), expression_syntax, f(), and syntax_call.
Referenced by any_expression_to_transformer().
expression complex_to_expression | ( | float | re, |
float | im | ||
) |
re | e |
im | m |
Definition at line 1234 of file expression.c.
References float_to_expression(), and MakeComplexConstantExpression().
Referenced by make_0val_expression(), and make_1val_expression().
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.
Fi this test is too strong to preserve source code
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)
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)
May modify the source code a bit more than necessary, but avoids stupid expressions such as 64-1-1
This could be generalized to any affine expression. See for instance loop_bound02.c. But the source code is likely to be disturbed if the bound expression is regenerated from v after adding or subtracting 1 from its constant term.
upper_p | pper_p |
non_strict_p | on_strict_p |
Definition at line 2968 of file expression.c.
References copy_expression(), entity_intrinsic(), expression_constant_p(), expression_integer_value(), expression_linear_p(), expression_normalized, expression_to_int(), expression_undefined, expression_undefined_p, int, int_to_expression(), intptr_t, MakeBinaryCall(), MINUS_OPERATOR_NAME, NORMALIZE_EXPRESSION, normalized_linear, offset, PLUS_OPERATOR_NAME, TCST, vect_coeff(), vect_constant_p(), and VECTEUR_NUL_P.
Referenced by condition_expression_to_final_bound().
bool dabs_expression_p | ( | expression | e | ) |
Definition at line 1042 of file expression.c.
References DABS_OPERATOR_NAME, and operator_expression_p().
void davinci_dump_all_expressions | ( | FILE * | out, |
statement | s | ||
) |
dump all expressions in s to out.
out | ut |
Definition at line 2728 of file expression.c.
References expr_flt(), expression_domain, gen_null(), gen_recurse, out, and out_flt.
Referenced by davinci_dump_expressions().
void davinci_dump_expression | ( | FILE * | out, |
expression | e | ||
) |
dump expression e in file out as a davinci graph.
out | ut |
Definition at line 2710 of file expression.c.
References davinci_dump_expression_rc(), fprintf(), hash_pointer, hash_table_free(), hash_table_make(), out, and seen.
Referenced by expr_flt().
|
static |
daVinci node prolog.
node epilog
Definition at line 2637 of file expression.c.
References ALREADY_SEEN, call_arguments, call_function, DV_CIRCLE, DV_YELLOW, entity_local_name(), EXPRESSION, expression_syntax, fprintf(), is_syntax_call, is_syntax_cast, is_syntax_range, is_syntax_reference, MAP, NIL, out, pips_internal_error, pips_user_warning, reference_variable, seen, SEEN, syntax_call, syntax_reference, and syntax_tag.
Referenced by davinci_dump_expression().
expression dereference_expression | ( | expression | e | ) |
generate a newly allocated expression for *(e)
Definition at line 3934 of file expression.c.
References call_arguments, call_function, CAR, copy_expression(), CreateIntrinsic(), DEREFERENCING_OPERATOR_NAME, ENTITY_ADDRESS_OF_P, EXPRESSION, expression_call(), expression_call_p(), gen_length(), MakeUnaryCall(), and pips_assert.
Referenced by switch_vertex_to_assign().
bool divide_expression_p | ( | expression | e | ) |
Definition at line 1012 of file expression.c.
References DIVIDE_OPERATOR_NAME, and operator_expression_p().
|
static |
helper for brace_expression_to_statements
Definition at line 3396 of file expression.c.
References array_type_p(), brace_expression_p(), call_arguments, CONS, copy_expression(), CreateIntrinsic(), ENTITY, entity_field_p(), entity_to_expression(), EXPRESSION, expression_call(), expression_reference(), expression_reference_p(), expression_undefined, f(), FIELD_OPERATOR_NAME, FOREACH, free_reference(), gen_append(), gen_free_list(), gen_full_copy_list(), gen_full_free_list(), gen_nconc(), gen_nth(), int_to_expression(), make_assign_statement(), make_expression(), make_expression_list, make_reference(), make_statement_list, make_subscript(), make_syntax_subscript(), MakeBinaryCall(), NIL, normalized_undefined, out, pips_internal_error, reference_indices, reference_to_expression(), reference_to_type(), reference_variable, struct_type_to_fields(), and type_struct_variable_p().
Referenced by brace_expression_to_statements().
|
static |
helper for brace_expression_to_updated_type
Side-effect on dl, the dimension list of e's type
Definition at line 3493 of file expression.c.
References call_arguments, CAR, CDR, DIMENSION, dimension_upper, ENDP, EXPRESSION, expression_call(), free_expression(), gen_length(), int, int_to_expression(), and unbounded_expression_p().
Referenced by brace_expression_to_updated_type().
|
static |
Definition at line 3794 of file expression.c.
References call_arguments, ENDP, POP, REFCAR, and simplify_expression().
Referenced by simplify_expressions().
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 165 of file 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(), add_pragma_to_sequence(), adg_dataflowgraph_with_extremities(), adg_enrichir(), adg_rename_entities(), any_basic_update_operation_to_transformer(), any_update_to_transformer_list(), atom_cse_expression(), buffer_full_condition(), build_call_STEP_AllToAll(), build_call_STEP_init_regionArray(), build_call_STEP_set_recvregions(), build_call_STEP_set_sendregions(), c_convex_effects_on_actual_parameter_forward_translation(), C_MakeReturnStatement(), call_STEP_subroutine(), call_STEP_subroutine3(), comEngine_generate_procCode(), compile_master(), compile_one_reduction(), compile_reduction(), compute_HRE_memory_mapping(), compute_points_to_binded_set(), compute_region(), controlize_distribution(), ctx_generate_new_statement_cluster_dependant(), declaration_statement_to_points_to(), declaration_to_post_pv(), define_node_processor_id(), derived_formal_parameter_to_stub_points_to(), dimensions_to_dma(), distribute_code(), do_array_to_pointer_walk_expression(), do_atomize_call(), do_brace_expression_to_statements(), do_clone_statement(), do_gather_all_expressions(), do_group_constants_terapix(), do_loop_expansion(), do_loop_nest_unswitching(), do_loop_to_for_loop(), do_loop_to_while_loop(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_outliner_smart_replacment(), do_point_to(), do_scalar_renaming_in_successors(), do_solve_hardware_constraints_on_volume(), do_split_structure(), do_symbolic_tiling(), do_terapix_argument_handler(), entities_to_expressions(), entities_to_expressions2(), expression_multiply_sizeof_to_transformer(), find_or_create_allocatable_struct(), fix_loop_index_sign(), for_to_do_loop_conversion(), freia_add_image_arguments(), freia_copy_image(), full_loop_unroll(), fusion(), fusion_buffer(), gen_if_rank(), Generate_C_ReturnStatement(), generate_call_compute_loopslices(), generate_call_get_commsize(), generate_call_get_rank(), generate_call_get_rank_loopbounds(), generate_call_get_workchunk_loopbounds(), generate_call_set_regionarray(), generate_code_loop(), generate_exec_statement(), generate_fifo_stat(), generate_fifo_stat2(), generate_ind_fifo_stat2(), generate_load_statement(), generate_loop_workchunk(), 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(), image_free(), initialize_scalar_variable(), inline_expression_call(), inline_return_crawler(), inline_split_declarations(), insert_check_alias_before_statement(), intrinsic_call_to_points_to(), isolate_patch_reference(), loop_bound_evaluation_to_transformer(), loop_flt(), loop_rewrite(), loop_strip_mine(), loopbounds_substitution(), make_array_communication_statement(), make_assignement_statement(), make_body_from_loop(), make_C_print_statement(), make_communication_statement(), make_condition_from_loop(), make_dma_transfert(), make_exec_mmcd(), make_expression_with_state_variable(), make_factor_expression(), 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_read_loopbody(), make_scalar_communication_module(), make_scanning_over_tiles(), make_send_receive_conversion(), make_set_rc_statement(), make_shuffle_statement(), 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(), modulo_to_transformer(), monome_to_expression(), move_declaration_control_node_declarations_to_statement(), mpi_initialize(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), mpic_make_mpi_finalize(), mpic_make_mpi_init(), mpic_make_mpi_irecv(), mpic_make_mpi_isend(), mpic_make_mpi_recv(), mpic_make_mpi_send(), mppa_compile_dag(), mppa_helper_args_params(), mylid_ne_lid(), new_local_image_variable(), normalize_microcode(), outliner_extract_loop_bound(), outliner_parameters(), outliner_patch_parameters(), perform_array_element_substitutions_in_transformer(), pointer_values_remove_var(), process_innerStat1_proc(), process_opt_replace(), Pvecteur_to_assign_statement(), reference_add_field_dimension(), reference_to_points_to(), regenerate_toggles(), region_to_address(), regions_to_loops(), rename_statement_declarations(), replace_field_by_reference_walker(), replace_indices_region(), replace_indices_region_com(), sc_delimiter(), scalar_to_array(), scalopify(), sequence_to_post_pv(), sesamify(), set_aipo_call(), simd_atomize_this_expression(), simd_loop_unroll(), simple_reference_add_field_dimension(), simplify_subscript(), split_complex_expression(), split_initializations_in_statement(), st_generate_packing(), statement_compute_bounds(), step_symbolic_expression(), string_to_expression(), struct_initialization_to_points_to(), struct_variable_to_pointer_locations(), struct_variable_to_pointer_subscripts(), substitute_struct_stub_in_transformer(), systeme_to_loop_nest(), terapix_loop_handler(), transformer_apply_field_assignments_or_equalities(), transformer_apply_unknown_field_assignments_or_equalities(), translate_to_module_frame(), typedef_formal_parameter_to_stub_points_to(), unsugared_loop_header(), unsugared_loop_inc(), unsugared_loop_test(), update_indices_for_local_computation(), update_reflhs_with_rhs_to_transformer(), usual_loop_tiling(), and verify_scalar_variable().
|
static |
Definition at line 2720 of file expression.c.
References davinci_dump_expression(), and out_flt.
Referenced by davinci_dump_all_expressions().
|
static |
hack: clean all normalize fields...
Definition at line 4093 of file expression.c.
References expression_normalized, free_normalized(), normalized_undefined, and normalized_undefined_p.
Referenced by clean_all_normalized().
bool expression_address_of_p | ( | expression | e | ) |
Definition at line 420 of file expression.c.
References call_function, ENTITY_ADDRESS_OF_P, expression_syntax, f(), syntax_call, and syntax_call_p.
Referenced by freia_reduction_variable().
application expression_application | ( | expression | e | ) |
Definition at line 485 of file expression.c.
References expression_syntax, and syntax_application.
Referenced by expression_to_transformer().
bool expression_application_p | ( | expression | e | ) |
Duplicate bool expression_subscript_p(expression e) { return(syntax_subscript_p(expression_syntax(e))); }.
subscript expression_subscript(expression e) { return(syntax_subscript(expression_syntax(e))); }
Definition at line 480 of file expression.c.
References expression_syntax, and syntax_application_p.
Referenced by expression_to_transformer().
bool expression_brace_p | ( | expression | e | ) |
predicates and short cut accessors on expressions
Definition at line 407 of file expression.c.
References call_function, ENTITY_BRACE_INTRINSIC_P, expression_call(), and expression_call_p().
Referenced by do_convert_this_array_to_pointer_p().
call expression_call | ( | expression | e | ) |
Definition at line 445 of file expression.c.
References expression_syntax, and syntax_call.
Referenced by address_of_scalar(), any_expression_to_transformer(), atomize_call(), atomize_call_filter(), atomize_call_statement(), atomize_this_expression(), cleanup_subscript_pre(), compact_phi_functions(), compute_points_to_binded_set(), copy_from_statement(), copy_to_statement(), dereference_expression(), distance_between_expression(), do_array_to_pointer_patch_call_expression(), do_brace_expression_to_statements(), do_brace_expression_to_updated_type(), do_expression_reduction(), do_group_constant_entity(), do_linearize_array_init(), do_linearize_array_manage_callers(), do_linearize_prepatch_subscript(), do_linearize_remove_dereferencment_walker(), do_loop_nest_unswitching(), do_reduction_detection(), do_reduction_propagation(), do_simplify_constant_address_expression(), do_split_structure(), do_split_structure_return_hook_walker(), expr_cse_flt(), expression_allocatable_data_access_p(), expression_brace_p(), expression_equal_or_opposite_p(), expression_field_p(), expression_minmax_p(), expression_opposite_p(), expression_string_constant(), expression_string_constant_p(), expression_to_transformer(), filter_variables_in_pragma_expr(), find_entities_to_wrap(), for_to_do_loop_conversion(), freia_alloc_stat_p(), freia_reduction_variable(), get_complement_expression(), guess_late_read_effect_on_entity(), guess_loop_increment(), guess_loop_increment_walker(), guess_loop_lower_bound(), initialization_list_to_statements(), make_address_of_expression(), make_loadsave_statement(), make_send_receive_conversion(), pragma_omp_merge_expr(), pragma_omp_p(), pragma_PRAGMA_DISTRIBUTED_p(), reference_filter(), remove_expression_from_comma_list(), remove_simple_scalar_pointers(), remove_unread_variable(), reorder_pointer_expression(), replace_entity_by_expression_expression_walker(), replace_instruction_similar_to_pattern(), rssp_ref(), simplify_complex_expression(), simplify_minmax_expression(), skip_field_and_cast_expression(), statement_has_omp_parallel_directive_p(), statement_phi_function_p(), statement_remove_omp_clauses(), terapix_loop_optimizer(), terapix_normalize_tests(), terapixify_loops(), two_addresses_code_generator(), two_addresses_code_generator_split_p(), user_function_call_to_transformer(), and zero_expression_p().
bool expression_call_p | ( | expression | e | ) |
Definition at line 415 of file expression.c.
References expression_syntax, and syntax_call_p.
Referenced by actual_label_replacement_p(), address_of_scalar(), alloc_instrumentation(), any_expression_to_transformer(), atomize_call(), atomize_call_filter(), atomize_call_statement(), atomize_this_expression(), brace_expression_p(), c_brace_expression_p(), change_basic_if_needed(), cleanup_subscript_pre(), comma_expression_p(), complex_constant_expression_p(), compute_points_to_binded_set(), condition_to_transformer(), controlize_statement(), copy_from_statement(), copy_to_statement(), dereference_expression(), do_array_to_pointer_patch_call_expression(), do_expression_reduction(), do_group_constant_entity(), do_linearize_array_init(), do_linearize_array_manage_callers(), do_linearize_prepatch_subscript(), do_linearize_remove_dereferencment_walker(), do_reduction_detection(), do_reduction_propagation(), do_simplify_constant_address_expression(), expr_flt(), expression_allocatable_data_access_p(), expression_brace_p(), expression_field_p(), expression_implied_do_p(), expression_list_directed_p(), expression_minmax_p(), expression_reference_number(), expression_string_constant_p(), expression_to_int(), expression_to_transformer(), expression_try_find_size(), find_entities_to_wrap(), find_implicit_goto(), find_target_position(), freia_alloc_stat_p(), get_complement_expression(), guess_late_read_effect_on_entity(), guess_loop_increment(), guess_loop_increment_walker(), guess_loop_lower_bound(), initialization_list_to_statements(), inline_expression(), interprocedural_abc_expression(), is_this_op(), logical_operator_expression_p(), make_address_of_expression(), MakeReturn(), number_of_initial_values(), number_of_operators_flt(), parser_macro_expansion(), pragma_omp_p(), pragma_PRAGMA_DISTRIBUTED_p(), process_static_initialization(), reference_filter(), regenerate_call(), relational_expression_p(), remove_expression_from_comma_list(), remove_unread_variable(), reorder_pointer_expression(), replace_entity_by_expression_expression_walker(), replace_subscript(), rssp_ref(), sentence_data_statement(), simplify_complex_expression(), SizeOfArray(), statement_has_omp_parallel_directive_p(), statement_phi_function_p(), statement_remove_omp_clauses(), store_initial_value(), switch_specific_cmplx(), switch_specific_dcmplx(), terapix_loop_optimizer(), terapix_normalize_tests(), terapixify_loops(), 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 zero_expression_p().
cast expression_cast | ( | expression | e | ) |
Definition at line 455 of file expression.c.
References expression_syntax, and syntax_cast.
Referenced by condition_to_transformer(), expression_null_p(), expression_to_transformer(), MakeCaseStatement(), and words_subexpression().
bool expression_cast_p | ( | expression | e | ) |
Definition at line 450 of file expression.c.
References expression_syntax, and syntax_cast_p.
Referenced by condition_to_transformer(), expression_null_p(), expression_to_transformer(), MakeCaseStatement(), and words_subexpression().
constant expression_constant | ( | expression | exp | ) |
This function returns a "constant" object if the expression is a constant such as 10, -11 or 2.345 or "foo".
Expressions such as "5+0" or "sizeof(int)" or "m", with m defined as "const int m = 2;" or "M" with M defined as PARAMETER do not qualify. However their value is constant, i.e. store independent, and can be evaluated using EvalExpression().
FI: difficult to make a decision here. We may have a constant expression that cannot be evaluated as a constant statically by PIPS. What is the semantics of expression_constant_p()?
&& get_bool_property("EVAL_SIZEOF")
Too bad we need a function located in eval.c ...
Might be a reference to a scalar constant.
exp | xp |
Definition at line 2347 of file expression.c.
References binary_call_lhs, call_function, const_variable_p(), constant_undefined, copy_constant(), entity_initial, ENTITY_UNARY_MINUS_P, ENTITY_UNARY_PLUS_P, EvalSizeofexpression(), exp, expression_syntax, free_value(), is_value_constant, is_value_intrinsic, reference_variable, sizeofexpression_type_p, syntax_call, syntax_call_p, syntax_reference, syntax_reference_p, syntax_sizeofexpression, syntax_sizeofexpression_p, value_constant, value_constant_p, and value_tag.
Referenced by expression_constant_p(), and words_dimension().
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" is 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.
See below extended_expression_constant_p() for a more general function.
exp | xp |
Definition at line 2453 of file expression.c.
References constant_undefined_p, exp, 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(), constraints_to_loop_bound(), convert_bound_expression(), do_loop_expansion(), do_loop_expansion_init(), do_solve_hardware_constraints_on_volume(), effect_field_dimension_entity(), equal_must_vreference(), expression_equal_integer_p(), expression_null_p(), expression_plusplus(), expression_string_constant_p(), expression_to_float(), expression_to_int(), expression_to_polynome(), expression_try_find_size(), formal_variable_add_aliases(), freia_insert_added_stats(), have_null_value_in_pointer_expression_p(), incrementation_expression_to_increment(), inline_expression_call(), loop_annotate(), loop_normalize_of_loop(), make_loadsave_statement(), make_max_exp(), make_send_receive_conversion(), MakeCaseStatement(), MakeEquivAtom(), malloc_arg_to_type(), normalizable_loop_p(), opkill_may_vreference(), opkill_must_vreference(), overlap_redefine_expression(), plc_make_dim(), points_to_compare_cell(), points_to_compare_cells(), points_to_compare_location(), points_to_compare_ptr_cell(), process_true_call_stat(), rational_op_exp(), references_do_not_conflict_p(), replace_subscript(), simplify_C_expression(), size_of_actual_array(), size_of_dummy_array(), sp_feautrier_expression_p(), splc_feautrier_expression_p(), stmt_bdt_directions(), subscript_value(), subscript_value_stride(), terapixify_loops(), valuer(), and words_dimension().
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.
le | e |
Definition at line 566 of file expression.c.
References EXPRESSION, expression_equal_p(), f(), and MAP.
Referenced by pragma_omp_merge_expr().
bool expression_equal_integer_p | ( | expression | exp, |
int | i | ||
) |
================================================================
bool expression_equal_integer_p(expression exp, int i): returns true if "exp" is a constant value equal to "i".
exp | xp |
Definition at line 1977 of file expression.c.
References exp, expression_constant_p(), expression_to_int(), and pips_debug.
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(), alias_check_two_array_variables_in_caller(), alias_check_two_array_variables_in_module(), c_reference(), formal_variable_add_aliases(), make_op_exp(), pointer_type_array_p(), ram_variable_add_aliases(), rational_op_exp(), same_dimension_p(), same_or_equivalence_argument_add_aliases(), set_array_declaration(), splc_positive_relation_p(), storage_formal_offset(), storage_ram_offset(), subscript_value_stride(), and translate_to_module_frame().
bool expression_equal_or_opposite_p | ( | expression | e1, |
expression | e2 | ||
) |
e1==e2 or -e1==e2 or e1==-e2 syntactically
e1 | 1 |
e2 | 2 |
Definition at line 1366 of file expression.c.
References call_arguments, CAR, EXPRESSION, expression_call(), expression_equal_p(), unary_intrinsic_expression, and UNARY_MINUS_OPERATOR_NAME.
bool expression_equal_p | ( | expression | e1, |
expression | e2 | ||
) |
Syntactic equality e1==e2.
Add expression_undefined tests to avoid segmentation fault
let's assume that every expression has a correct syntax component
e1 | 1 |
e2 | 2 |
Definition at line 1347 of file expression.c.
References expression_syntax, expression_undefined_p, s1, and syntax_equal_p().
Referenced by bitwise_xor_to_transformer(), bottom_up_abc_base_reference_implied_do(), call_equal_p(), cast_equal_p(), compact_phi_functions(), compatible_points_to_subscripts_p(), convex_cell_reference_preceding_p(), dimension_equal_p(), do_expressions_to_vector(), effect_comparable_p(), effect_may_union(), effect_must_union(), expr_rwt(), expression_eq_in_list_p(), expression_equal_in_list_p(), expression_equal_or_opposite_p(), expression_flt(), expression_lists_equal_p(), expression_opposite_p(), find_equal_expression_not_in_list(), forward_substitute_array_location_in_transformer(), generic_basic_equal_p(), integer_multiply_to_transformer(), lexpression_equal_p(), loop_rewrite(), lrange_larger_p(), make_permutations_indexes(), make_simd_statement(), opkill_may_vreference(), opkill_must_vreference(), partial_eval_plus_or_minus_operator(), points_to_reference_included_p(), range_equal_p(), reference_equal_p(), reference_to_points_to_translations(), references_must_conflict_p(), same_alignment_in_list_p(), same_alignment_p(), same_distribute_p(), same_distribution_p(), same_expression_p(), similarity(), simple_cell_reference_preceding_p(), simple_cells_inclusion_p(), simple_cells_intersection_p(), simple_pv_may_union(), simple_pv_must_union(), sizeofexpression_equal_p(), subscript_equal_p(), switch_vertex_to_assign(), terapix_loop_optimizer(), terapixify_loops(), two_addresses_code_generator(), and update_vector_to_expressions().
bool expression_field_p | ( | expression | e | ) |
The expression is of kind "s.a", where "s" is a struct and a "a" field.
Definition at line 491 of file expression.c.
References call_function, ENTITY_FIELD_P, expression_call(), and expression_call_p().
Referenced by adapt_reference_to_type(), distance_between_expression(), expression_reference_or_field_p(), make_loadsave_statement(), replace_subscript(), and skip_field_and_cast_expression().
bool expression_implied_do_p | ( | e | ) |
Definition at line 817 of file expression.c.
References call_function, entity_local_name(), expression_call_p(), expression_syntax, IMPLIED_DO_NAME, and syntax_call.
Referenced by bottom_up_abc_expression(), bottom_up_abc_expression_implied_do(), comp_regions_of_implied_do(), comp_regions_of_iolist(), expression_in_array_subscript(), FortranExpressionList(), initial_code_abc_expression(), MakeFortranBinaryCall(), and MakeFortranUnaryCall().
bool expression_integer_constant_p | ( | expression | e | ) |
I hope a short evaluation is made by the compiler
Definition at line 2417 of file expression.c.
References call_function, constant_int_p, entity_initial, expression_normalized, expression_syntax, normalized_linear, normalized_linear_p, normalized_undefined, syntax_call, syntax_call_p, TCST, value_constant, value_constant_p, value_notzero_p, vect_coeff(), and vect_size().
Referenced by array_access_to_array_ranges(), do_solve_hardware_constraints_on_volume(), generate_optimized_code_for_loop_nest(), hpfc_decision(), loop_flt(), and points_to_reference_to_type().
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.
exp | xp |
Definition at line 1949 of file expression.c.
References call_function, entity_initial, exp, expression_syntax, is_syntax_call, is_value_intrinsic, syntax_call, syntax_tag, and value_tag.
Referenced by atomizer_of_test().
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.
exp | xp |
Definition at line 2582 of file expression.c.
References brace_expression_p(), and exp.
Referenced by redeclaration_enter_statement(), and split_initializations_in_statement().
bool expression_list_directed_p | ( | e | ) |
Definition at line 844 of file expression.c.
References call_function, entity_local_name(), expression_call_p(), expression_syntax, LIST_DIRECTED_FORMAT_NAME, and syntax_call.
expression expression_list_to_binary_operator_call | ( | list | l, |
entity | op | ||
) |
op | p |
Definition at line 1917 of file expression.c.
References CAR, CDR, EXPRESSION, expression_undefined, gen_length(), MakeBinaryCall(), MAPL, and pips_assert.
Referenced by compute_region(), expression_list_to_conjonction(), and top_down_abc_not_exact_case().
expression expression_list_to_conjonction | ( | list | l | ) |
Definition at line 1937 of file expression.c.
References AND_OPERATOR_NAME, entity_intrinsic(), expression_list_to_binary_operator_call(), gen_length(), and MakeNullaryCall().
Referenced by 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(), make_guard_expression(), and Psysteme_to_expression().
l1 | 1 |
l2 | 2 |
Definition at line 1405 of file expression.c.
References CAR, ENDP, EXPRESSION, expression_equal_p(), and POP.
Referenced by reference_to_points_to_translations().
bool expression_minmax_p | ( | expression | e | ) |
e
is a min or a max Definition at line 3882 of file expression.c.
References call_function, ENTITY_MAX_P, ENTITY_MIN_P, expression_call(), and expression_call_p().
Referenced by do_loop_nest_unswitching(), region_to_minimal_dimensions(), and simplify_minmax_expression().
expression expression_mult | ( | expression | ex | ) |
void expression_normalize_subscripts | ( | expression | e | ) |
To be used for initialization expressions.
Definition at line 4465 of file expression.c.
References expression_domain, gen_recurse, gen_true(), and normalize_subscript_expression().
bool expression_null_p | ( | expression | exp | ) |
returns true if the expression is equal to zero or NULL (even if there is a cast before such as in (void *) 0).
exp | xp |
Definition at line 2611 of file expression.c.
References cast_expression, entity_local_name(), exp, expression_cast(), expression_cast_p(), expression_constant_p(), expression_reference_p(), expression_to_int(), expression_variable(), and same_string_p.
Referenced by equal_condition_to_points_to(), freeable_points_to_cells(), have_null_value_in_pointer_expression_p(), non_equal_condition_to_points_to(), and pointer_expression_to_transformer().
bool expression_one_p | ( | expression | exp | ) |
exp | xp |
Definition at line 2591 of file expression.c.
References call_function, constant_int, constant_int_p, entity_initial, exp, expression_syntax, syntax_call, syntax_call_p, value_constant, and value_constant_p.
Referenced by ensure_comment_consistency().
bool expression_opposite_p | ( | expression | e1, |
expression | e2 | ||
) |
e1+e2==0, i.e.
-e1==e2 or e1==-e2 syntactically
e1 | 1 |
e2 | 2 |
Definition at line 1386 of file expression.c.
References call_arguments, CAR, EXPRESSION, expression_call(), expression_equal_p(), and unary_minus_expression_p().
Referenced by integer_multiply_to_transformer().
bool expression_pointer_p | ( | expression | e | ) |
we get the type of the expression by calling expression_to_type() which allocates a new one.
Then we call ultimate_type() to have the final type. Finally we test if it's a pointer by using pointer_type_p().
Definition at line 506 of file expression.c.
References expression_to_type(), pointer_type_p(), and ultimate_type().
Referenced by atom_cse_expression(), cse_call_flt(), derived_formal_parameter_to_stub_points_to(), do_terapix_pointer_initialized_from_a_mask_p(), glc_call(), points_to_cells_pointer_arguments(), and typedef_formal_parameter_to_stub_points_to().
range expression_range | ( | expression | e | ) |
Definition at line 1853 of file expression.c.
References expression_range_p(), expression_syntax, pips_assert, and syntax_range.
bool expression_range_p | ( | expression | e | ) |
Definition at line 1848 of file expression.c.
References expression_syntax, and syntax_range_p.
Referenced by expression_range(), and generic_atomic_points_to_reference_p().
reference expression_reference | ( | expression | e | ) |
Short cut, meaningful only if expression_reference_p(e) holds.
Definition at line 1832 of file expression.c.
References expression_reference_p(), expression_syntax, pips_assert, and syntax_reference.
Referenced by add_aliases_for_current_call_site(), address_of_scalar(), array_argument_p(), array_elements_substitution_in_transformer(), array_must_fully_written_by_regions_p(), array_to_constant_paths(), assignment_to_points_to(), atomize_call(), c_convex_effects_on_actual_parameter_forward_translation(), call_count_flt(), call_flt(), call_rwt(), comEngine_replace_reference_in_stat_rwt(), compact_phi_functions(), complete_points_to_reference_with_fixed_subscripts(), compute_points_to_binded_set(), convert_pointer_to_array_aux(), da_process_list(), dereferencing_to_points_to(), distance_between_expression(), do_array_to_pointer_walk_call_and_patch(), do_array_to_pointer_walk_expression(), do_atomize_call(), do_brace_expression_to_statements(), do_expression_reduction(), do_grouping_filter_out_self(), do_grouping_replace_reference_by_expression_walker(), do_linearize_prepatch_subscript(), do_linearize_remove_dereferencment_walker(), do_reduction_atomization(), do_reduction_detection(), do_reduction_propagation(), do_split_structure_return_hook_walker(), do_terapix_pointer_initialized_from_a_mask_p(), entity_used_in_calls_walker(), expression_allocatable_data_access_p(), expression_equal_in_context_p(), expression_reference_number(), expression_to_transformer(), expression_try_find_string_size(), expression_verbose_reduction_p_and_return_increment(), extended_regions_must_convex_hull(), field_expression_p(), FindDefinitionsOf_rewrite(), flint_cons_actual_argument(), freia_shuffle_move_forward(), full_copy_p(), generate_deducables(), get_complement_expression(), get_dma_dimension(), get_sizeofexpression_for_region(), glc_call(), guess_loop_increment_walker(), guess_loop_lower_bound(), guess_write_effect_on_entity_walker(), interprocedural_abc_call(), invalidate_expressions_in_statement(), isolate_patch_reference(), list_of_same_or_equivalence_arguments(), loadstore_type_conversion_string(), make_loadsave_statement(), make_send_receive_conversion(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), offset_in_caller(), outliner_patch_parameters(), partial_eval_update_operators(), perform_substitution_in_assign(), points_to_array_reference_p(), points_to_array_reference_to_type(), points_to_cells_pointer_arguments(), points_to_indices_to_subscript_indices(), points_to_indices_to_unbounded_indices(), process_static_initialization(), process_true_call_stat(), put_variables_in_ordered_lists(), recursive_store_independent_points_to_reference_p(), reference_argument_number(), reference_filter(), reference_to_field_disambiguator(), references_must_conflict_p(), region_to_address(), remove_unread_variable(), replace_entities_expression_walker(), replace_entity_by_expression_expression_walker(), replace_field_by_reference_walker(), rssp_ref(), sac_aligned_expression_p(), sac_expression_reduction_p(), safe_expression_to_transformer(), same_or_equivalence_argument_add_aliases(), same_section_common_variable_in_list_p(), same_section_formal_variable_in_list_p(), seq_rwt(), simd_trace_call(), simple_reference_to_convex_reference_conversion(), simplify_complex_expression(), split_complex_expression(), statement_insertion_fix_access_in_callers(), subscripted_field_list_to_type(), substitute_image_in_statement(), sww_seq_rwt(), terapix_loop_handler(), update_functional_type_with_actual_arguments(), variable_to_dimensions(), and verify_array_element().
bool expression_reference_p | ( | expression | e | ) |
Test if an expression is a reference.
Definition at line 528 of file expression.c.
References expression_syntax, and syntax_reference_p.
Referenced by add_aliases_for_current_call_site(), address_of_scalar(), alloc_instrumentation(), array_argument_p(), array_elements_substitution_in_transformer(), array_indices_check(), array_must_fully_written_by_regions_p(), assign_operation_to_transformer(), assignment_to_points_to(), atomize_call(), atomize_call_statement(), atomize_condition(), c_convex_effects_on_actual_parameter_forward_translation(), call_count_flt(), call_flt(), cleanup_subscript(), comEngine_replace_reference_in_stat_rwt(), compact_phi_functions(), compute_points_to_binded_set(), constant_reference_to_normalized_constant_reference(), continue_propagation_p(), controlize_statement(), convert_pointer_to_array_aux(), cstr_args_check(), dereferencing_to_points_to(), distance_between_expression(), do_array_to_pointer_walk_call_and_patch(), do_array_to_pointer_walk_expression(), do_atomize_call(), do_brace_expression_to_statements(), do_expression_reduction(), do_grouping_filter_out_self(), do_grouping_replace_reference_by_expression_walker(), do_linearize_pointer_is_expression(), do_linearize_prepatch_subscript(), do_linearize_remove_dereferencment_walker(), do_reduction_atomization(), do_reduction_propagation(), do_split_structure_return_hook_walker(), do_terapix_loop_optimizer(), entity_used_in_calls_walker(), expr_flt(), expr_rwt(), expression_equal_in_context_p(), expression_null_p(), expression_number_for_index(), expression_reference(), expression_reference_number(), expression_reference_or_field_p(), expression_simple_nondist_p(), expression_to_transformer(), expression_try_find_size(), expression_verbose_reduction_p_and_return_increment(), extended_regions_must_convex_hull(), field_expression_p(), flint_cons_actual_argument(), freia_extract_kernel(), freia_shuffle_move_forward(), full_copy_p(), get_complement_expression(), get_dma_dimension(), get_sizeofexpression_for_region(), glc_call(), guess_loop_increment_walker(), guess_loop_lower_bound(), guess_write_effect_on_entity_walker(), hpfc_overlap_kill_unused_scalars_rewrite(), interprocedural_mapping(), intrinsic_call_to_points_to(), invalidate_expressions_in_statement(), is_expression_reference_to_entity_p(), isolate_patch_reference(), list_of_same_or_equivalence_arguments(), loadstore_type_conversion_string(), make_loadsave_statement(), new_array_elements_backward_substitution_in_transformer(), new_array_elements_forward_substitution_in_transformer(), outliner_patch_parameters(), parser_macro_expansion(), partial_eval_call(), partial_eval_update_operators(), points_to_cells_pointer_arguments(), points_to_indices_to_array_index_number(), points_to_indices_to_subscript_indices(), points_to_indices_to_unbounded_indices(), process_static_initialization(), process_true_call_stat(), proper_to_summary_simple_effect(), reference_argument_number(), reference_filter(), reference_to_field_disambiguator(), reference_to_type(), references_aligned_p(), references_must_conflict_p(), regenerate_call(), region_to_address(), remove_unread_variable(), replace_entities_expression_walker(), replace_entity_by_expression_expression_walker(), replace_field_by_reference_walker(), rssp_ref(), sac_aligned_expression_p(), sac_expression_reduction_p(), safe_expression_to_transformer(), same_section_common_variable_in_list_p(), same_section_formal_variable_in_list_p(), seq_rwt(), simple_reference_to_convex_reference_conversion(), simplify_complex_expression(), statement_insertion_fix_access_in_callers(), subarray_shift_assignment_p(), subscripted_field_list_to_type(), substitute_image_in_statement(), sww_seq_rwt(), terapix_loop_handler(), update_functional_type_with_actual_arguments(), update_operation_to_transformer(), variable_references_may_conflict_p(), and variable_to_dimensions().
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
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 |
target | arget |
pattern | attern |
symbol_table | ymbol_table |
Definition at line 3339 of file expression.c.
References _expression_similar_p(), HASH_DEFAULT_SIZE, hash_string, hash_table_free(), hash_table_make(), and symbol_table().
Referenced by replace_expression_similar_to_pattern().
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
target | expression that sould match with pattern |
pattern | the pattern to match |
target | arget |
pattern | attern |
Definition at line 3360 of file expression.c.
References _expression_similar_p(), HASH_DEFAULT_SIZE, hash_pointer, hash_table_free(), hash_table_make(), and symbol_table().
sizeofexpression expression_sizeofexpression | ( | expression | e | ) |
Definition at line 465 of file expression.c.
References expression_syntax, and syntax_sizeofexpression.
Referenced by expression_to_transformer().
bool expression_sizeofexpression_p | ( | expression | e | ) |
Definition at line 460 of file expression.c.
References expression_syntax, and syntax_sizeofexpression_p.
Referenced by expression_to_transformer().
char* expression_string_constant | ( | expression | exp | ) |
returns a newly allocated string!
exp | xp |
Definition at line 2409 of file expression.c.
References call_function, entity_user_name(), exp, expression_call(), expression_string_constant_p(), pips_assert, and strndup().
Referenced by do_simplify_constant_address_expression().
bool expression_string_constant_p | ( | expression | exp | ) |
exp | xp |
Definition at line 2398 of file expression.c.
References call_function, constant_p(), constant_string_entity_p(), exp, expression_call(), expression_call_p(), and expression_constant_p().
Referenced by compute_points_to_binded_set(), do_simplify_constant_address_expression(), and expression_string_constant().
subscript expression_subscript | ( | expression | e | ) |
Definition at line 1843 of file expression.c.
References expression_subscript_p(), expression_syntax, pips_assert, and syntax_subscript.
Referenced by expression_to_transformer().
bool expression_subscript_p | ( | expression | e | ) |
Definition at line 1838 of file expression.c.
References expression_syntax, and syntax_subscript_p.
Referenced by expression_subscript(), and expression_to_transformer().
expression expression_to_dereferencing_expression | ( | expression | e | ) |
Reuse expression e to build expression *(e) without cheking the legality of the construct.
Definition at line 4051 of file expression.c.
References DEREFERENCING_OPERATOR_NAME, and unary_intrinsic_expression.
entity expression_to_entity | ( | expression | e | ) |
just returns the entity of an expression, or entity_undefined
The entity returned is either the function called or the variable referenced
SG: moved here from hpfc Warning: This function certainly needs to be reviewed, maybe just testing the size of arguments (call), or the size of index (reference) may be sufficient as a first step. If their sizes are != 0, it may not return what we expect (for instance "-3" will return UNARY_MINUS_OPERATOR_NAME "--"). But expression_to_entity is called by many functions and I worry about the side effects on them.
Definition at line 3140 of file 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, syntax_call, syntax_reference, and syntax_tag.
Referenced by address_of_entity_p(), continue_propagation_p(), copy_write_statement_with_cumulated_regions(), dagvtx_copy_list_dot(), do_check_isolate_statement_preconditions_on_call(), do_group_statement_constant(), do_isolate_statement_preconditions_satisified_p(), do_simdizer_init(), do_solve_hardware_constraints_on_nb_proc(), do_terapix_loop_optimizer(), effect_field_dimension_entity(), expressions_to_entities(), filter_variables_in_pragma_expr(), find_receiver_cluster(), fis_call_flt(), freia_cleanup_sequence_rec(), freia_extract_params(), freia_is_transpose_call(), gen_mpi_send_recv(), get_assigned_variable(), get_reference_assignments(), handle_align_and_realign_directive(), handle_prescriptive_directive(), hpf_compile_call(), hpfc_translate_call_with_distributed_args(), is_expression_in_list(), 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_send_receive_conversion(), make_simd_statement(), mpi_recv_ctx(), mpi_send_ctx(), new_dynamic(), new_fake_function(), new_io_function(), new_processor(), new_pure_function(), new_system_with_only_live_variable(), new_template(), oi_call_rwt(), outliner_smart_references_computation(), partial_eval_binary_operator(), region_to_minimal_dimensions(), remove_from_effective_parameters(), step_directive_basic_workchunk_index(), terapix_loop_optimizer(), terapixify_loops(), test_rewrite(), and update_overlaps_in_caller().
float expression_to_float | ( | expression | exp | ) |
Same as above for floating point constants.
Its calls must be guarded by expression_constant_p()
exp | xp |
Definition at line 2305 of file expression.c.
References binary_call_lhs, call_function, entity_initial, entity_local_name(), ENTITY_UNARY_MINUS_P, ENTITY_UNARY_PLUS_P, entity_user_name(), exp, expression_constant_p(), expression_syntax, is_value_constant, is_value_intrinsic, pips_debug, pips_internal_error, syntax_call, and value_tag.
Referenced by do_solve_hardware_constraints_on_volume(), and expression_to_polynome().
int expression_to_int | ( | expression | exp | ) |
================================================================
int expression_to_int(expression exp): returns the integer value of "exp" when "exp" is programming language constant or a Fortran symbolic constant.
Note: "exp" is supposed to contain an integer value which means that the function expression_constant_p() has returned true with "exp" as 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 its comment).
SG: improvement: the integer value of a extended_integer_constant_expression_p is computed too, for instance 0+5 or 6+3.
FI: I am not sure it is an improvement, at best it is an extension; it looks more like a change of semantics (see above comments and expression_constant_p()); other functions exist to evaluate a constant expression... The extension should be useless as this function should not be called unless guarded by a test with expression_constant_p()... The same is true for the extension related to symbolic constants.
For an extended static expression evaluation, see EvalExpression(). See also extended_expression_constant_p() for more comments about what is called a "constant" expression.
For a cleaner implementation of this function, as it was originally intended, see below expression_to_float().
use the normalize field first: this is Serge Guelton's improvement...
Not good for user source code preservation...
This is the initial code
pips_internal_error("expression %s is not an integer constant.\n",
expression_to_string(exp));
Could be improved checking dependent and not dependent types...
pips_internal_error("expression %s is not an integer constant\n",
expression_to_string(exp));
This is another useless extension
Is it an integer "parameter" in Fortran, that is symbolic constants?
Should this be generalized to C const qualified variables?
I have doubt about this piece of code since the call is supposedly guarded by expression_constant_p()
pips_internal_error("expression %s is not an integer constant\n",
expression_to_string(exp));
pips_internal_error("expression %s is not an integer constant"
" in the sense of expression_constant_p()\n",
expression_to_string(exp));
exp | xp |
Definition at line 2205 of file expression.c.
References binary_call_lhs, call_function, constant_int, constant_int_p, entity_initial, entity_local_name(), ENTITY_UNARY_MINUS_P, ENTITY_UNARY_PLUS_P, EvalSizeofexpression(), exp, expression_call_p(), expression_constant_p(), expression_normalized, expression_syntax, free_value(), is_value_constant, is_value_intrinsic, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, pips_debug, pips_internal_error, symbolic_constant, syntax_call, syntax_call_p, syntax_sizeofexpression, TCST, value_constant, value_constant_p, value_symbolic, value_symbolic_p, value_tag, vect_coeff(), and vect_constant_p().
Referenced by adg_get_conjonctions(), analyze_expression(), array_indices_check(), array_size_stride(), compute_final_index_value(), convert_bound_expression(), effect_field_dimension_entity(), equal_must_vreference(), expression_equal_integer_p(), expression_null_p(), expression_plusplus(), expression_try_find_size(), find_target_position(), formal_variable_add_aliases(), incrementation_expression_to_increment(), loop_annotate(), loop_normalize_of_loop(), make_max_exp(), make_send_receive_conversion(), MakeEquivAtom(), opkill_may_vreference(), opkill_must_vreference(), points_to_compare_cell(), points_to_compare_cells(), points_to_compare_location(), points_to_compare_ptr_cell(), rational_op_exp(), references_do_not_conflict_p(), sentence_data_statement(), size_of_actual_array(), size_of_dummy_array(), subscript_value(), subscript_value_stride(), system_new_var_subst(), valuer(), and words_dimension().
Ppolynome expression_to_polynome | ( | expression | exp | ) |
===========================================================================
Ppolynome expression_to_polynome(expression exp): translates "exp" into a polynome. This transformation is feasible if "exp" contains only scalars and the four classical operations (+, -, *, /).
The translation is done straightforwardly and recursively.
it returns a POLYNOME_UNDEFINED if the conversion failed
This the resulting polynome
Two cases : _ a constant _ a "real" call, ie an intrinsic or external function
We should have a real null polynome : 0*TCST^1 AL, AC 04 11 93 else { Pmonome pm = (Pmonome) malloc(sizeof(Smonome)); monome_coeff(pm) = 0; monome_term(pm) = vect_new(TCST, 1); pp_new = monome_to_new_polynome(pm); }
The call must be one of the four classical operations: +, - (unary or binary), *, /
This call has one (unary minus) or two (binary plus, minus, multiply or divide) arguments, no less and no more.
arg1 + arg2
-arg2 + arg1
arg1 * arg2
arg1 / arg2
(ENTITY_UNARY_MINUS_P(op_ent)) : -arg1
exp | xp |
Definition at line 3650 of file expression.c.
References call_arguments, call_function, CAR, CDR, ENDP, ENTITY_DIVIDE_P, ENTITY_FIVE_OPERATION_P, entity_local_name(), ENTITY_MINUS_C_P, ENTITY_MINUS_P, ENTITY_MULTIPLY_P, ENTITY_PLUS_C_P, ENTITY_PLUS_P, entity_pointer_p(), entity_scalar_p(), entity_undefined, exp, EXPRESSION, expression_constant_p(), expression_syntax, expression_to_float(), expression_undefined, gen_length(), is_syntax_call, is_syntax_reference, make_polynome(), pips_internal_error, polynome_add(), polynome_div(), polynome_mult(), polynome_negate(), polynome_rm(), POLYNOME_UNDEFINED, POLYNOME_UNDEFINED_P, reference_indices, reference_variable, syntax_call, syntax_reference, and syntax_tag.
Referenced by edge_cost_polynome(), include_trans_in_poly(), plc_make_distance(), search_scc_bdt(), simplify_expression(), and size_of_regions().
reference expression_to_reference | ( | expression | e | ) |
Definition at line 212 of file expression.c.
References expression_syntax, message_assert, syntax_reference, and syntax_reference_p.
Referenced by continue_propagation_p(), handle_align_and_realign_directive(), and handle_distribute_and_redistribute_directive().
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
lr | r |
Definition at line 1263 of file expression.c.
References expression_syntax, and syntax_to_reference_list().
Referenced by array_indice_in_list_p(), check_loop_distribution_feasability(), effect_interference(), effects_interfere_p(), guess_late_read_effect_on_entity(), loop_nest_to_local_variables(), self_initialization_p(), syntax_to_reference_list(), and verify_used_before_set_call().
entity expression_variable | ( | expression | e | ) |
Assume e is a reference expression: expression_reference_p(e)==true
Definition at line 532 of file expression.c.
References expression_syntax, reference_variable, and syntax_reference.
Referenced by expression_null_p(), find_entities_to_wrap(), freia_extract_kernel(), freia_reduction_variable(), maybe_unroll_while_rwt(), proper_to_summary_simple_effect(), seq_rwt(), and variable_references_may_conflict_p().
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".
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". |
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 780 of file 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().
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 960 of file expression.c.
References constant_p(), 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().
map expression_to_entity on expressions
expressions | xpressions |
Definition at line 3161 of file expression.c.
References CONS, ENTITY, exp, EXPRESSION, expression_to_entity(), FOREACH, gen_nreverse(), and NIL.
Referenced by do_array_expansion(), do_solve_hardware_constraints_on_nb_proc(), generate_full_copy(), handle_independent_directive(), handle_reduction_directive(), rectangularization_region(), and statement_insertion_fix_access().
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
l_exprs,the | list of expressions to compute with the operator |
op,the | binary operator to apply |
l_exprs | _exprs |
op | p |
Definition at line 3544 of file 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(), make_send_receive_conversion(), and merge_conditions().
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 and to declared constants.
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?
This should be a constant, except for dependent types.
exp | xp |
Definition at line 2461 of file expression.c.
References call_arguments, call_function, cast_expression, const_variable_p(), constant_p(), copy_type(), entity_initial, entity_type, exp, EXPRESSION, expression_syntax, expression_to_type(), f(), FOREACH, free_type(), 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, sizeofexpression_expression, sizeofexpression_type, sizeofexpression_type_p, syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_tag, type_functional_p, type_undefined, ultimate_type(), value_expression, value_tag, and variable_length_array_type_p().
Referenced by dependent_type_p(), do_simdizer_init(), do_terapix_remove_divide(), redeclaration_enter_statement(), references_must_conflict_p(), and variable_length_array_type_p().
bool extended_integer_constant_expression_p | ( | expression | e | ) |
More extensive than next function.
Definition at line 858 of file expression.c.
References constant_int_p, EvalExpression(), free_value(), value_constant, and value_constant_p.
Referenced by constant_points_to_indices_p(), effect_to_store_independent(), incrementation_expression_to_increment(), opgen_may_vreference(), points_to_indices_to_subscript_indices(), proper_to_summary_simple_effect(), reference_to_points_to_translations(), reference_with_constant_indices_p(), reference_with_store_independent_indices(), reference_with_unbounded_indices_p(), and store_independent_points_to_indices_p().
bool extended_integer_constant_expression_p_to_int | ( | expression | e, |
int * | result | ||
) |
result | esult |
Definition at line 874 of file expression.c.
References constant_int, constant_int_p, EvalExpression(), free_value(), value_constant, and value_constant_p.
Referenced by perform_array_element_substitutions_in_transformer(), range_contains_at_least_one_point_p(), and range_contains_nothing_p().
bool false_expression_p | ( | expression | e | ) |
Definition at line 1118 of file expression.c.
References FALSE_OPERATOR_NAME, and operator_expression_p().
bool field_expression_p | ( | expression | e | ) |
The expression is of kind "a", where "a" is a field of some struct "s".
Definition at line 498 of file expression.c.
References entity_field_p(), expression_reference(), expression_reference_p(), and reference_variable.
Referenced by complete_points_to_reference_with_fixed_subscripts(), opkill_may_vreference(), and reference_with_constant_indices_p().
expression find_ith_argument | ( | list | args, |
int | n | ||
) |
args | rgs |
Definition at line 1147 of file expression.c.
References CAR, ENDP, EXPRESSION, expression_undefined, pips_assert, and POP.
Referenced by abc_with_allocation_size(), add_formal_to_actual_bindings(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), formal_and_actual_parameters_association(), fortran_user_call_to_transformer(), initial_code_abc_reference(), list_of_same_or_equivalence_arguments(), offset_in_caller(), same_dimension_p(), same_or_equivalence_argument_add_aliases(), size_of_actual_array(), subscript_value(), subscript_value_stride(), top_down_abc_call(), and translate_to_module_frame().
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
le | e |
Definition at line 1161 of file expression.c.
References CAR, ENDP, EXPRESSION, pips_assert, pips_internal_error, and POP.
Referenced by set_dimensions_of_local_variable_family().
expression float_to_expression | ( | float | c | ) |
Definition at line 1229 of file expression.c.
References call_to_expression(), float_to_entity(), make_call(), and NIL.
Referenced by complex_to_expression(), make_0val_expression(), make_1val_expression(), monome_to_expression(), and set_the_i().
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:
fs1 | constant fortran string (entity name is fine) |
fs2 | constant fortran string (entity name is fine) |
skip headers, trailers...
collating sequence comparison.
equal string header case.
fs1 | s1 |
fs2 | s2 |
Definition at line 101 of file expression.c.
References actual_fortran_string_to_compare(), and s1.
Referenced by constant_constraint_check().
void free_expressions | ( | list | el | ) |
Free a list of expressions.
el | l |
Definition at line 4084 of file expression.c.
References EXPRESSION, FOREACH, and free_expression().
Referenced by user_call_to_points_to_sinks().
Add a set of zero subscripts to a reference "r" by side effect.
Used when array names or partial array references have to to converted to the first array element.
zero_p | ero_p |
Definition at line 236 of file expression.c.
References CONS, DIMENSION, EXPRESSION, FOREACH, gen_nconc(), int_to_expression(), make_unbounded_expression(), NIL, pips_assert, reference_indices, type_variable, type_variable_p, and variable_dimensions.
Referenced by reference_add_unbounded_subscripts(), and reference_add_zero_subscripts().
bool iabs_expression_p | ( | expression | e | ) |
Definition at line 1036 of file expression.c.
References IABS_OPERATOR_NAME, and operator_expression_p().
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.
special hook for VALUE_MIN: the problem is that VALUE_MIN cannot be represented in the IR because -VALUE_MIN does not fit into and _int, so we replace it by VALUE_MIN -1, which is still big ...
Definition at line 1188 of file expression.c.
References call_to_expression(), entity_intrinsic(), exp, int_to_entity(), make_call(), MakeUnaryCall(), NIL, and UNARY_MINUS_OPERATOR_NAME.
Referenced by abc_with_allocation_size(), add_initialization_expression(), add_integer_to_expression(), add_prettyprint_control_list_to_declaration_statement(), 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_list(), array_access_to_array_ranges(), array_as_template(), array_indices_check(), array_indices_communication(), array_ranges_to_template_ranges(), array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), array_size_stride(), basic_update_reflhs_with_rhs_to_transformer(), bdt_save_int(), bdt_save_pred(), bottom_up_abc_expression_implied_do(), bound_generation(), bound_to_statement(), bounds_of_expression(), build_bdt_null(), build_call_STEP_init_regionArray(), build_first_comb(), build_flag_assign(), build_flag_test(), build_local_time_test(), build_third_comb(), c_convex_effects_on_actual_parameter_forward_translation(), c_dim_string(), C_loop_range(), c_text_entity(), call_nary_rwt(), check_loop_distribution_feasability(), code_generation(), comEngine_generate_procCode(), compile_master(), compile_one_reduction(), compile_reduction(), complementary_range(), complete_points_to_reference_with_fixed_subscripts(), complex_bound_generation(), compute_final_index_value(), compute_receive_content(), compute_receive_domain(), constant_image_p(), constant_reference_to_normalized_constant_reference(), constraints_to_loop_bound(), contraintes_to_expression(), convert_bound_expression(), create_counter(), create_externalized_function_common(), create_pointer_to_array_stub_points_to(), create_stub_points_to(), CreateLogicalUnits(), cstr_args_check(), ctx_generate_new_statement_cluster_dependant(), dag_normalize(), dag_simplify(), DeclarePointer(), define_node_processor_id(), dimension_to_range(), distance_between_entity(), distance_between_expression(), do_brace_expression_to_statements(), do_brace_expression_to_updated_type(), do_gather_all_expressions(), do_group_constants_terapix(), do_group_count_elements(), do_group_count_elements_reduce(), do_isolate_statement_preconditions_satisified_p(), do_linearize_array_reference(), do_linearize_prepatch(), do_linearize_prepatch_subscript(), do_linearize_prepatch_type(), do_linearize_type(), do_loop_expansion(), do_loop_expansion_init(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_simdizer_auto_tile_int_to_list(), do_solve_hardware_constraints_on_nb_proc(), do_solve_hardware_constraints_on_volume(), do_symbolic_tiling(), do_terapix_remove_divide(), dynamic_alias_check_flt(), ecrit_une_var(), ecrit_une_var_neg(), edge_cost_polynome(), effects_to_dma(), enclose_in_a_parallel_loop(), 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(), flow_sensitive_malloc_to_points_to_sinks(), free_guards(), full_loop_unroll(), fusion(), fusion_buffer(), gen_mpi_send_recv(), generate_call_get_workchunk_loopbounds(), generate_call_set_regionarray(), generate_code(), generate_compact(), generate_copy_loop_nest(), generate_fifo_stat(), generate_full_copy(), generate_ind_fifo_stat2(), generate_io_wp65_code(), generate_loop_workchunk(), generate_mmcd_stat_from_ref(), generate_monome(), generate_one_message(), generate_prelude(), generate_remapping_guard(), generate_stat_from_ref_list_proc(), generate_stat_from_ref_list_proc_list(), generate_subarray_shift(), GenerateReturn(), generic_effect_find_aliases_with_simple_pointer_values(), generic_reference_add_fixed_subscripts(), get_complement_expression(), get_fifo_from_ref(), get_indExp_from_ref(), get_sizeofexpression_for_region(), gfc2pips_array_ref2indices(), gfc2pips_code2instruction_(), gfc2pips_get_list_of_dimensions2(), gfc2pips_int2dimension(), gfc2pips_vars_(), heap_intrinsic_to_post_pv(), 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(), initialization_list_to_statements(), InitializeEnumMemberValues(), inline_statement_crawler(), interprocedural_abc_arrays(), intrinsic_call_to_points_to(), live_mapping_expression(), loop_annotate(), loop_flt(), loop_nest_to_wp65_code(), loop_normalize_of_loop(), loop_strip_mine(), lower_bound_generation(), make_0val_expression(), make_1val_expression(), make_abc_count_statement(), make_array_bounds(), make_bound_expression(), make_bounds(), make_c_stop_statement(), make_condition_from_loop(), make_constraint_expression(), make_datum_movement(), make_emulated_shared_variable(), make_exec_mmcd(), make_exit_statement(), make_expression_with_state_variable(), make_factor_expression(), make_global_common_and_initialize(), make_guard_expression(), make_increment_instruction(), make_increment_statement(), make_init_newInd_stat(), make_lInitStats(), make_list_of_constant(), make_list_of_flags(), make_loadsave_statement(), make_loop_skeleton(), make_lSwitchStats(), make_max_exp(), make_maxval_expression(), make_minval_expression(), make_mmcd_load_store_stat(), make_movement_scalar_wp65(), make_movements_loop_body_wp65(), make_mypos_expression(), make_new_simd_vector_with_prefix(), make_op_exp(), make_rational_exp(), make_reduction_vector_entity(), make_reindex(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_send_receive_conversion(), make_set_rc_statement(), make_shuffle_statement(), make_special_value(), make_state_variable_assignement_statement(), make_step_inc_statement(), make_toggle_inc_statement(), make_toggle_init_statement(), make_toggle_mmcd(), make_transStat(), make_unbounded_dimensions(), make_vecteur_expression(), make_zero_expression(), MakeArithmIfInst(), MakeAssignedOrComputedGotoInst(), MakeAtom(), MakeDataValueSet(), MakeDimension(), MakeForloop(), MakeIoFileArray(), MakeIoInstA(), MakeWhileDoInst(), malloc_arg_to_type(), merge_lists(), module_initial_parameter_pv(), monome_to_expression(), mpic_make_args_mpi_send_or_receiv(), ndf_normalized_test(), new_local_image_variable(), NewDeclarationOfDistributedArray(), normalize_integer_constant_expression(), normalize_test_leaves(), NormalizeOneTemplateDistribution(), offset_array_reference(), offset_in_caller(), offset_of_struct(), offset_points_to_cell(), original_malloc_to_abstract_location(), outliner_extract_loop_bound(), outliner_patch_parameters(), outliner_smart_references_computation(), overlap_redefine_expression(), parallel_tiling(), perform_array_element_substitutions_in_transformer(), phi_free_contraints_to_expressions(), points_to_cell_types_compatibility(), points_to_cell_update_last_subscript(), polynome_to_expression(), pragma_build_if_condition(), predicate_to_expression(), prepare_array_bounds(), prgm_mapping(), promote_statement(), propagate_constant_image(), psystem_to_expression(), ram_variable_add_aliases(), range_to_expression(), rational_op_exp(), rational_sol_edit(), re_do_it(), reference_add_field_dimension(), reference_add_zero_subscript(), reference_complete_with_zero_subscripts(), reference_filter(), reference_offset(), reference_to_points_to_sinks(), reference_to_points_to_translations(), regenerate_expression(), region_to_address(), region_to_minimal_dimensions(), rename_reduction_ref_walker(), replace_reductions_in_statement(), safe_static_domain_bound(), same_or_equivalence_argument_add_aliases(), save_int(), save_pred(), sc_delimiter(), sc_opposite_exp_of_conjunction(), sesamify(), set_array_status_to_target(), set_dimensions_of_local_variable_family(), shape_one_message(), simdizer_auto_tile(), simplified_reference(), simplify_complex_entity(), simplify_complex_expression(), simplify_dimension(), simplify_relational_expression(), size_of_actual_array(), size_of_dummy_array(), size_of_regions(), SizeOfDimension(), SizeOfDimensions(), split_complex_expression(), sprintf_check_expression(), st_compute_current_computer(), st_compute_current_owners(), st_compute_neighbour(), statement_compute_bounds(), step_local_loopSlices(), step_local_regionArray(), step_parameter(), storage_ram_offset(), subscript_expressions_to_constant_subscript_expressions(), subscript_value(), subscript_value_stride(), substitute_and_create(), substitute_struct_stub_in_transformer(), systeme_to_loop_nest(), template_ranges_to_processors_ranges(), test_bound_generation(), Tiling2_buffer(), Tiling_buffer_allocation(), tiling_transformation(), top_down_abc_dimension(), type_to_array_type(), unary_into_binary_ref(), unary_intrinsic_call_to_points_to_sinks(), update_indices_for_local_computation(), update_operator_to_post_pv(), update_range(), upper_bound_generation(), usual_loop_tiling(), Value_to_expression(), variable_initial_expression(), variable_to_dimensions(), verify_array_element(), verify_array_variable(), verify_scalar_variable(), and words_dimension().
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 903 of file expression.c.
References call_arguments, call_function, CAR, CDR, ENTITY_PLUS_C_P, ENTITY_PLUS_P, EXPRESSION, expression_syntax, integer_constant_p(), integer_symbolic_constant_p(), syntax_call, and syntax_call_p.
Referenced by full_define_p(), get_final_offset(), integer_constant_expression_value(), integer_divide_to_transformer(), integer_right_shift_to_transformer(), make_send_receive_conversion(), sentence_data_statement(), signed_integer_constant_expression_p(), and test_working_false().
int integer_constant_expression_value | ( | expression | e | ) |
Definition at line 1545 of file expression.c.
References integer_constant_expression_p(), pips_assert, and signed_integer_constant_expression_value().
Referenced by c_text_related_entities(), full_define_p(), get_final_offset(), integer_divide_to_transformer(), and integer_right_shift_to_transformer().
bool integer_expression_p | ( | expression | e | ) |
Definition at line 601 of file expression.c.
References basic_int_p, basic_of_expression(), and free_basic().
Referenced by fix_if_condition(), and points_to_cell_to_upper_bound_points_to_cells().
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 541 of file expression.c.
References expression_reference_p(), expression_syntax, reference_variable, and syntax_reference.
Referenced by incrementation_expression_to_increment().
void local_assign_expression | ( | expression | caller, |
expression | field | ||
) |
replace expression caller
by expression field
, where field
is contained by caller
caller | aller |
field | ield |
Definition at line 3571 of file expression.c.
References expression_normalized, expression_syntax, free_normalized(), free_syntax(), and syntax_undefined.
Referenced by simplify_minmax_expression().
bool logical_expression_p | ( | expression | e | ) |
A logical expression is either one of the following:
NN: In fact, I didn't use the PIPS function : basic_of_expression because of 2 reasons :
The case of symbolic name of a logical constant is not treated here
Definition at line 610 of file expression.c.
References basic_logical_p, call_function, debug(), entity_type, expression_syntax, FALSE_OPERATOR_NAME, functional_result, is_syntax_call, is_syntax_range, is_syntax_reference, logical_operator_expression_p(), operator_expression_p(), pips_debug, pips_internal_error, reference_variable, relational_expression_p(), syntax_call, syntax_reference, syntax_tag, TRUE_OPERATOR_NAME, type_functional, type_variable, and variable_basic.
Referenced by fix_if_condition(), and MakeWhileDoInst().
bool logical_operator_expression_p | ( | expression | e | ) |
C xor is missing.
Logical operators are : .NOT.,.AND.,.OR.,.EQV.,.NEQV.
Definition at line 573 of file 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, and syntax_call.
Referenced by logical_expression_p(), number_of_operators_flt(), and simplify_boolean_expression_with_precondition().
expression make_address_of_expression | ( | expression | e | ) |
generate a newly allocated expression for &(e)
Definition at line 3956 of file expression.c.
References ADDRESS_OF_OPERATOR_NAME, call_arguments, call_function, CAR, copy_expression(), CreateIntrinsic(), ENTITY_DEREFERENCING_P, EXPRESSION, expression_call(), expression_call_p(), gen_length(), MakeUnaryCall(), and pips_assert.
Referenced by declaration_to_post_pv(), gen_mpi_send_recv(), make_send_receive_conversion(), mpi_initialize(), mpic_make_args_mpi_send_or_receiv(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), and mpic_make_mpi_init().
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.
lhs | must be a reference |
rhs | is the expression to assign |
RK: this assert should be relaxed to deal with *p and so on. pips_assert("Need a reference as lhs", expression_reference_p(lhs));
lhs | hs |
rhs | hs |
Definition at line 390 of file expression.c.
References ASSIGN_OPERATOR_NAME, CreateIntrinsic(), and MakeBinaryCall().
Referenced by do_loop_nest_unswitching(), and do_loop_to_for_loop().
expression make_call_expression | ( | entity | e, |
list | l | ||
) |
Build an expression that call an function entity with an argument list.
e | is the function entity to call |
l | is the list of argument expressions given to the function to call |
Definition at line 321 of file expression.c.
References call_to_expression(), and make_call().
Referenced by alloc_instrumentation(), compile_reduction(), constraints_to_loop_bound(), expression_plusplus(), gfc2pips_symbol2data_instruction(), hpfc_compute_lid(), init_c_implicit_variables(), make_addition(), make_bin_expression(), make_C_print_statement(), make_false_expression(), make_special_value(), make_stop_statement(), make_strlen_expression(), make_test_condition(), make_true_expression(), MakeBinaryCall(), MakeBraceExpression(), MakeCommaExpression(), MakeDataStatement(), MakeDataValueSet(), MakeForloop(), MakeFunctionExpression(), MakeNullaryCall(), MakeTernaryCall(), MakeUnaryCall(), sprintf_check_expression(), and step_function().
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
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
build expressions for the lower and upper bounds
index | ndex |
Definition at line 1748 of file expression.c.
References c_language_module_p(), CONS, entity_domain, entity_intrinsic(), entity_undefined, EXPRESSION, gen_find_tabulated(), get_bool_property(), get_current_module_entity(), int_to_expression(), is_syntax_call, make_call(), make_expression(), make_syntax(), make_vecteur_expression(), NIL, normalized_undefined, pips_assert, PIPS_C_DIV_OPERATOR_NAME, 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(), and make_contrainte_expression().
expression make_contrainte_expression | ( | Pcontrainte | pc, |
Variable | index | ||
) |
A wrapper around make_constraint_expression() for compatibility.
Simply call the function on the vector in the constrain system:
pc | c |
index | ndex |
Definition at line 1815 of file expression.c.
References make_constraint_expression(), and Scontrainte::vecteur.
Referenced by free_guards().
expression make_entity_expression | ( | entity | e, |
cons * | inds | ||
) |
inds | nds |
Definition at line 176 of file expression.c.
References entity_constant_p, make_call(), make_reference(), make_syntax_call(), make_syntax_reference(), NIL, syntax_to_expression(), and syntax_undefined.
Referenced by alloc_instrumentation(), assign_tmp_to_exp(), atomizer_of_external(), build_flag_assign(), build_flag_test(), build_global_time_test_with_exp(), build_local_time_test(), build_third_comb(), cstr_args_check(), distribute_code(), edge_cost_polynome(), expression_try_find_size(), find_tmp_of_exp(), gen_mpi_send_recv(), get_sp_of_call_p(), loop_header(), loop_inc(), loop_normalize_of_loop(), loop_test(), make_array_communication_statement(), make_com_loopbody(), make_communication_statement(), make_increment_instruction(), make_init_time(), make_loadsave_statement(), make_send_receive_conversion(), make_start_ru_module(), mpi_finalize(), mpi_initialize(), mpic_make_args_mpi_send_or_receiv(), mpic_make_mpi_comm_rank(), mpic_make_mpi_comm_size(), mpic_make_mpi_init(), put_source_ind(), sprintf_check_expression(), and task_time_polynome().
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
coeff | oeff |
vari | ari |
Definition at line 1631 of file expression.c.
References entity_intrinsic(), entity_to_expression(), int_to_expression(), MakeBinaryCall(), and MULTIPLY_OPERATOR_NAME.
Referenced by ecrit_une_var(), icm_loop_rwt(), and make_vecteur_expression().
expression make_false_expression | ( | void | ) |
Definition at line 1108 of file expression.c.
References FALSE_OPERATOR_NAME, is_basic_logical, make_call_expression(), MakeConstant(), and NIL.
Referenced by simplify_boolean_expression_with_precondition().
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. exp1 and exp2 are freed
Pvecteur_to_expression() is a function that rebuilds an expression from a Pvecteur.
op_ent | p_ent |
exp1 | xp1 |
exp2 | xp2 |
Definition at line 2147 of file expression.c.
References debug(), ENTITY_MINUS_P, ENTITY_PLUS_P, expression_normalized, free_expression(), normalized_complex_p, normalized_linear, pips_internal_error, Pvecteur_to_expression(), vect_add(), vect_substract(), and VECTEUR_NUL.
Referenced by make_op_exp(), and rational_op_exp().
of expression
the length of the created list
val | al |
number | the constant value |
Definition at line 3369 of file 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(), and translate_to_module_frame().
expression make_max_expression | ( | expression | e1, |
expression | e2, | ||
enum language_utype | lang | ||
) |
e1 | 1 |
e2 | 2 |
lang | ang |
Definition at line 1579 of file expression.c.
References C_LESS_THAN_OPERATOR_NAME, CONDITIONAL_OPERATOR_NAME, copy_expression(), entity_intrinsic(), expression_undefined, is_language_c, MakeBinaryCall(), MakeTernaryCall(), and MAX_OPERATOR_NAME.
Referenced by loop_annotate().
expression make_min_expression | ( | expression | e1, |
expression | e2, | ||
enum language_utype | lang | ||
) |
e1 | 1 |
e2 | 2 |
lang | ang |
Definition at line 1600 of file expression.c.
References C_LESS_THAN_OPERATOR_NAME, CONDITIONAL_OPERATOR_NAME, copy_expression(), entity_intrinsic(), expression_undefined, is_language_c, MakeBinaryCall(), MakeTernaryCall(), and MIN_OPERATOR_NAME.
Referenced by loop_annotate().
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 int_to_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 !
pips_debug(5, "begin OP EXP : %s %s %s\n",
words_to_string(words_expression(exp1, NIL)),
op_name,
words_to_string(words_expression(exp2, NIL)));
we compute here as FORTRAN would do
We need to know the integer linearity of both expressions.
dividing by one or minus one is similar to multiplying
ENTITY_MULTIPLY_P(op_ent) || ENTITY_DIVIDE_P(op_ent)
pips_debug(5, "end OP EXP : %s\n",
words_to_string(words_expression(result_exp, NIL)));
op_name | p_name |
exp1 | xp1 |
exp2 | xp2 |
Definition at line 2012 of file expression.c.
References copy_expression(), 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(), int_to_expression(), intptr_t, make_entity_fullname(), make_lin_op_exp(), MakeBinaryCall(), MakeUnaryCall(), MINUS_OPERATOR_NAME, NORMALIZE_EXPRESSION, normalized_linear_p, pips_debug, TOP_LEVEL_MODULE_NAME, UNARY_MINUS_OPERATOR_NAME, and user_error.
Referenced by add_integer_to_expression(), ajoute_constante(), ajoute_new_var(), bdt_save_pred(), build_third_comb(), C_loop_range(), calloc_to_abstract_location(), compute_final_index_value(), contraintes_to_expression(), distance_between_entity(), distance_between_expression(), do_gather_all_expressions(), do_group_constants_terapix(), do_group_count_elements_reduce(), do_grouping_replace_reference_by_expression_walker(), do_linearize_array_reference(), do_linearize_type(), do_loop_expansion(), do_loop_expansion_init(), do_sizeofdimension_reduction(), do_solve_hardware_constraints_on_nb_proc(), do_symbolic_tiling(), do_terapix_warmup_patching(), ecrit_une_var(), ecrit_une_var_neg(), generate_call_get_workchunk_loopbounds(), heap_intrinsic_to_post_pv(), initialization_list_to_statements(), loop_annotate(), loop_normalize_of_loop(), loop_strip_mine(), malloc_arg_to_type(), monome_to_expression(), ndf_normalized_test(), normalize_test_leaves(), offset_of_struct(), partial_eval_min_or_max_operator(), polynome_to_expression(), put_source_ind(), range_to_expression(), rational_sol_edit(), reference_offset(), region_to_minimal_dimensions(), save_pred(), sc_opposite_exp_of_conjunction(), sesamify(), simplify_minmax_expression(), SizeOfDimension(), try_reorder_expression_call(), and whileloop_to_complexity().
expression make_ref_expr | ( | entity | ent, |
list | args | ||
) |
ent | nt |
args | rgs |
Definition at line 4316 of file expression.c.
References is_syntax_reference, make_expression(), make_reference(), make_syntax(), and normalized_undefined.
Referenced by do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), and full_loop_unroll().
expression make_subscript_expression | ( | expression | a, |
list | sl | ||
) |
sl | l |
Definition at line 397 of file expression.c.
References make_subscript(), make_syntax_subscript(), and syntax_to_expression().
expression make_true_expression | ( | void | ) |
Definition at line 1103 of file expression.c.
References is_basic_logical, make_call_expression(), MakeConstant(), NIL, and TRUE_OPERATOR_NAME.
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(), alias_check_scalar_variable_in_caller_flt(), alias_check_two_array_variables_in_caller(), alias_check_two_scalar_variables_in_caller(), alias_check_two_scalar_variables_in_module(), expression_less_than_in_context(), insert_flag_before_call_site(), insert_test_before_caller(), make_true_array_dimension_bound_test(), simplify_boolean_expression_with_precondition(), top_down_abc_call(), and top_down_abc_dimension().
expression make_unbounded_expression | ( | void | ) |
Definition at line 4339 of file expression.c.
References CreateIntrinsic(), MakeNullaryCall(), and UNBOUNDED_DIMENSION_NAME.
Referenced by array_formal_parameter_to_stub_points_to(), binary_arithmetic_operator_to_post_pv(), binary_intrinsic_call_to_points_to_sinks(), complete_points_to_reference_with_fixed_subscripts(), create_pointer_to_array_stub_points_to(), effect_interference(), effect_may_union(), effect_must_union(), effect_to_store_independent(), generic_reference_add_fixed_subscripts(), make_unbounded_dimensions(), make_unbounded_subscripts(), MakeDimension(), malloc_arg_to_type(), module_initial_parameter_pv(), offset_array_reference(), offset_points_to_cell(), points_to_cell_to_upper_bound_points_to_cells(), points_to_cell_types_compatibility(), points_to_cell_update_last_subscript(), points_to_indices_to_subscript_indices(), points_to_indices_to_unbounded_indices(), proper_to_summary_simple_effect(), reference_with_store_independent_indices(), simple_pv_may_union(), simple_pv_must_union(), simplified_reference(), struct_assignment_to_points_to(), struct_variable_to_pointer_locations(), struct_variable_to_pointer_subscripts(), subscript_expressions_to_constant_subscript_expressions(), type_to_array_type(), and update_operator_to_post_pv().
FI: this piece of code must have been duplicated somewhere else in an effect library.
Definition at line 4346 of file expression.c.
References CONS, EXPRESSION, make_unbounded_expression(), and NIL.
Referenced by cells_to_read_or_write_effects().
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 SG: added support for generation of C operator when needed
let us avoid -1*var, we prefer -var
choose among C or fortran operator depending on the entity type this limits the use of +C and -C to pointer arithmetic
pv | v |
Definition at line 1650 of file expression.c.
References ABS, call_to_expression(), compare_Pvecteur(), CONS, entity_intrinsic(), entity_pointer_p(), EXPRESSION, int_to_expression(), make_call(), make_factor_expression(), MakeBinaryCall(), MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, NIL, pips_assert, PLUS_C_OPERATOR_NAME, PLUS_OPERATOR_NAME, TCST, UNARY_MINUS_OPERATOR_NAME, 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(), phi_free_contraints_to_expressions(), predicate_to_expression(), psystem_to_expression(), put_source_ind(), Pvecteur_to_assign_statement(), Pvecteur_to_expression(), reduce_loop_bound(), reference_conversion_computation(), test_bound_generation(), upper_bound_generation(), vect_to_string(), and vectors_to_expressions().
expression make_zero_expression | ( | void | ) |
Make a zero expression.
It is useful compared to int_to_expression(0) because it is much easier to search in source text.
Definition at line 1212 of file expression.c.
References int_to_expression().
Referenced by array_formal_parameter_to_stub_points_to(), create_scalar_stub_sink_cell(), find_points_to_subscript_for_type(), generic_reference_to_transformer(), pointer_source_to_sinks(), and subscript_to_points_to_sinks().
expression MakeBinaryCall | ( | entity | f, |
expression | eg, | ||
expression | ed | ||
) |
Creates a call expression to a function with 2 arguments.
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 |
eg | g |
ed | d |
Definition at line 354 of file expression.c.
References CONS, EXPRESSION, f(), make_call_expression(), and NIL.
Referenced by any_basic_update_operation_to_transformer(), any_basic_update_to_transformer_list(), any_update_to_transformer_list(), array_scalar_access_to_bank_communication(), basic_update_reflhs_with_rhs_to_transformer(), binary_arithmetic_operator_to_post_pv(), bound_to_statement(), buffer_full_condition(), c_dim_string(), c_reference(), call_rwt(), compile_master(), compute_final_index_value(), constraints_to_loop_bound(), convert_bound_expression(), ctx_generate_new_statement_cluster_dependant(), derived_formal_parameter_to_stub_points_to(), dimensions_to_dma(), do_array_to_pointer_walk_expression(), do_brace_expression_to_statements(), do_expression_reduction(), do_loop_expansion(), do_loop_to_for_loop(), do_loop_to_while_loop(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_reduction_atomization(), do_solve_hardware_constraints_on_nb_proc(), do_split_structure(), do_terapix_remove_divide(), do_terapix_warmup_patching(), expand_call(), expr_compute_local_index(), expression_list_to_binary_operator_call(), fix_if_condition(), gen_if_rank(), generate_monome(), get_allocatable_data_expr(), gfc2pips_buildCaseTest(), gfc2pips_code2instruction_(), gfc2pips_dumpSELECT(), gfc2pips_expr2expression(), gfc2pips_reduce_repeated_values(), gfc2pips_symbol2data_instruction(), guard_expanded_statement(), heap_intrinsic_to_post_pv(), 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_factor_expression(), make_fields_assignment_instruction(), make_increment_statement(), make_max_exp(), make_max_expression(), make_min_expression(), make_movements_loop_body_wp65(), make_op_exp(), make_scalar_communication_module(), make_scanning_over_tiles(), make_start_ru_module(), make_vecteur_expression(), MakeArithmIfInst(), MakeAssignedOrComputedGotoInst(), MakeComplexConstantExpression(), MakeDimension(), MakeFortranBinaryCall(), makeTransfertSizeExpression(), MakeWhileDoInst(), ndf_normalized_test(), normalize_test_leaves(), outliner_extract_loop_bound(), overlap_redefine_expression(), partial_eval_binary_operator_old(), partial_eval_mult_operator(), partial_eval_plus_or_minus_operator(), Pcontrainte_to_expression_list(), phi_free_contraints_to_expressions(), predicate_to_expression(), psystem_to_expression(), rational_op_exp(), regenerate_expression(), region_to_address(), region_to_minimal_dimensions(), sc_conditional(), sc_opposite_exp_of_conjunction(), sesamify(), simdizer_auto_tile(), simplify_complex_expression(), split_complex_expression(), split_update_call(), st_send_to_computer_if_necessary(), step_local_regionArray(), string_to_expression(), terapix_normalize_tests(), translate_to_module_frame(), typedef_formal_parameter_to_stub_points_to(), unsugared_loop_inc(), unsugared_loop_test(), update_indices_for_local_computation(), update_operation_to_transformer(), update_range(), update_reflhs_with_rhs_to_transformer(), update_test_condition(), and words_dimension().
expression MakeBraceExpression | ( | list | l | ) |
Definition at line 3927 of file expression.c.
References BRACE_INTRINSIC, CreateIntrinsic(), and make_call_expression().
expression MakeCastExpression | ( | type | t, |
expression | e | ||
) |
exp = (t) e
Definition at line 3911 of file expression.c.
References exp, make_cast(), make_expression(), make_syntax_cast(), and normalized_undefined.
Referenced by cast_STEP_ARG().
expression MakeCommaExpression | ( | list | l | ) |
Definition at line 3918 of file expression.c.
References CAR, COMMA_OPERATOR_NAME, CreateIntrinsic(), ENDP, EXPRESSION, expression_undefined, gen_length(), and make_call_expression().
Referenced by MakeArrayExpression(), and MakeWhileLoop().
expression MakeNullaryCall | ( | entity | f | ) |
Creates a call expression to a function with zero arguments.
f | is the function entity to call |
Definition at line 331 of file expression.c.
References f(), make_call_expression(), and NIL.
Referenced by bool_to_expression(), 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_simple_Fortran_io_instruction(), make_unbounded_expression(), MakeAtom(), MakeCharacterConstantExpression(), and MakeSimpleIoInst1().
expression MakeSizeofExpression | ( | expression | e | ) |
exp = sizeof(e)
Definition at line 3896 of file expression.c.
References exp, make_expression(), make_sizeofexpression_expression(), make_syntax_sizeofexpression(), and normalized_undefined.
Referenced by get_sizeofexpression_for_region().
expression MakeSizeofType | ( | type | t | ) |
exp = sizeof(t)
Definition at line 3904 of file expression.c.
References exp, make_expression(), make_sizeofexpression_type(), make_syntax_sizeofexpression(), and normalized_undefined.
Referenced by get_sizeofexpression_for_region().
expression MakeTernaryCall | ( | entity | f, |
expression | e1, | ||
expression | e2, | ||
expression | e3 | ||
) |
Creates a call expression to a function with 3 arguments.
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 |
e1 | 1 |
e2 | 2 |
e3 | 3 |
Definition at line 367 of file expression.c.
References CONS, EXPRESSION, f(), make_call_expression(), and NIL.
Referenced by expr_compute_local_index(), make_max_expression(), make_min_expression(), and make_phi_assign_instruction().
expression MakeUnaryCall | ( | entity | f, |
expression | a | ||
) |
Creates a call expression to a function with one argument.
f | is the function entity to call |
a | is the argument expression given to the function to call |
Definition at line 342 of file expression.c.
References CONS, EXPRESSION, f(), make_call_expression(), and NIL.
Referenced by binary_arithmetic_operator_to_post_pv(), binary_intrinsic_call_to_points_to_sinks(), call_STEP_subroutine3(), compute_final_index_value(), dag_normalize(), dereference_expression(), dimensions_to_dma(), do_array_to_pointer_walk_expression(), do_linearize_array_manage_callers(), do_outliner_smart_replacment(), do_terapix_argument_handler(), ecrit_une_var_neg(), expr_compute_local_index(), generate_compact(), generate_monome(), get_expression_addr(), heap_intrinsic_to_post_pv(), if_conv_init_statement(), incrementation_expression_to_increment(), initialization_list_to_statements(), inline_expression_call(), int_to_expression(), intrinsic_call_to_points_to(), make_address_of_expression(), make_op_exp(), make_substitution(), MakeArithmIfInst(), MakeFortranUnaryCall(), normalize_microcode(), normalize_test_leaves(), outliner_patch_parameters(), outliner_smart_references_computation(), rational_op_exp(), recover_structured_while(), regenerate_expression(), region_to_address(), replace_reductions_in_statement(), scalopify(), simplify_complex_expression(), st_make_nice_test(), static_controlize_statement(), string_to_expression(), translate_to_module_frame(), and update_range().
bool max0_expression_p | ( | expression | e | ) |
Definition at line 1061 of file expression.c.
References MAX0_OPERATOR_NAME, MAX_OPERATOR_NAME, and operator_expression_p().
bool min0_expression_p | ( | expression | e | ) |
Definition at line 1054 of file expression.c.
References MIN0_OPERATOR_NAME, MIN_OPERATOR_NAME, and operator_expression_p().
bool modulo_expression_p | ( | expression | e | ) |
Definition at line 1006 of file expression.c.
References MODULO_OPERATOR_NAME, and operator_expression_p().
expression monome_to_expression | ( | Pmonome | pm | ) |
converts a monome to an expression
pm | m |
Definition at line 3589 of file expression.c.
References DIVIDE_OPERATOR_NAME, entity_to_expression(), exp, expression_undefined, expression_undefined_p, float_to_expression(), int_to_expression(), make_op_exp(), monome_coeff, monome_term, MONOME_UNDEFINED_P, MULTIPLY_OPERATOR_NAME, TCST, term(), VECTEUR_NUL_P, vecteur_succ, vecteur_val, vecteur_var, and x.
Referenced by polynome_to_expression().
void normalize_subscript_expression | ( | expression | e | ) |
Normalization of subscript in expressions.
The C parser generates no more than one index in each subscript construct:
subscript = array:expression x indices:expression* ; syntax = reference + range + call + cast + sizeofexpression
If the array expression points to a multidimensional array, the indices list should be as long as possible, compatible with the array dimension.
e (expression) | es (syntax) | esub (subscript) / \ / \ a il -> -> (indices list) | \ as \ | \ asub \ / \ \ / \ \ sa sil -> -> ->
The recursive normalization function works bottom up and, when facing the pattern above, concatenate the il index list (or a sublist) to the sil list. If the il list becomes empty, e is connected directly to as and the pieces of data structure es, esub and a are removed.
gen_recurse() is used to apply the transformation on the way up in expression trees. In the C parser, the transformation is applied to a module statement and to the initialization expressions present in the declarations.
Definition at line 4407 of file expression.c.
References array_type_dimension(), array_type_p(), CDR, ENDP, expression_syntax, expression_to_concrete_type(), free_syntax(), free_type(), gen_nconc(), int, NIL, pointer_type_p(), POP, subscript_array, subscript_indices, syntax_subscript, syntax_subscript_p, syntax_undefined, and type_to_pointed_type().
Referenced by expression_normalize_subscripts(), and statement_normalize_subscripts().
bool operator_expression_p | ( | expression | e, |
string | op_name | ||
) |
op_name | p_name |
Definition at line 1087 of file expression.c.
References call_function, entity_local_name(), expression_syntax, 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(), true_expression_p(), and unary_minus_expression_p().
expression pointer_reference_to_expression | ( | reference | r | ) |
Assume p is a pointer.
Compute expression "*(p+i)" from reference r = "p[i]".
rsl is fully copied into two sub-lists: the effective array indices and then the pointer indices.
We build a proper reference to an element of p
We build the equivalent pointer arithmetic expression
Definition at line 4004 of file expression.c.
References binary_intrinsic_expression, CAR, CONS, copy_expression(), DEREFERENCING_OPERATOR_NAME, ENDP, entity_basic_concrete_type(), EXPRESSION, FOREACH, gen_length(), gen_nreverse(), int, make_reference(), NIL, pips_assert, PLUS_C_OPERATOR_NAME, POP, reference_indices, reference_to_expression(), reference_variable, type_variable, unary_intrinsic_expression, and variable_dimension_number().
Referenced by pointer_reference_dereferencing_to_points_to(), and pointer_reference_to_points_to_sinks().
expression polynome_to_expression | ( | Ppolynome | pp | ) |
converts a polynomial to expression
pp | p |
Definition at line 3622 of file expression.c.
References expression_undefined, expression_undefined_p, int_to_expression(), make_op_exp(), monome_to_expression(), PLUS_OPERATOR_NAME, polynome_monome, POLYNOME_NUL_P, polynome_succ, and POLYNOME_UNDEFINED_P.
Referenced by do_group_statement_constant(), do_solve_hardware_constraints_on_volume(), edge_cost_polynome(), and simplify_expression().
bool power_expression_p | ( | expression | e | ) |
Definition at line 1018 of file expression.c.
References operator_expression_p(), and POWER_OPERATOR_NAME.
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?
var | ar |
Definition at line 1720 of file 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().
expression Pvecteur_to_expression | ( | Pvecteur | vect | ) |
AP, sep 25th 95 : some usefull functions moved from static_controlize/utils.c.
rather use make_vecteur_expression which was already there
vect | ect |
Definition at line 1825 of file expression.c.
References make_vecteur_expression().
Referenced by analyze_expression(), build_first_comb(), build_third_comb(), do_gather_all_expressions_perms(), do_terapix_warmup_patching(), free_guards(), fusion(), fusion_buffer(), Hierarchical_tiling(), include_trans_on_LC_in_ref(), make_lin_op_exp(), make_reindex(), outliner_smart_references_computation(), prgm_mapping(), reconfig_expression(), simplify_dimension(), simplify_relational_expression(), Tiling2_buffer(), Tiling_buffer_allocation(), and translate_to_module_frame().
r1 | 1 |
r2 | 2 |
Definition at line 1522 of file expression.c.
References expression_equal_p(), range_increment, range_lower, and range_upper.
Referenced by free_guards(), and syntax_equal_p().
Definition at line 300 of file expression.c.
References generic_reference_add_fixed_subscripts().
Referenced by points_to_cell_add_fixed_subscripts().
void reference_add_zero_subscript | ( | reference | r | ) |
No check on reference r.
This may generate an illegal reference if not called properly
Definition at line 267 of file expression.c.
References CONS, EXPRESSION, gen_nconc(), int_to_expression(), NIL, and reference_indices.
Referenced by points_to_cell_add_zero_subscript().
Definition at line 261 of file expression.c.
References generic_reference_add_fixed_subscripts().
Referenced by anywhere_source_to_sinks(), points_to_cell_add_fixed_subscripts(), points_to_cell_types_compatibility(), reference_add_field_dimension(), and struct_assignment_to_points_to().
void reference_complete_with_zero_subscripts | ( | reference | r | ) |
Reference r to an array maybe partial, as is possible in C: with declaration "int a[10][10]", references "a", "a[i]" and "a[i][j]" are all legal.
The subscript list of reference r is completed with 0 subscript to reference an array element.
Definition at line 278 of file expression.c.
References CONS, DIMENSION, entity_basic_concrete_type(), EXPRESSION, FOREACH, gen_length(), gen_nconc(), int_to_expression(), NIL, pips_assert, POP, reference_indices, reference_variable, type_variable, type_variable_p, and variable_dimensions.
Referenced by points_to_cell_complete_with_zero_subscripts().
r1 | 1 |
r2 | 2 |
Definition at line 1500 of file expression.c.
References entity_field_p(), expression_equal_p(), gen_equals(), reference_indices, reference_variable, and same_field_entity_p().
Referenced by adg_write_reference_list(), attach_ref_to_stat(), build_successors_with_rhs(), call_flt(), cell_equal_p(), check_alias_args(), 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(), dmas_invert_p(), do_expression_reduction(), do_reduction_atomization(), do_reduction_detection(), do_reduction_propagation(), effect_sup_difference(), 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(), opkill_may_reference(), opkill_must_reference(), perform_substitution_in_expression(), points_to_cell_equal_p(), potential_reduction_substitution_valid_p(), process_ref_lists(), reduction_in_statement_walker(), ref_subs_in_exp(), reference_conflicting_p(), reference_conflicting_test_and_update(), reference_dependence_variable_check_and_add(), reference_in_list_p(), reference_list_update(), rename_reduction_ref_walker(), same_reduction_p(), similarity(), stats_has_rw_conf_p(), and syntax_equal_p().
expression reference_offset | ( | reference | ref | ) |
computes the offset of a C reference with its origin
iterate on the dimensions & indices to create the index expression
there may be more dimensions than indices
there may be more indices than dimensions
ref | ef |
Definition at line 3807 of file expression.c.
References CAR, copy_expression(), DIMENSION, dimension_lower, dimension_size(), dimension_upper, ENDP, entity_type, EXPRESSION, FOREACH, indices, int_to_expression(), make_op_exp(), MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, PLUS_OPERATOR_NAME, POP, ref, reference_indices, reference_variable, type_variable, ultimate_type(), and variable_dimensions.
Referenced by do_group_constants_terapix(), do_grouping_replace_reference_by_expression_walker(), and sreference_offset().
This function returns true if Reference r is scalar.
Definition at line 3530 of file expression.c.
References assert, entity_scalar_p(), NIL, reference_indices, reference_undefined_p, and reference_variable.
Referenced by call_instruction_to_communications(), do_reduction_propagation(), first_reference_certainly_includes_second_reference_p(), guess_potential_reduction(), loop_nest_movement_generation(), loop_nest_to_wp65_code(), partial_eval_update_operators(), and references_must_conflict_p().
expression reference_to_expression | ( | reference | r | ) |
Definition at line 196 of file expression.c.
References is_syntax_reference, make_expression(), make_syntax(), and normalize_reference().
Referenced by alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_variable_in_caller_flt(), bound_to_statement(), conflict_is_a_real_conflict_p(), define_node_processor_id(), do_brace_expression_to_statements(), do_expression_reduction(), do_group_constants_terapix(), do_reduction_atomization(), do_reduction_propagation(), entity_to_expression(), expand_points_to_domain(), 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(), initialization_list_to_statements(), initialize_array_variable(), live_mapping_expression(), loop_annotate(), make_abc_count_statement(), make_check_io_statement(), make_com_loopbody(), make_lInitStats(), make_list_of_flags(), make_loadsave_statement(), make_lSwitchStats(), make_mypos_expression(), make_phi_assign_instruction(), make_read_loopbody(), make_reference_expression(), make_statement_copy_i(), make_write_loopbody(), MakeArrayExpression(), outliner_smart_references_computation(), pointer_reference_to_expression(), pointer_subscript_to_expression(), process_true_call_stat(), reference_to_address_entity(), replace_array_ref_with_fifos(), replace_array_ref_with_fifos2(), replace_reductions_in_statement(), 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(), struct_assignment_to_points_to(), struct_initialization_to_points_to(), Tiling_buffer_allocation(), translate_to_module_frame(), and verify_array_variable().
Definition at line 3022 of file expression.c.
References constant_p(), EXPRESSION, extended_integer_constant_expression_p(), field_expression_p(), FOREACH, and reference_indices.
Referenced by store_independent_effect_p(), and store_independent_reference_p().
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 3045 of file 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(), and reference_to_points_to_sinks().
indices can be constant or unbounded: they are store independent.
See next function, reference_with_unbounded_subscript_p()
Definition at line 3066 of file expression.c.
References EXPRESSION, extended_integer_constant_expression_p(), FOREACH, reference_indices, and unbounded_expression_p().
See if the reference uses the unbounded function '*'.
See previous function, reference_with_unbounded_indices_p()
Definition at line 3085 of file expression.c.
References EXPRESSION, FOREACH, reference_indices, and unbounded_expression_p().
Referenced by generic_apply_effect_to_transformer().
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
r1 | 1 |
r2 | 2 |
Definition at line 1888 of file expression.c.
References CAR, ENDP, EXPRESSION, expression_constant_p(), expression_to_int(), gen_length(), POP, reference_indices, reference_variable, and s1.
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 587 of file expression.c.
References call_function, ENTITY_RELATIONAL_OPERATOR_P, expression_call_p(), expression_syntax, and syntax_call.
Referenced by logical_expression_p(), simplify_relational_expression(), and trivial_expression_p().
expression replace_expression_content | ( | expression | e1, |
expression | e2 | ||
) |
Use side effects to move the content of e2, s2 and n2, into e1; s1 and n1 are freed, as well as e2.
This is useful if you need to keep the handle on e1. e1 is returned, although it is redundant.
e1 | 1 |
e2 | 2 |
Definition at line 3864 of file expression.c.
References expression_normalized, expression_syntax, free_expression(), free_normalized(), free_syntax(), normalized_undefined, s1, and syntax_undefined.
Referenced by simplify_boolean_expression_with_precondition().
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.
le | e |
Definition at line 557 of file expression.c.
References EXPRESSION, f(), MAP, and same_expression_p().
Referenced by add_array_dimension_bound_test(), add_array_test(), expression_in_array_subscript(), top_down_abc_array(), and top_down_abc_call().
bool same_expression_p | ( | expression | e1, |
expression | e2 | ||
) |
this is slightly different from expression_equal_p, as it will return true for a+b vs b+a
lazy normalization.
e1 | 1 |
e2 | 2 |
Definition at line 1426 of file expression.c.
References expression_equal_p(), expression_normalized, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_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(), expression_equal_in_context_p(), expression_in_array_subscript(), full_define_p(), interprocedural_abc_arrays(), make_loadsave_statement(), outliner_smart_references_computation(), prune_singleton(), same_dimension_p(), same_expression_in_list_p(), size_of_actual_array(), subscript_value(), subscript_value_stride(), substitute_expression_walker(), and try_reorder_expression_call().
bool signed_integer_constant_expression_p | ( | expression | e | ) |
Definition at line 932 of file expression.c.
References binary_call_lhs, call_function, entity_domain, expression_syntax, gen_find_tabulated(), integer_constant_expression_p(), make_entity_fullname(), syntax_call, syntax_call_p, TOP_LEVEL_MODULE_NAME, and UNARY_MINUS_OPERATOR_NAME.
Referenced by signed_integer_constant_expression_value().
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 1551 of file expression.c.
References NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, normalized_undefined, pips_assert, pips_internal_error, signed_integer_constant_expression_p(), TCST, VALUE_TO_INT, vect_coeff(), vect_constant_p(), and x.
Referenced by integer_constant_expression_value().
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. And so may do a condition c? (void *) 0 : (void *) 0.
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 2814 of file 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_COMMA_P, ENTITY_CONDITIONAL_P, entity_intrinsic(), entity_local_name(), ENTITY_MINUS_C_P, ENTITY_PLUS_C_P, entity_type, entity_user_name(), EXPRESSION, expression_constant_p(), expression_syntax, f(), FOREACH, 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, MINUS_OPERATOR_NAME, pips_debug, pips_internal_error, pips_user_warning, PLUS_OPERATOR_NAME, range_increment, range_lower, range_upper, reference_variable, syntax_call, syntax_range, syntax_reference, syntax_tag, type_functional, type_undefined_p, type_variable, type_variable_p, ultimate_type(), and variable_basic.
Referenced by MakeForloop().
bool simplify_expression | ( | expression * | pexp | ) |
use polynomials to simplify an expression in some cases this operation can change the basic of the expression.
E.g. n/4 -> .25 * n In that case we just undo the simplification
pexp | exp |
Definition at line 3770 of file expression.c.
References basic_equal_p(), basic_of_expression(), exp, expression_to_polynome(), expression_undefined_p, free_basic(), free_expression(), polynome_rm(), polynome_to_expression(), and POLYNOME_UNDEFINED_P.
Referenced by distance_between_expression(), do_simplify_expressions(), loop_annotate(), and simd_loop_unroll().
void simplify_expressions | ( | void * | obj | ) |
obj | bj |
Definition at line 3801 of file expression.c.
References call_domain, do_simplify_expressions(), gen_recurse, and gen_true().
Referenced by optimize_expressions().
expression size_of_actual_array | ( | entity | actual_array, |
list | l_actual_ref, | ||
int | i | ||
) |
{
fprintf(stderr, "\n Size of actual array without subscript value \n");
print_expression(e);
}
{
fprintf(stderr, "\n j = %d \n",j);
fprintf(stderr, "\n prod : \n");
print_expression(prod);
fprintf(stderr, "\n sum =: \n");
print_expression(sum);
}
{
fprintf(stderr, "\n Size of actual array - subscript value : \n");
print_expression(e);
}
{
fprintf(stderr, "\n Size of actual array:\n");
print_expression(e);
}
actual_array | ctual_array |
l_actual_ref | _actual_ref |
Definition at line 4197 of file expression.c.
References binary_intrinsic_expression, copy_expression(), dimension_lower, dimension_upper, entity_type, expression_constant_p(), expression_to_int(), expression_undefined, expression_undefined_p, find_ith_argument(), find_ith_dimension(), fprintf(), gen_length(), ifdebug, int_to_expression(), MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, NIL, PLUS_OPERATOR_NAME, same_expression_p(), sum(), type_variable, and variable_dimensions.
Referenced by interprocedural_abc_arrays().
bool sizeofexpression_equal_p | ( | sizeofexpression | s0, |
sizeofexpression | s1 | ||
) |
s0 | 0 |
s1 | 1 |
Definition at line 1446 of file expression.c.
References expression_equal_p(), s1, sizeofexpression_expression, sizeofexpression_expression_p, sizeofexpression_type, sizeofexpression_type_p, and type_equal_p().
Referenced by syntax_equal_p().
void statement_normalize_subscripts | ( | statement | s | ) |
To be used for module statements.
Definition at line 4471 of file expression.c.
References expression_domain, gen_recurse, gen_true(), and normalize_subscript_expression().
Referenced by actual_c_parser().
Does this reference define the same set of memory locations regardless of the current (environment and) memory state?
This function copes with standard references, extended to pointer references such as p[i], not with general points-to references, which are extended to cope with structs and implicit dereferencing. Points-to references are/should be handled in effects-util, not in ri-util.
Definition at line 3108 of file expression.c.
References entity_type, pointer_type_p(), reference_variable, reference_with_constant_indices_p(), and ultimate_type().
Referenced by basic_update_reflhs_with_rhs_to_transformer(), generic_reference_to_transformer(), opkill_may_reference(), and opkill_must_reference().
list struct_initialization_expression_to_expressions | ( | expression | e | ) |
Returns a list of expressions hidden by the brace function.
First cut: FI not too sure about recursive calls to the brace function.
Definition at line 4073 of file expression.c.
References C_initialization_expression_p(), call_arguments, expression_syntax, pips_assert, and syntax_call.
Referenced by struct_initialization_to_points_to().
bool sub_expression_p | ( | expression | e | ) |
Definition at line 991 of file expression.c.
References MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, and operator_expression_p().
Referenced by incrementation_expression_to_increment().
s1 | 1 |
s2 | 2 |
Definition at line 1495 of file expression.c.
References expression_equal_p(), gen_equals(), s1, subscript_array, and subscript_indices.
Referenced by syntax_equal_p().
make a full copy of the subscript expression list, preserve constant subscripts, replace non-constant subscript by the star subscript expression.
sl | l |
Definition at line 3981 of file expression.c.
References CONS, constant_int, constant_int_p, EvalExpression(), EXPRESSION, expression_undefined, FOREACH, gen_nreverse(), int_to_expression(), make_unbounded_expression(), NIL, value_constant, and value_constant_p.
Referenced by reference_dereferencing_to_points_to(), and subscript_to_points_to_sinks().
expression subscript_value_stride | ( | entity | arr, |
list | l_inds | ||
) |
{
pips_debug(4,"\nStride of subscript value:");
print_expression(retour);
}
arr | rr |
l_inds | _inds |
Definition at line 4127 of file expression.c.
References binary_intrinsic_expression, copy_expression(), dimension_lower, dimension_upper, ENDP, entity_type, expression_constant_p(), expression_equal_integer_p(), expression_to_int(), expression_undefined, expression_undefined_p, find_ith_argument(), find_ith_dimension(), gen_length(), int_to_expression(), MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, PLUS_OPERATOR_NAME, same_expression_p(), SizeOfElements(), type_variable, variable_basic, and variable_dimensions.
Referenced by add_aliases_for_current_call_site(), 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(), dynamic_alias_check_flt(), offset_in_caller(), and same_or_equivalence_argument_add_aliases().
|
static |
Definition at line 2750 of file expression.c.
References call_function, ctx_substitute::new, ctx_substitute::old, and same_entity_p().
Referenced by substitute_entity_in_expression().
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 gen_context_multi_recurse done in r22231 Modify the entry expression e by side effect
old | entity to replace |
new | entity that will replace old |
e | expression in will the entity old will be replaced |
old | ld |
new | ew |
Definition at line 2792 of file expression.c.
References call_domain, gen_context_multi_recurse(), gen_true(), ctx_substitute::new, ctx_substitute::old, reference_domain, substitute_entity_in_call(), and substitute_variable_in_reference().
expression substitute_entity_variable_in_expression | ( | entity | old, |
entity | new, | ||
expression | e | ||
) |
(This function isn't use for the moment) This function replaces all the occurrences of an old entity in the expression exp by the new entity.
It returns the expression modified. It replaces only entity when it's an variable. So a recurse can be made on reference to replace the entity. (to not consider only variable entity have to make a special case for call, call_function) Modify the entry expression e by side effect
old | entity to replace |
new | entity that will replace old |
e | expression in will the entity old will be replaced |
old | ld |
new | ew |
Definition at line 2772 of file expression.c.
References gen_context_recurse, gen_true2(), ctx_substitute::new, ctx_substitute::old, reference_domain, and substitute_variable_in_reference().
|
static |
Definition at line 2741 of file expression.c.
References ctx_substitute::new, ctx_substitute::old, reference_variable, and same_entity_p().
Referenced by substitute_entity_in_expression(), and substitute_entity_variable_in_expression().
bool substraction_expression_p | ( | expression | e | ) |
Test if an expression is an substraction.
Definition at line 1000 of file expression.c.
References MINUS_C_OPERATOR_NAME, MINUS_OPERATOR_NAME, and operator_expression_p().
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 130 of file 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, syntax_call, and syntax_call_p.
s1 | 1 |
s2 | 2 |
Definition at line 1462 of file expression.c.
References call_equal_p(), cast_equal_p(), 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(), s1, sizeofexpression_equal_p(), subscript_equal_p(), syntax_call, syntax_cast, syntax_range, syntax_reference, syntax_sizeofexpression, syntax_subscript, and syntax_tag.
Referenced by expression_equal_p().
expression syntax_to_expression | ( | syntax | s | ) |
generates an expression from a syntax
Definition at line 3581 of file expression.c.
References make_expression(), and normalized_undefined.
Referenced by initialization_list_to_statements(), isolate_patch_reference(), make_entity_expression(), and make_subscript_expression().
lr | r |
Definition at line 1270 of file expression.c.
References application_arguments, application_function, call_arguments, CAR, cast_expression, CONS, EXPRESSION, expression_to_reference_list(), f(), FOREACH, gen_nconc(), 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_internal_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().
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
fprintf(stderr, "Normalizes of expression:");
print_expression(e);
print_normalized(n1);
print_normalized(n2);
}
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 679 of file 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, NORMALIZE_EXPRESSION, normalized_linear, normalized_linear_p, relational_expression_p(), syntax_call, 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().
bool true_expression_p | ( | expression | e | ) |
Definition at line 1113 of file expression.c.
References operator_expression_p(), and TRUE_OPERATOR_NAME.
Referenced by add_array_dimension_bound_test(), alias_check_array_and_scalar_variable_in_caller_flt(), alias_check_array_variable_in_caller_flt(), insert_test_before_caller(), insert_test_before_statement(), make_bottom_up_abc_tests(), make_interprocedural_abc_tests(), and top_down_abc_array().
bool unary_minus_expression_p | ( | expression | e | ) |
Definition at line 1030 of file expression.c.
References operator_expression_p(), and UNARY_MINUS_OPERATOR_NAME.
Referenced by expression_opposite_p().
bool unbounded_dimension_p(dim) input : a dimension of an array entity.
output : true if the last dimension is unbounded (*), false otherwise. modifies : nothing comment :
dim | im |
Definition at line 1130 of file expression.c.
References call_function, dimension_upper, entity_local_name(), expression_syntax, same_string_p, syntax_call, syntax_call_p, and UNBOUNDED_DIMENSION_NAME.
Referenced by array_bounded_p(), assumed_size_array_p(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_reference(), build_call_STEP_init_regionArray(), C_pointer_type_p(), C_type_to_pointed_type(), entity_unbounded_p(), subscript_to_points_to_sinks(), top_down_abc_call(), top_down_abc_dimension(), and words_dimension().
Definition at line 4323 of file expression.c.
References entity_local_name(), f(), same_string_p, and UNBOUNDED_DIMENSION_NAME.
Referenced by store_independent_points_to_indices_p(), and unbounded_expression_p().
bool unbounded_expression_p | ( | expression | e | ) |
Definition at line 4329 of file expression.c.
References call_function, expression_syntax, f(), syntax_call, syntax_call_p, and unbounded_entity_p().
Referenced by any_expression_to_transformer(), array_references_may_conflict_p(), cell_is_xxx_p(), cell_reference_compare(), compatible_points_to_subscripts_p(), constant_reference_to_normalized_constant_reference(), do_brace_expression_to_updated_type(), effect_to_store_independent(), equal_must_vreference(), exact_points_to_subscript_list_p(), expression_to_points_to_sinks_with_offset(), flow_sensitive_malloc_to_points_to_sinks(), generic_atomic_points_to_reference_p(), malloc_arg_to_type(), module_initial_parameter_pv(), old_effects_conflict_p(), opkill_may_vreference(), opkill_must_vreference(), points_to_indices_to_subscript_indices(), points_to_indices_to_unbounded_indices(), points_to_reference_included_p(), points_to_subscripts_to_number_of_unbounded_dimensions(), proper_to_summary_simple_effect(), reference_to_points_to_translations(), reference_unbounded_indices_p(), reference_with_unbounded_indices_p(), reference_with_unbounded_subscript_p(), refine_points_to_cell_subscripts(), simple_cell_reference_preceding_p(), simple_cells_inclusion_p(), simple_cells_intersection_p(), unique_location_cell_p(), variable_references_may_conflict_p(), words_range(), and words_subscript_range().
void update_expression_syntax | ( | expression | e, |
syntax | s | ||
) |
frees expression syntax of e
and replace it by the new syntax s
Definition at line 3564 of file expression.c.
References expression_syntax, free_syntax(), and unnormalize_expression().
Referenced by cleanup_subscript_pre(), convert_pointer_to_array(), convert_pointer_to_array_aux(), do_array_to_pointer_patch_call_expression(), do_array_to_pointer_walk_call_and_patch(), do_array_to_pointer_walk_expression(), do_atomize_call(), do_expression_reduction(), do_linearize_pointer_is_expression(), do_linearize_prepatch_subscript(), do_linearize_remove_dereferencment_walker(), do_loop_nest_unswitching(), do_reduction_atomization(), do_simplify_constant_address_expression(), do_symbolic_tiling(), do_terapix_loop_optimizer(), isolate_patch_reference(), partial_eval_syntax(), perform_substitution_in_expression(), rename_op(), replace_entities_expression_walker(), replace_entity_by_expression_expression_walker(), replace_subscript(), simplify_subscript(), substitute_expression_walker(), terapix_normalize_tests(), and try_reorder_expression_call().
Test if a call is a user call.
Definition at line 4361 of file expression.c.
References call_function, entity_initial, f(), and value_code_p.
Referenced by copy_from_call(), copy_to_call(), costly_task(), look_for_user_call(), pragma_scop(), and statement_contains_user_call_p().
bool user_function_call_p | ( | expression | e | ) |
Definition at line 1068 of file expression.c.
References call_function, entity_initial, expression_syntax, f(), syntax_call, syntax_call_p, and value_code_p.
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 1251 of file expression.c.
References int_to_expression(), and VALUE_TO_INT.
Referenced by array_access_to_array_ranges(), constraints_to_loop_bound(), do_solve_hardware_constraints_on_nb_proc(), 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().
bool zero_expression_p | ( | expression | e | ) |
Definition at line 1217 of file expression.c.
References call_function, expression_call(), expression_call_p(), f(), and int_to_entity().
Referenced by binary_intrinsic_call_to_points_to_sinks(), make_send_receive_conversion(), offset_points_to_cell(), points_to_translation_of_formal_parameters(), and reference_to_points_to_translations().
|
static |
Definition at line 2719 of file expression.c.
Referenced by davinci_dump_all_expressions(), and expr_flt().