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 "text-util.h"
#include "pipsdbm.h"
#include "effects-generic.h"
#include "effects-convex.h"
#include "effects-simple.h"
#include "accel-util.h"
#include "ray_dte.h"
#include "sommet.h"
#include "sg.h"
#include "polyedre.h"
#include "sac.h"
#include "ricedg.h"
#include "control.h"
#include "callgraph.h"
Go to the source code of this file.
Data Structures | |
struct | simdizer_context |
Macros | |
#define | SWAP_ARGUMENTS(c) do { call_arguments(c)=gen_nreverse(call_arguments(c)) ; return ;} while(0) |
#define | NOSWAP_ARGUMENTS(c) return |
Variables | |
static hash_table | matches = NULL |
static hash_table | equivalence_table = hash_table_undefined |
static statement | origin =NULL |
statement | sac_current_block = statement_undefined |
instruction | sac_real_current_instruction = instruction_undefined |
#define NOSWAP_ARGUMENTS | ( | c | ) | return |
#define SWAP_ARGUMENTS | ( | c | ) | do { call_arguments(c)=gen_nreverse(call_arguments(c)) ; return ;} while(0) |
Definition at line 344 of file simdizer.c.
References CAR, distance_between_expression(), ENDP, EXPRESSION, expression_integer_value(), expression_undefined_p, FOREACH, free_expression(), intptr_t, POP, s1, and sac_statement_to_expressions().
Referenced by order_isomorphic_statements_list().
|
static |
Definition at line 469 of file simdizer.c.
References gen_length().
Referenced by order_isomorphic_statements_list().
|
static |
Definition at line 415 of file simdizer.c.
References CAR, distance_between_expression(), ENDP, EXPRESSION, expression_integer_value(), expression_scalar_p, expression_undefined, expression_undefined_p, FOREACH, free_expression(), gen_free_list(), intptr_t, origin, POP, s1, and sac_statement_to_expressions().
Referenced by order_isomorphic_statements_list().
|
static |
Definition at line 365 of file simdizer.c.
References s1, and statement_ordering.
Referenced by init_statement_equivalence_table(), order_isomorphic_statements(), and order_isomorphic_statements_list().
|
static |
this code is here because levels information seems inaccurate so it checks all the possible conflict between source
and  sink
that could have generated c
and then instead of using references_may_conflict, it assumes we are in ssa form which should be ok thanks to scalar renaming, and symbolically computes the distance between each reference
hack no longer needed , simple is beautiful
Definition at line 138 of file simdizer.c.
References cone_levels, cone_undefined_p, conflict_cone, conflict_sink, conflict_source, distance_between_expression(), EFFECT, effect_any_reference, effect_read_p, effects_may_conflict_p(), effects_read_effects(), effects_write_effects(), expression_integer_value(), expression_undefined_p, FOREACH, gen_free_list(), INT, intptr_t, load_proper_rw_effects_list(), pips_assert, reference_to_expression(), reference_variable, same_entity_p(), set_add_element(), SET_FOREACH, set_free(), set_make(), and set_pointer.
Referenced by successor_only_has_rr_conflict_p().
|
static |
Definition at line 843 of file simdizer.c.
References simdizer_context::nb_enclosing_loops, and pips_assert.
Referenced by simdizer().
|
static |
constant first
then scalar
we finally end with two references
Definition at line 907 of file simdizer.c.
References binary_call_lhs, binary_call_rhs, call_arguments, commutative_call_p(), compare_entities(), distance_between_expression(), expression_integer_value(), expression_reference_or_field_p(), expression_scalar_p, expression_to_entity(), expression_undefined_p, extended_expression_constant_p(), free(), free_expression(), gen_length(), intptr_t, NOSWAP_ARGUMENTS, pips_assert, pips_user_warning, SWAP_ARGUMENTS, Words_Call(), and words_to_string().
Referenced by simdizer_init().
|
static |
Definition at line 953 of file simdizer.c.
References blocks, CAR, CONS, ENDP, entity_empty_label_p(), gen_free_list(), gen_nreverse(), make_block_statement(), NIL, POP, sequence_statements, STATEMENT, statement_block(), statement_block_p, statement_label, and statement_sequence().
Referenced by simdizer_init().
|
static |
is there a tail return ?
yes there is
is there a tail return ?
yes there is
not using insert_statement because it is too smart ! we want to keep a block
Definition at line 983 of file simdizer.c.
References CAR, CDR, declaration_statement_p(), ENDP, gen_append(), insert_statement_no_matter_what(), make_block_statement(), make_statement_list, NIL, POP, return_statement_p(), STATEMENT, statement_block(), and statement_block_p.
Referenced by simdizer_init().
Definition at line 279 of file simdizer.c.
References get_statement_matching_types(), ifdebug, matches, out, pips_assert, pips_debug, print_statement(), set_add_element(), set_empty_p(), SET_FOREACH, set_free(), set_intersection(), set_make(), set_pointer, simd_check_argType(), and simd_fill_curArgType().
Referenced by simdize_simple_statements_pass2().
Definition at line 257 of file simdizer.c.
References eq, equivalence_table, hash_get(), HASH_UNDEFINED_VALUE, ifdebug, pips_assert, pips_debug, print_statement(), set_assign_list(), SET_FOREACH, set_free(), set_intersection(), set_make(), and set_pointer.
Referenced by simdize_simple_statements_pass2().
|
static |
leak spotted !
Definition at line 250 of file simdizer.c.
References equivalence_table, hash_table_free(), hash_table_undefined, hash_table_undefined_p, and pips_assert.
Referenced by simdize_simple_statements().
|
static |
Definition at line 81 of file simdizer.c.
References hash_table_free(), and matches.
Referenced by simdize_simple_statements().
match get_statement_match_of_kind | ( | statement | s, |
opcodeClass | kind | ||
) |
kind | ind |
Definition at line 101 of file simdizer.c.
References CAR, CDR, get_statement_matches(), MATCH, match_type, match_undefined, and NIL.
Referenced by make_simd_statements().
Definition at line 90 of file simdizer.c.
References hash_get_default_empty_list(), and matches.
Referenced by get_statement_match_of_kind(), and get_statement_matching_types().
Definition at line 119 of file simdizer.c.
References FOREACH, get_statement_matches(), MATCH, match_type, out, set_add_element(), set_make(), and set_pointer.
Referenced by extract_matching_statements(), and simdize_simple_statements_pass2().
|
static |
Definition at line 838 of file simdizer.c.
References simdizer_context::nb_enclosing_loops, and pips_assert.
Referenced by simdizer().
|
static |
for faster access
first extract corresponding vertices
then count the references between each other
do not take into account backward references, or R-R conflicts
now recursievly retreive the head of each vertex with no reference on them and reorder initial statement list
fill the head
found nothing, assume we are in the tail
remove those vertex from the head and decrease references elsewhere
do not take into account backward references and ignored statements
Definition at line 519 of file simdizer.c.
References compare_statements_on_ordering(), CONS, dependence_graph, equivalence_table, FOREACH, gen_copy_seq(), gen_free_list(), gen_nconc(), gen_sort_list(), graph_vertices, HASH_DEFAULT_SIZE, hash_del(), hash_get(), HASH_MAP, hash_pointer, hash_put(), hash_table_clear(), hash_table_empty_p, hash_table_free(), hash_table_make(), hash_table_scan(), hash_table_undefined_p, HASH_UNDEFINED_VALUE, hash_update(), ifdebug, intptr_t, NIL, pips_assert, pips_debug, pips_internal_error, print_statement(), set_add_element(), set_assign_list(), set_belong_p(), set_empty_p(), SET_FOREACH, set_free(), set_make(), set_pointer, STATEMENT, SUCCESSOR, successor_only_has_rr_conflict_p(), successor_vertex, VERTEX, vertex_ordering(), vertex_successors, and vertex_to_statement().
Referenced by simdize_simple_statements().
|
static |
Definition at line 66 of file simdizer.c.
References FOREACH, hash_pointer, hash_put(), hash_table_make(), match_statement(), matches, NIL, and STATEMENT.
Referenced by simdize_simple_statements().
Definition at line 508 of file simdizer.c.
References compare_statements_on_ordering(), order_isomorphic_statements_list(), and set_to_sorted_list().
Referenced by simdize_simple_statements_pass2().
Definition at line 478 of file simdizer.c.
References CAR, CDR, comparable_statements_on_distance_p(), compare_list_from_length(), compare_statements_on_distance_to_origin(), compare_statements_on_ordering(), CONS, ENDP, FOREACH, gen_free_list(), gen_nconc(), gen_sort_list(), LIST, NIL, out, reset_statement_origin(), set_statement_origin(), and STATEMENT.
Referenced by order_isomorphic_statements(), and simdize_simple_statements_pass2().
|
static |
Definition at line 413 of file simdizer.c.
References origin.
Referenced by order_isomorphic_statements_list().
Definition at line 821 of file simdizer.c.
References asprintf, basic_to_string(), entity_basic(), free(), sac_aligned_entity_p(), simd_vector_entity_p(), and strdup().
Referenced by simdizer().
Definition at line 320 of file simdizer.c.
References expression_domain, gen_context_recurse, gen_null2(), NIL, out, and sac_statement_to_expressions_gather().
Referenced by comparable_statements_on_distance_p(), and compare_statements_on_distance_to_origin().
|
static |
Definition at line 310 of file simdizer.c.
References CONS, EXPRESSION, and expression_reference_or_field_p().
Referenced by sac_statement_to_expressions().
|
static |
Definition at line 412 of file simdizer.c.
References origin.
Referenced by order_isomorphic_statements_list().
|
static |
Definition at line 816 of file simdizer.c.
References instruction_call_p, and statement_instruction.
Referenced by simdizer().
|
static |
not much we can do with a single statement, or with "complex" statements (ie, with tests/loops/...)
we cannot handle anything but sequence of calls
process already existing statements
Definition at line 740 of file simdizer.c.
References CAR, CDR, CONS, declaration_statement_p(), dependence_graph, simdizer_context::dg, ENDP, free_statement_equivalence_table(), free_statement_matches_map(), gen_append(), gen_free_list(), gen_nreverse(), init_statement_equivalence_table(), init_statement_matches_map(), insert_statement_no_matter_what(), instruction_sequence, make_instruction_block(), simdizer_context::nb_enclosing_loops, NIL, pips_debug, POP, simdizer_context::result, sac_current_block, sac_real_current_instruction, sequence_statements, simdize_simple_statements_pass2(), STATEMENT, statement_block(), statement_block_p, statement_call_p(), and statement_instruction.
Referenced by simdizer().
Traverse to list to group isomorphic statements
if this is not a recognized statement (ie, no match), skip it
try to find all the compatible isomorphic statements after the current statement
if the matches for statement sj and for the group have a non-empty intersection, and the move is legal (ie, does not break dependency chain) then we can add the statement sj to the group.
filter out already visited statements
Free the list of statements info
Set the new list as the statements' instructions
Definition at line 611 of file simdizer.c.
References CAR, CDR, CONS, ENDP, extract_matching_statements(), extract_non_conflicting_statements(), gen_append(), gen_nreverse(), generate_simd_code(), get_statement_matching_types(), ifdebug, init_vector_to_expressions(), intptr_t, invalidate_expressions_in_statement(), make_simd_statements(), NIL, opcode_vectorSize, opcodeClass_name, order_isomorphic_statements(), order_isomorphic_statements_list(), pips_debug, POP, print_statement(), print_statements(), reset_vector_to_expressions(), set_add_element(), set_belong_p(), set_difference(), set_empty_p(), SET_FOREACH, set_free(), set_make(), set_pointer, simd_fill_finalArgType(), simd_reset_finalArgType(), simdstatement_opcode, simdstatement_undefined_p, and STATEMENT.
Referenced by simdize_simple_statements().
bool simdizer | ( | char * | mod_name | ) |
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 854 of file simdizer.c.
References clean_up_sequences(), compute_callees(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, decr_counter(), simdizer_context::dg, gen_context_multi_recurse(), incr_counter(), loop_domain, module_name_to_entity(), module_reorder(), pips_assert, pop_generated_variable_commenter(), push_generated_variable_commenter(), remove_preferences(), reset_current_module_entity(), reset_current_module_statement(), reset_ordering_to_statement(), reset_proper_rw_effects(), reset_simd_operator_mappings(), reset_simd_treematch(), simdizer_context::result, sac_commenter(), set_conflict_testing_properties(), set_current_module_entity(), set_current_module_statement(), set_ordering_to_statement(), set_proper_rw_effects(), set_simd_operator_mappings(), set_simd_treematch(), simd_simple_sequence_filter(), simdize_simple_statements(), statement_consistent_p(), and statement_domain.
bool simdizer_init | ( | const char * | module_name | ) |
get the resources
normalize blocks
then split blocks containing declarations statement
then split blocks containing labeled statement
sort commutative operators
reset
module_name | odule_name |
Definition at line 1023 of file simdizer.c.
References call_domain, clean_up_sequences(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, do_simdizer_init(), do_split_block_statements(), do_split_decl_block_statements(), gen_recurse, gen_true(), get_current_module_statement(), module_name(), module_name_to_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), and statement_domain.
regions tell us there is a conflict. check if the dependence is loop carried or not
Definition at line 195 of file simdizer.c.
References CONFLICT, conflict_is_a_real_conflict_p(), conflict_sink, conflict_source, dg_arc_label_conflicts, effect_any_reference, effect_read_p, ENDP, FOREACH, gen_full_free_list(), ifdebug, pips_debug, print_region, reference_to_string(), region_intersection(), successor_arc_label, successor_vertex, and vertex_to_statement().
Referenced by init_statement_equivalence_table().
|
static |
Definition at line 129 of file simdizer.c.
Referenced by extract_non_conflicting_statements(), free_statement_equivalence_table(), and init_statement_equivalence_table().
|
static |
Definition at line 60 of file simdizer.c.
Referenced by extract_matching_statements(), free_statement_matches_map(), fun_completion(), get_statement_matches(), handle_file(), init_statement_matches_map(), and match_statement().
|
static |
Definition at line 411 of file simdizer.c.
Referenced by compare_statements_on_distance_to_origin(), loop_nest_to_offset(), reset_statement_origin(), set_statement_origin(), and tile_membership().
statement sac_current_block = statement_undefined |
Definition at line 722 of file simdizer.c.
Referenced by make_new_simd_vector_with_prefix(), and simdize_simple_statements().
instruction sac_real_current_instruction = instruction_undefined |
Definition at line 723 of file simdizer.c.
Referenced by make_loadsave_statement(), and simdize_simple_statements().