PIPS
|
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "pipsdbm.h"
#include "effects-generic.h"
#include "accel-util.h"
#include "reductions.h"
#include "sac.h"
#include "ricedg.h"
#include "effects-convex.h"
#include "effects-simple.h"
#include "control.h"
#include "callgraph.h"
#include "properties.h"
Go to the source code of this file.
Data Structures | |
struct | reduction_in_statement_param |
finds out expression with reduction More... | |
|
static |
The first part of the function check that the reduction is allowed.
If not, the function returns undefined. If the reduction is allowed, the function updates the reductionInfo list reds or add the reduction to the list.
Definition at line 85 of file reductions.c.
References CAR, CONS, DIMENSION, dimension_upper, entity_local_name(), entity_type, FOREACH, free_expression(), int_to_expression(), make_reduction_vector_entity(), make_reductionInfo(), pips_debug, reduction_reference, REDUCTIONINFO, reductionInfo_count, reductionInfo_reduction, reductionInfo_undefined, reductionInfo_vector, reference_variable, same_reduction_p(), type_variable, and variable_dimensions.
Referenced by rename_statement_reductions().
|
static |
Definition at line 752 of file reductions.c.
References declaration_statement_p(), dg, FOREACH, gen_copy_seq(), gen_remove(), graph_vertices, make_continue_instruction(), no_write_read_conflicts_p(), potential_out_effects_p(), return_statement_p(), set_add_element(), set_belong_p(), set_make(), set_pointer, statement_call_p(), statement_undefined, statement_undefined_p, SUCCESSOR, successor_vertex, update_statement_instruction(), VERTEX, vertex_successors, and vertex_to_statement().
Referenced by redundant_load_store_elimination().
|
static |
Definition at line 355 of file reductions.c.
References ADDRESS_OF_OPERATOR_NAME, AND_OPERATOR_NAME, call_to_expression(), call_to_statement, CONS, copy_language(), copy_reference(), empty_string_p(), entity_intrinsic(), entity_undefined_p, EXPRESSION, FindEntity(), get_current_module_entity(), get_string_property(), instruction_to_statement(), int_to_expression(), is_reduction_operator_and, is_reduction_operator_csum, is_reduction_operator_max, is_reduction_operator_min, is_reduction_operator_none, is_reduction_operator_or, is_reduction_operator_prod, is_reduction_operator_sum, make_assign_instruction(), make_call(), make_empty_subroutine(), make_expression_list, make_reference(), MakeUnaryCall(), MAX_OPERATOR_NAME, MIN_OPERATOR_NAME, module_language, MULTIPLY_OPERATOR_NAME, NIL, OR_OPERATOR_NAME, pips_user_warning, PLUS_C_OPERATOR_NAME, PLUS_OPERATOR_NAME, reduction_op, reduction_operator_sum_p, reduction_operator_tag, reduction_reference, reductionInfo_count, reductionInfo_reduction, reductionInfo_vector, reference_to_expression(), statement_undefined, and TOP_LEVEL_MODULE_NAME.
Referenced by reductions_rewrite().
|
static |
Definition at line 287 of file reductions.c.
References basic_of_reference(), bool_to_expression(), CONS, copy_expression(), EXPRESSION, free_expression(), instruction_to_statement(), int_to_expression(), is_reduction_operator_and, is_reduction_operator_max, is_reduction_operator_min, is_reduction_operator_none, is_reduction_operator_or, is_reduction_operator_prod, is_reduction_operator_sum, make_0val_expression(), make_1val_expression(), make_assign_instruction(), make_instruction_sequence(), make_maxval_expression(), make_minval_expression(), make_reference(), make_sequence(), NIL, reduction_op, reduction_operator_tag, reduction_reference, reductionInfo_count, reductionInfo_reduction, reductionInfo_vector, reference_to_expression(), STATEMENT, and statement_undefined.
Referenced by reductions_rewrite().
|
static |
Definition at line 243 of file reductions.c.
References basic_tag, complex_to_expression(), expression_undefined, float_to_expression(), int_to_expression(), is_basic_complex, is_basic_float, is_basic_int, and pips_internal_error.
Referenced by generate_prelude().
|
static |
Definition at line 266 of file reductions.c.
References basic_tag, complex_to_expression(), expression_undefined, float_to_expression(), int_to_expression(), is_basic_complex, is_basic_float, and is_basic_int.
Referenced by generate_prelude().
|
static |
Definition at line 199 of file reductions.c.
References basic_int, basic_tag, expression_undefined, int_to_expression(), is_basic_float, is_basic_int, and max.
Referenced by generate_prelude().
|
static |
Definition at line 221 of file reductions.c.
References basic_int, basic_tag, expression_undefined, int_to_expression(), is_basic_float, is_basic_int, and min.
Referenced by generate_prelude().
Definition at line 64 of file reductions.c.
References AddLocalEntityToDeclarations(), base, basic_of_reference(), buffer, CONS, DIMENSION, get_current_module_entity(), get_current_module_statement(), get_string_property(), int_to_expression(), make_dimension(), make_new_array_variable_with_prefix(), mod_ent, NIL, pips_assert, prefix, and reduction_reference.
Referenced by add_reduction().
Definition at line 716 of file reductions.c.
References CONFLICT, conflict_sink, conflict_source, dg_arc_label_conflicts, effect_read_p, effect_write_p, FOREACH, SUCCESSOR, and successor_arc_label.
Referenced by do_redundant_load_store_elimination().
get_current_module_statement()
Definition at line 727 of file reductions.c.
References anywhere_effect_p(), EFFECT, effect_any_reference, effects_write_effects(), ENDP, FOREACH, formal_parameter_p(), gen_free_list(), get_bool_property(), io_effect_p(), load_cumulated_rw_effects_list(), load_proper_rw_effects_list(), out_effects(), reference_indices, reference_variable, top_level_entity_p(), and write_effects().
Referenced by do_redundant_load_store_elimination().
Definition at line 151 of file reductions.c.
References gen_context_recurse, gen_null2(), reduction_in_statement_param::has_reduction_p, reduction_in_statement_walker(), and reference_domain.
Referenced by rename_statement_reductions().
|
static |
Definition at line 145 of file reductions.c.
References reduction_in_statement_param::has_reduction_p, reduction_in_statement_param::red, reduction_reference, and reference_equal_p().
Referenced by reduction_in_statement_p().
Definition at line 557 of file reductions.c.
References loop_body, set_add_element(), statement_loop(), and statement_loop_p().
Referenced by simd_remove_reductions().
we may have failed to find any reduction info, in that case try again with the inner reductions
not enough elements: undo the change
Definition at line 475 of file reductions.c.
References CONS, ENDP, entity_memory_size(), FOREACH, forloop_body, gen_context_recurse, gen_full_free_list(), gen_recurse_stop(), gen_true2(), generate_compact(), generate_prelude(), get_int_property(), ifdebug, insert_statement(), instruction_forloop, instruction_loop, instruction_tag, instruction_whileloop, is_instruction_forloop, is_instruction_loop, is_instruction_sequence, is_instruction_whileloop, load_cumulated_reductions(), loop_body, make_block_statement(), NIL, pips_debug, print_statement(), REDUCTIONINFO, reductionInfo_vector, reductions_list, reference_domain, set_belong_p(), simd_gather_reduction(), STATEMENT, statement_instruction, statement_undefined, undo_rename_reference(), and whileloop_body.
Referenced by simd_remove_reductions().
bool redundant_load_store_elimination | ( | char * | module_name | ) |
Get the code of the module.
module_name | odule_name |
Definition at line 788 of file reductions.c.
References compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, dependence_graph, do_redundant_load_store_elimination(), get_current_module_statement(), module, module_name(), module_name_to_entity(), module_reorder(), reset_cumulated_rw_effects(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_rw_effects(), set_cumulated_rw_effects(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_rw_effects(), and unnormalize_expression().
|
static |
Definition at line 126 of file reductions.c.
References expression_syntax, free_reference(), int_to_expression(), make_expression_list, make_reference(), reduction_reference, reductionInfo_count, reductionInfo_reduction, reductionInfo_vector, reference_equal_p(), syntax_reference, and syntax_reference_p.
Referenced by rename_statement_reductions().
|
static |
This function gets the possible reduction thanks to load_cumulated_reductions() function.
Then, for each possible reduction, the function call add_reduction() to know if the reduction is allowed and if it is, the function calls rename_reduction_ref() to do the reduction.
Definition at line 163 of file reductions.c.
References add_reduction(), basic_of_reference(), basic_undefined_p, expression_domain, FOREACH, fprintf(), free_basic(), gen_context_recurse, gen_true2(), ifdebug, pips_debug, print_reference(), print_statement(), REDUCTION, reduction_in_statement_p(), reduction_reference, reduction_star_p(), reductionInfo_undefined_p, and rename_reduction_ref_walker().
Referenced by simd_gather_reduction().
bool sac_expression_reduction_p | ( | expression | e | ) |
reductions.c
Definition at line 55 of file reductions.c.
References entity_user_name(), expression_reference(), expression_reference_p(), get_string_property(), and reference_variable.
|
static |
Definition at line 456 of file reductions.c.
References ENDP, FOREACH, instruction_sequence, instruction_tag, is_instruction_sequence, rename_statement_reductions(), sequence_statements, STATEMENT, and statement_instruction.
Referenced by reductions_rewrite().
bool simd_remove_reductions | ( | char * | mod_name | ) |
remove reductions by expanding reduced scalar to an array
mod_name | module to remove reductions from |
get the resources
Now do the job
Reorder the module, because new statements have been added
update/release resources
mod_name | od_name |
Definition at line 571 of file reductions.c.
References clean_up_sequences(), compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, gen_context_recurse, get_current_module_statement(), module_name_to_entity(), module_reorder(), pips_assert, reduction_rewrite_filter(), reductions_rewrite(), reset_cumulated_reductions(), reset_current_module_entity(), reset_current_module_statement(), set_cumulated_reductions(), set_current_module_entity(), set_current_module_statement(), set_free(), set_make(), set_pointer, statement_consistent_p(), and statement_domain.
|
static |
Definition at line 115 of file reductions.c.
References gen_full_copy_list(), gen_full_free_list(), reduction_reference, reductionInfo_reduction, reductionInfo_vector, reference_indices, reference_variable, and same_entity_p().
Referenced by reductions_rewrite().