25 #include "pips_config.h"
44 #include "resources.h"
98 return !has_write_effect_p;
193 pips_assert(
"stat is a call or a sequence statement",
221 bool something_bad_p=
false;
290 debug_on(
"IF_CONVERSION_DEBUG_LEVEL");
311 if(
ENDP(conditions)) {
341 for(
int i=0;i<(
int)(
sizeof(hs)/
sizeof(hs[0]));i++) {
381 if(!
ENDP(toremove)) {
clone_context make_clone_context(entity a1, entity a2, list a3, statement a4)
void free_clone_context(clone_context p)
expression copy_expression(expression p)
EXPRESSION.
reference make_reference(entity a1, list a2)
test make_test(expression a1, statement a2, statement a3)
instruction make_instruction_test(test _field_)
call copy_call(call p)
CALL.
void free_expression(expression p)
reference copy_reference(reference p)
REFERENCE.
void free_statement(statement p)
static reference ref
Current stmt (an integer)
void const char const char const int
callees compute_callees(const statement stat)
Recompute the callees of a module statement.
statement clone_statement(statement s, clone_context cc)
clone_statement.c
struct _newgen_struct_statement_ * statement
bool effects_write_at_least_once_p(list)
list expression_to_proper_effects(expression)
const char * module_name(const char *s)
Return the module part of an entity name.
char * get_string_property(const char *)
void statement_split_initializations(statement s)
Recurse through the statements of s and split local declarations.
void split_update_call(call c)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
void gen_full_free_list(list l)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
statement get_current_module_statement(void)
Get the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
gen_chunk * gen_get_ancestor(int, const void *)
return the first ancestor object found of the given type.
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_assign_instruction(expression l, expression r)
#define ENDP(l)
Test if a list is empty.
void gen_remove(list *cpp, const void *o)
remove all occurences of item o from list *cpp, which is thus modified.
void gen_remove_once(list *pl, const void *o)
Remove the first occurence of o in list pl:
#define NIL
The empty list (nil in Lisp)
list gen_copy_seq(list l)
Copy a list structure.
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
list statement_block(statement)
Get the list of block statements of a statement sequence.
loop statement_loop(statement)
Get the loop of a statement.
bool statement_loop_p(statement)
statement update_statement_instruction(statement, instruction)
Replace the instruction in statement s by instruction i.
void insert_statement(statement, statement, bool)
This is the normal entry point.
extension get_extension_from_statement_with_pragma(statement, const char *)
Get the extension of a statement with pragma beginning with a prefix.
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
static void if_conv_statement(statement cs)
static void do_loop_nest_unswitching(statement st, list *conditions)
bool loop_nest_unswitching(const char *module_name)
static bool process_true_call_stat(expression cond, statement stat)
converts statement stat into a phi-statement if possible
static void process_true_stat(statement parent, expression cond, statement stat)
static statement do_loop_nest_unswitching_purge(statement adam, list conditions)
bool if_conversion(char *mod_name)
if_conversion.c
static instruction make_phi_assign_instruction(reference lRef, expression cond, expression ref1, expression ref2)
creates a phi-instruction using the entity given in property the generated instruction as the form lR...
static bool simd_supported_stat_p(statement stat)
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define pips_internal_error
bool set_belong_p(const set, const void *)
void print_statement(statement)
Print a statement on stderr.
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define GREATER_THAN_OPERATOR_NAME
#define binary_call_rhs(c)
#define ENTITY_ASSIGN_P(e)
#define NORMALIZE_EXPRESSION(e)
#define statement_block_p(stat)
#define binary_intrinsic_expression(name, e1, e2)
#define call_to_statement(c)
#define binary_call_lhs(c)
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity module_name_to_runtime_entity(const char *name)
similar to module_name_to_entity but generates a warning and a stub if the entity is not found
set get_referenced_entities(void *elem)
retrieves the set of entities used in elem beware that this entities may be formal parameters,...
expression reference_to_expression(reference r)
bool expression_minmax_p(expression e)
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
call expression_call(expression e)
void update_expression_syntax(expression e, syntax s)
frees expression syntax of e and replace it by the new syntax s
bool expression_reference_p(expression e)
Test if an expression is a reference.
expression make_assign_expression(expression lhs, expression rhs)
Make an assign expression, since in C the assignment is a side effect operator.
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
expression MakeTernaryCall(entity f, expression e1, expression e2, expression e3)
Creates a call expression to a function with 3 arguments.
basic basic_of_expression(expression)
basic basic_of_expression(expression exp): Makes a basic of the same basic as the expression "exp".
entity make_new_scalar_variable(entity, basic)
void AddEntityToCurrentModule(entity)
Add a variable entity to the current module declarations.
entity make_new_scalar_variable_with_prefix(const char *, entity, basic)
Create a new scalar variable of type b in the given module.
basic basic_of_reference(reference)
Retrieves the basic of a reference in a newly allocated basic object.
#define instruction_sequence_p(x)
#define syntax_reference(x)
#define normalized_complex_p(x)
#define reference_variable(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define basic_undefined_p(x)
#define EXPRESSION(x)
EXPRESSION.
#define instruction_undefined
#define expression_undefined
#define expression_normalized(x)
#define statement_extensions(x)
#define instruction_call_p(x)
#define test_condition(x)
#define statement_instruction(x)
#define instruction_call(x)
#define extensions_extension(x)
#define call_arguments(x)
#define instruction_test(x)
#define statement_undefined_p(x)
#define expression_syntax(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define IF_TO_CONVERT
if conversion
FI: I do not understand why the type is duplicated at the set level.
The structure used to build lists in NewGen.