25 #include "pips_config.h"
47 #include "resources.h"
114 for(
size_t i=0;i<2;i++)
188 if(!
ENDP(curr_block))
198 if(!
ENDP(curr_block))
347 debug_on(
"IF_CONVERSION_INIT_DEBUG_LEVEL");
350 pips_debug(1,
"Code before if_conversion_init:\n");
358 pips_debug(1,
"Code after if_conv_init_statement:\n");
368 pips_debug(1,
"Code after copying from fake statement:\n");
int get_int_property(const string)
expression copy_expression(expression p)
EXPRESSION.
statement copy_statement(statement p)
STATEMENT.
test make_test(expression a1, statement a2, statement a3)
extension make_extension_pragma(pragma _field_)
instruction make_instruction_test(test _field_)
call copy_call(call p)
CALL.
pragma make_pragma_string(string _field_)
void free_statement(statement p)
bool clean_up_sequences(statement s)
Recursively clean up the statement sequences by fusing them if possible and by removing useless one.
struct _newgen_struct_statement_ * statement
Ppolynome complexity_polynome(complexity comp)
Because complexity is composed of two elements, we use this function to get the first element : polyn...
complexity load_statement_complexity(statement)
void reset_complexity_map(void)
void set_complexity_map(statement_mapping)
void split_update_call(call c)
#define call_constant_p(C)
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
statement make_block_statement(list)
Make a block statement from a list of statement.
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
statement make_empty_block_statement(void)
Build an empty statement (block/sequence)
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.
entity set_current_module_entity(entity)
static.c
gen_chunk * gen_get_recurse_current_ancestor(void)
Get the ancestor of the current object.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
#define ENDP(l)
Test if a list is empty.
list gen_nreverse(list cp)
reverse a list in place
#define NIL
The empty list (nil in Lisp)
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 FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
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.
test statement_test(statement)
Get the test of a statement.
bool statement_test_p(statement)
statement update_statement_instruction(statement, instruction)
Replace the instruction in statement s by instruction i.
void insert_statement_no_matter_what(statement, statement, bool)
Break the IR consistency or, at the very least, do not insert new declarations at the usual place,...
static void update_test_condition(test t, expression cond)
adds
static statement atomize_condition(statement cs)
atomize the condition of a test and returns generated statements
static bool check_if_conv_test(test t, bool *success)
checks if a test statement is suitable for if conversion, that is it only contains sequence of assign...
static statement do_transform_if_statements(statement branch, expression cond)
merge content of a test with the test itself
static statement make_if_converted_test_statement(expression cond, statement branch)
create a test statement with appropriate extension and a test under cond with a single true branch br...
static void if_conv_init_statement(statement stat)
static bool check_if_conv_call(call c, bool *success)
accept if conversion if the call is an assignment call
static bool check_if_conv_walker(instruction i, bool *success)
static bool check_if_conv(statement stat)
checks if if conversion can be performed on test statement
bool if_conversion_init(char *mod_name)
if_conversion_init.c
struct _newgen_struct_control_ * control
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_user_warning
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
float polynome_TCST(Ppolynome pp)
float polynome_TCST(Ppolynome pp) returns the constant term of polynomial pp.
bool polynome_constant_p(Ppolynome pp)
bool polynome_constant_p(Ppolynome pp) return true if pp is a constant polynomial (including null pol...
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 ENTITY_ASSIGN_P(e)
#define statement_block_p(stat)
#define INSTANCE_OF(type, value)
polymorhism thanks to newgen !
#define ENTITY_CONTINUE_P(e)
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define is_instruction_block
soft block->sequence transition
#define make_statement_list(stats...)
easy list constructor
#define NOT_OPERATOR_NAME
#define make_empty_statement
An alias for make_empty_block_statement.
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression MakeUnaryCall(entity f, expression a)
Creates a call expression to a function with one argument.
bool expression_reference_p(expression e)
Test if an expression is a reference.
entity make_new_scalar_variable(entity, basic)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define instruction_domain
newgen_functional_domain_defined
#define EXTENSION(x)
EXTENSION.
#define instruction_tag(x)
#define statement_extensions(x)
#define control_successors(x)
#define test_condition(x)
#define statement_instruction(x)
#define instruction_call(x)
#define extensions_extension(x)
#define instruction_test(x)
#define statement_undefined_p(x)
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
#define IF_TO_CONVERT
if conversion
statement simd_atomize_this_expression(entity(*create)(entity, basic), expression e)
returns the assignment statement if moved, or NULL if not.
The structure used to build lists in NewGen.
A gen_chunk is used to store every object.