PIPS
|
#include <stdio.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "misc.h"
#include "properties.h"
Go to the source code of this file.
Functions | |
static void | atomize_object (gen_chunk *) |
void atomize_as_required(stat, ref_decide, call_decide, test_decide, range_decide, while_decide, new) statement stat; bool (*ref_decide)(ref r, expression e); bool (*call_decide)(call r, expression e); bool (*test_decide)(test t, expression e); bool (*range_decide)(range r, expression e), bool (*while_decide)(whileloop w, expression e), entity (*new)(entity m, basic b); More... | |
static void | simple_atomize_error_handler () |
the stack of the encoutered statements is maintained to be able to insert the needed computations just before the very last statement encountered. More... | |
static void | insert_before_current_statement (statement s) |
s is inserted before the current statement. More... | |
statement | atomize_this_expression (entity(*create)(entity, basic), expression e) |
returns the assignment statement is moved, or NULL if not. More... | |
static void | compute_before_current_statement (expression *pe) |
static void | ref_rwt (reference r) |
static void | call_rwt (call c) |
static void | exp_range_rwt (range r, expression *pe) |
static void | range_rwt (range r) |
static void | test_rwt (test t) |
static void | whileloop_rwt (whileloop w) |
static void | cleanup_subscript (expression e) |
static void | cleanup_subscript_pre (expression exp) |
void | cleanup_subscripts (void *obj) |
void | atomize_as_required (statement stat, bool(*ref_decide)(reference, expression), bool(*call_decide)(call, expression), bool(*test_decide)(test, expression), bool(*range_decide)(range, expression), bool(*while_decide)(whileloop, expression), entity(*new)(entity, basic)) |
Variables | |
static bool(* | ref_atomize_decision )() = NULL |
static functions used More... | |
static bool(* | call_atomize_decision )() = NULL |
static bool(* | test_atomize_decision )() = NULL |
static bool(* | range_atomize_decision )() = NULL |
static bool(* | while_atomize_decision )() = NULL |
static entity(* | create_new_variable )() = NULL |
void atomize_as_required | ( | statement | stat, |
bool(*)(reference, expression) | ref_decide, | ||
bool(*)(call, expression) | call_decide, | ||
bool(*)(test, expression) | test_decide, | ||
bool(*)(range, expression) | range_decide, | ||
bool(*)(whileloop, expression) | while_decide, | ||
entity(*)(entity, basic) | new | ||
) |
stat | tat |
call_decide | reference |
test_decide | call |
range_decide | test |
while_decide | range |
new | whileloop |
Definition at line 392 of file simple_atomize.c.
References atomize_object(), call_atomize_decision, create_new_variable, ifdebug, pips_debug, print_statement(), range_atomize_decision, ref_atomize_decision, reset_hooks_register(), reset_hooks_unregister(), simple_atomize_error_handler(), test_atomize_decision, and while_atomize_decision.
Referenced by normalize_wp65_code(), and NormalizeCodeForHpfc().
|
static |
void atomize_as_required(stat, ref_decide, call_decide, test_decide, range_decide, while_decide, new) statement stat; bool (*ref_decide)(ref r, expression e); bool (*call_decide)(call r, expression e); bool (*test_decide)(test t, expression e); bool (*range_decide)(range r, expression e), bool (*while_decide)(whileloop w, expression e), entity (*new)(entity m, basic b);
atomizes the given statement as driven by the given functions. ??? does not care of any side effect and so.
CONTROL
STATEMENT
REFERENCE
TEST
CALL
RANGE
WHILELOOP
Definition at line 375 of file simple_atomize.c.
References call_domain, call_rwt(), cleanup_subscripts(), control_domain, gen_multi_recurse(), gen_true(), range_domain, range_rwt(), ref_rwt(), reference_domain, statement_domain, test_domain, test_rwt(), whileloop_domain, and whileloop_rwt().
Referenced by atomize_as_required().
statement atomize_this_expression | ( | entity(*)(entity, basic) | create, |
expression | e | ||
) |
returns the assignment statement is moved, or NULL if not.
it does not make sense to atomize a range...
Definition at line 181 of file simple_atomize.c.
References AddEntityToCurrentModule(), basic_of_expression(), basic_overloaded_p, basic_undefined_p, call_arguments, call_function, copy_basic(), copy_syntax(), ENTITY_PLUS_C_P, ENTITY_PLUS_P, ENTITY_PLUS_UPDATE_P, EXPRESSION, expression_call(), expression_call_p(), expression_constant_p(), expression_syntax, FOREACH, free_basic(), get_bool_property(), get_current_module_entity(), ifdebug, make_assign_statement(), make_expression(), make_reference(), make_syntax_reference(), NIL, normalize_all_expressions_of(), normalized_undefined, out, pips_debug, print_expression(), ref, and syntax_range_p.
Referenced by atom_cse_expression(), atomize_or_associate_for_level(), compute_before_current_statement(), and do_atomize_if_different_level().
|
static |
(panic mode:-)
syntax saved = expression_syntax(*pe);
atomize_object(saved);
Definition at line 252 of file simple_atomize.c.
References call_arguments, call_atomize_decision, call_function, compute_before_current_statement(), entity_local_name(), IMPLIED_DO_NAME, MAPL, REFCAR, and same_string_p.
Referenced by atomize_object().
|
static |
the subscript could be a reference !
update reference with additionnal indices
prepare to free subscript
transform subscript into reference
Definition at line 326 of file simple_atomize.c.
References expression_reference_p(), expression_syntax, free_subscript(), gen_nconc(), is_syntax_reference, NIL, reference_indices, subscript_array, subscript_indices, syntax_reference, syntax_subscript, syntax_subscript_p, syntax_tag, and syntax_undefined.
Referenced by cleanup_subscripts().
|
static |
Definition at line 350 of file simple_atomize.c.
References binary_call_lhs, call_function, ENTITY_ADDRESS_OF_P, ENTITY_DEREFERENCING_P, exp, expression_call(), expression_call_p(), expression_syntax, syntax_undefined, and update_expression_syntax().
Referenced by cleanup_subscripts().
void cleanup_subscripts | ( | void * | obj | ) |
obj | bj |
Definition at line 369 of file simple_atomize.c.
References cleanup_subscript(), cleanup_subscript_pre(), expression_domain, gen_recurse, and gen_true().
Referenced by atomize_object(), convert_pointer_to_array(), do_linearize_prepatch_subscripts(), insert_before_statement(), linearize_array_generic(), perform_ac_cse(), and split_structures().
|
static |
Definition at line 228 of file simple_atomize.c.
References atomize_this_expression(), create_new_variable, and insert_before_current_statement().
Referenced by call_rwt(), exp_range_rwt(), ref_rwt(), test_rwt(), and whileloop_rwt().
|
static |
syntax saved = expression_syntax(*pe);
atomize_object(saved);
Definition at line 273 of file simple_atomize.c.
References compute_before_current_statement(), and range_atomize_decision.
Referenced by range_rwt().
|
static |
s is inserted before the current statement.
if it is a block, it is added just before the last statement of the block, else a block statement is created in place of the current statement.
it is in an unstructured, and s is to be inserted properly
update the other lists
new current statement, to avoid other control insertions
of statement
insert statement before the last one
Definition at line 100 of file simple_atomize.c.
References assert, CAR, CONS, CONTROL, CONTROL_, control_predecessors, control_statement, control_successors, control_undefined, control_undefined_p, empty_comments, empty_extensions(), entity_empty_label(), gen_insert_before(), gen_last(), gen_recurse_stop(), instruction_block, instruction_block_p, make_control(), make_instruction_block(), make_statement(), make_synchronization_none(), MAPL, NIL, pips_debug, seen, STATEMENT, statement_comments, statement_extensions, statement_instruction, statement_label, statement_number, STATEMENT_NUMBER_UNDEFINED, statement_ordering, and STATEMENT_ORDERING_UNDEFINED.
Referenced by compute_before_current_statement().
|
static |
lower
upper
increment
Definition at line 283 of file simple_atomize.c.
References exp_range_rwt(), range_increment, range_lower, and range_upper.
Referenced by atomize_object().
|
static |
syntax saved = expression_syntax(*pe);
atomize_object(saved);
return(false);
Definition at line 234 of file simple_atomize.c.
References compute_before_current_statement(), MAPL, ref_atomize_decision, REFCAR, and reference_indices.
Referenced by atomize_object().
|
static |
the stack of the encoutered statements is maintained to be able to insert the needed computations just before the very last statement encountered.
The use of a stack is not necessary, since there are no effective rewrite. but it could have been... It enables some recursive calls that would have required to save the current statement explicitely otherwise.
Definition at line 90 of file simple_atomize.c.
Referenced by atomize_as_required().
|
static |
syntax saved = expression_syntax(*pe);
else I have to break the condition and to complete the recursion.
atomize_object(saved);
Definition at line 296 of file simple_atomize.c.
References compute_before_current_statement(), test_atomize_decision, and test_condition.
Referenced by atomize_object().
|
static |
syntax saved = expression_syntax(*pe);
else I have to break the condition and to complete the recursion.
atomize_object(saved);
Definition at line 311 of file simple_atomize.c.
References compute_before_current_statement(), while_atomize_decision, and whileloop_condition.
Referenced by atomize_object().
|
static |
Definition at line 71 of file simple_atomize.c.
Referenced by atomize_as_required(), and call_rwt().
|
static |
Definition at line 76 of file simple_atomize.c.
Referenced by atomize_as_required(), and compute_before_current_statement().
|
static |
Definition at line 73 of file simple_atomize.c.
Referenced by atomize_as_required(), and exp_range_rwt().
|
static |
static functions used
Definition at line 70 of file simple_atomize.c.
Referenced by atomize_as_required(), and ref_rwt().
|
static |
Definition at line 72 of file simple_atomize.c.
Referenced by atomize_as_required(), and test_rwt().
|
static |
Definition at line 74 of file simple_atomize.c.
Referenced by atomize_as_required(), and whileloop_rwt().