PIPS
|
#include <stdlib.h>
#include <string.h>
#include "local.h"
#include "prettyprint.h"
#include "rice.h"
Go to the source code of this file.
Data Structures | |
struct | prettyprint_dot_context |
Context structure used by gen recurse. More... | |
Macros | |
#define | _GNU_SOURCE |
For strdup: More... | |
#define | dot_nodes_recurse(ctx, s) |
Recurse on statement s with context ctx Intended to be called while already on a gen_recurse recursion. More... | |
#define | dot_print_label_string(fd, str) |
print the string str in file descriptor fd, removing all More... | |
Typedefs | |
typedef struct prettyprint_dot_context * | dot_ctx |
Functions | |
statement | vertex_to_statement (vertex v) |
Vertex_to_statement looks for the statement that is pointed to by vertex v. More... | |
int | vertex_ordering (vertex v) |
int | compare_vertex (const void *v0, const void *v1) |
compare two vertices based on their ordering More... | |
hash_table | compute_ordering_to_dg_mapping (graph dependance_graph) |
Define a mapping from the statement ordering to the dependence graph vertices: More... | |
int | vertex_sort_callback (const vertex *v1, const vertex *v2) |
This is a callback for qsort function, it compares two vertex. More... | |
int | successor_sort_callback (const successor *succ1, const successor *succ2) |
This is a callback for qsort function, it compares two successor. More... | |
int | conflicts_sort_callback (conflict *c1, conflict *c2) |
This is a callback for qsort function, it compares two conflicts. More... | |
void | prettyprint_dependence_graph (FILE *fd, statement mod_stat, graph mod_graph) |
Print all edges and arcs. More... | |
static void | prettyprint_dot_label (FILE *fd, statement s, bool print_statement) |
Print the label for a statement. More... | |
static bool | prettyprint_dot_nodes (statement s, dot_ctx ctx) |
Print nodes for statements, the recursion is quite complicated. More... | |
void | prettyprint_dot_dependence_graph (FILE *fd, statement mod_stat, graph mod_graph) |
Output dependence graph in a file in graphviz dot format. More... | |
void | prettyprint_dependence_graph_view (FILE *fd, statement mod_stat, graph mod_graph) |
Do not print vertices and arcs ignored by the parallelization algorithms. More... | |
void | print_vect_in_vertice_val (FILE *fd, Pvecteur v, Pbase b) |
void | print_dependence_cone (FILE *fd, Ptsg dc, Pbase basis) |
hash_table | statements_to_successors (list statements, graph dg) |
creates a hash_table containing statements from statements as keys and their respective succesors according to dg as values More... | |
Variables | |
static string | dependence_graph_banner [8] |
#define dot_nodes_recurse | ( | ctx, | |
s | |||
) |
Recurse on statement s with context ctx Intended to be called while already on a gen_recurse recursion.
#define dot_print_label_string | ( | fd, | |
str | |||
) |
typedef struct prettyprint_dot_context* dot_ctx |
int compare_vertex | ( | const void * | v0, |
const void * | v1 | ||
) |
compare two vertices based on their ordering
v0 | 0 |
v1 | 1 |
Definition at line 58 of file util.c.
References vertex_ordering().
Referenced by do_scalar_renaming_in_graph().
hash_table compute_ordering_to_dg_mapping | ( | graph | dependance_graph | ) |
Define a mapping from the statement ordering to the dependence graph vertices:
dependance_graph | ependance_graph |
Definition at line 70 of file util.c.
References dg_vertex_label_statement, FOREACH, graph_vertices, hash_int, hash_put(), hash_table_make(), pips_debug, VERTEX, vertex_successors, and vertex_vertex_label.
This is a callback for qsort function, it compares two conflicts.
c1 | 1 |
c2 | 2 |
Definition at line 126 of file util.c.
References concatenate(), conflict_sink, conflict_source, effect_action, effect_any_reference, effect_words_reference(), free(), full_action_to_short_string(), s1, strdup(), and words_to_string().
Referenced by prettyprint_dependence_graph(), prettyprint_dependence_graph_view(), and xml_Chain_Graph().
Print all edges and arcs.
There is no guarantee that the ordering_to_statement() hash table is the proper one
compute line numbers for statements
If we have zero printable conflicts, move on.
If we have more than one conflict, let's sort them !
FI: the number of conflicts should take into account the filtering due to PRETTYPRINT_MEMORY_EFFECTS_ONLY
Modification at revision 12484 because statement numbers were not initialized by C parser, with no validation of ricedg available at that time
factorize line numbers
FI: I should use another property, specific to the use-def chains, but this is quite close
if (!entity_scalar_p(reference_variable (effect_any_reference(conflict_source(c))))) {
Additional information for EDF prettyprint. Instruction calls are given with statement numbers
uniform dependence
sg_fprint(fd,gs,entity_local_name);
FI: almost print_dependence_cone:-(
fd | d |
mod_stat | od_stat |
mod_graph | od_graph |
Definition at line 177 of file util.c.
References apply_persistant_statement_to_int(), type_sg::base, call_function, CAR, CDR, cone_generating_system, cone_levels, cone_undefined, CONFLICT, conflict_cone, conflict_sink, conflict_source, conflicts_sort_callback(), CONS, debug_off, debug_on, dependence_graph_banner, dg_arc_label_conflicts, effect_action, effect_any_reference, effect_words_reference(), ENDP, entity_local_name(), FOREACH, fprint_lsom_as_dense(), fprintf(), free_persistant_statement_to_int(), full_action_to_short_string(), GEN_ARRAY_FOREACH, gen_array_free(), gen_array_make(), gen_array_nitems(), gen_array_pointer(), gen_length(), gen_sort_list(), get_bool_property(), get_current_module_entity(), graph_vertices, ifdebug, instruction_call, instruction_call_p, INT, list_to_array(), MAPL, mod_stat, module_to_declaration_length(), NIL, persistant_statement_to_int_undefined, pl, print_ordering_to_statement(), print_words(), s1, sc_fprint(), sc_new(), sg_fprint_as_ddv(), sg_fprint_as_dense(), sg_nbre_droites, sg_nbre_rayons, sg_nbre_sommets, sg_sommets, sg_to_sc_chernikova(), SG_UNDEFINED_P, statement_instruction, statement_number, statement_to_line_number(), statement_undefined_p, store_effect_p(), SUCCESSOR, successor_arc_label, successor_sort_callback(), successor_vertex, VERTEX, vertex_sort_callback(), vertex_successors, vertex_to_statement(), and words_effect().
Referenced by chains(), FindAndTopSortSccs(), icm_codegen(), print_dependence_or_chains_graph(), rice_dependence_graph(), and rice_update_dependence_graph().
Do not print vertices and arcs ignored by the parallelization algorithms.
At least, hopefully...
f (! entity_scalar_p(reference_variable (effect_any_reference(conflict_source(c))))) {
sg_fprint(fd,gs,entity_local_name);
fd | d |
mod_stat | od_stat |
mod_graph | od_graph |
Definition at line 833 of file util.c.
References type_sg::base, CAR, CDR, clean_enclosing_loops(), cone_generating_system, cone_levels, cone_undefined, CONFLICT, conflict_cone, conflict_sink, conflict_source, conflicts_sort_callback(), CONS, debug_off, debug_on, dependence_graph_banner, dg_arc_label_conflicts, ENDP, entity_local_name(), prettyprint_dot_context::fd, FindMaximumCommonLevel(), fprintf(), GEN_ARRAY_FOREACH, gen_array_free(), gen_array_make(), gen_array_nitems(), gen_array_pointer(), gen_length(), gen_nconc(), get_bool_property(), graph_vertices, ifdebug, ignore_this_conflict(), INT, level, list_to_array(), load_statement_enclosing_loops(), loops_mapping_of_statement(), MAPL, mod_stat, NIL, pl, print_words(), s1, sc_fprint(), sc_new(), set_enclosing_loops_map(), sg_fprint_as_dense(), sg_to_sc_chernikova(), SG_UNDEFINED_P, statement_number, SUCCESSOR, successor_arc_label, successor_vertex, VERTEX, vertex_successors, vertex_to_statement(), and words_effect().
Referenced by print_dependence_or_chains_graph().
Output dependence graph in a file in graphviz dot format.
fd | is the file descriptor where to output |
mod_stat | is the module statement (not necessary module, it can be a block statement for instance |
graph | is the dependence graph to print |
There is no guarantee that the ordering_to_statement() hash table is the proper one
graph style
Nodes style
uniform dependence
fd | d |
mod_stat | od_stat |
mod_graph | od_graph |
Definition at line 583 of file util.c.
References action_read_p, action_write_p, type_sg::base, CAR, cone_generating_system, cone_levels, cone_undefined, conflict_cone, conflict_sink, conflict_source, prettyprint_dot_context::current, debug_off, debug_on, dg_arc_label_conflicts, effect_action, effect_any_reference, effect_words_reference(), prettyprint_dot_context::fd, FindMaximumCommonLevel(), FOREACH, fprint_lsom_as_dense(), fprintf(), full_action_to_short_string(), gen_context_recurse, gen_null2(), get_bool_property(), get_string_property(), graph_vertices, ifdebug, ignore_this_conflict(), INT, level, load_statement_enclosing_loops(), loops_mapping_of_statement(), MAPL, mod_stat, prettyprint_dot_context::ordered, pl, prettyprint_dot_nodes(), prettyprint_dot_context::previous_ordering, print_ordering_to_statement(), print_statement(), prettyprint_dot_context::print_statement, print_words(), reset_enclosing_loops_map(), s1, same_string_p, set_enclosing_loops_map(), sg_fprint_as_ddv(), sg_nbre_droites, sg_nbre_rayons, sg_nbre_sommets, sg_sommets, SG_UNDEFINED_P, statement_domain, statement_ordering, successor_arc_label, successor_vertex, vertex_successors, and vertex_to_statement().
Referenced by do_simplify_dg(), and print_dot_dependence_or_chains_graph().
Print the label for a statement.
It will only output the first line after having removed comments.
fd | is the file descriptor |
s | is the statement |
print_statement,if | set to false then only print the ordering |
Definition at line 457 of file util.c.
Print nodes for statements, the recursion is quite complicated.
for instance when we see a loop, we print the header, and we call a self-gen_recursion on the body to create separate node for each statement inside the loop. Called by gen_recurse_context
s | is the current statement |
ctx | is the gen_recurse context |
Definition at line 509 of file util.c.
Referenced by prettyprint_dot_dependence_graph().
fd | d |
dc | c |
basis | asis |
Definition at line 974 of file util.c.
References base_fprint(), typ_som::denominateur, prettyprint_dot_context::fd, fprint_string_Value(), fprintf(), print_vect_in_vertice_val(), safe_entity_name(), sg_droites, sg_nbre_droites, sg_nbre_rayons, sg_nbre_sommets, sg_rayons, sg_sommets, SG_UNDEFINED_P, rdte::succ, typ_som::succ, rdte::vecteur, and typ_som::vecteur.
Referenced by dependence_cone_positive(), and TestDependence().
fd | d |
Definition at line 959 of file util.c.
References prettyprint_dot_context::fd, fprint_string_Value(), fprintf(), Svecteur::succ, Svecteur::var, and vect_coeff().
Referenced by print_dependence_cone().
hash_table statements_to_successors | ( | list | statements, |
graph | dg | ||
) |
creates a hash_table containing statements from statements as keys and their respective succesors according to dg as values
statements | input statements |
dg | dependecy graph |
statements | tatements |
dg | g |
Definition at line 1018 of file util.c.
References dg, FOREACH, gen_find_eq(), graph_vertices, HASH_DEFAULT_SIZE, hash_pointer, hash_put(), hash_table_make(), statement_undefined_p, successors(), VERTEX, vertex_successors, and vertex_to_statement().
Referenced by fs_filter(), and if_conversion_compact_stats().
This is a callback for qsort function, it compares two successor.
succ1 | ucc1 |
succ2 | ucc2 |
Definition at line 116 of file util.c.
References successor_vertex, and vertex_sort_callback().
Referenced by prettyprint_dependence_graph(), and xml_Chain_Graph().
Definition at line 51 of file util.c.
References dg_vertex_label_statement, and vertex_vertex_label.
Referenced by compare_vertex(), get_vertex_of_statement(), and init_statement_equivalence_table().
This is a callback for qsort function, it compares two vertex.
v1 | 1 |
v2 | 2 |
Definition at line 105 of file util.c.
References s1, statement_number, and vertex_to_statement().
Referenced by prettyprint_dependence_graph(), successor_sort_callback(), and xml_Chain_Graph().
Vertex_to_statement looks for the statement that is pointed to by vertex v.
cproto-generated files
This information is kept in a static hash_table named OrderingToStatement. See ri-util/ordering.c for more information.
Definition at line 45 of file util.c.
References dg_vertex_label_statement, ordering_to_statement(), and vertex_vertex_label.
Referenced by adg_dup_disjunctive_nodes(), adg_list_same_order_in_dg(), adg_same_order_in_dg(), allocate_task_to_cluster(), bdsc_code_instrumentation(), bottom_level(), check_tiling_legality(), check_way_between_two_statements(), clean_sdg(), common_ignore_this_vertex(), communications_construction(), contains_level_l_dependence(), dependance_vertices_p(), dg_vertex_dup(), dma_statements_conflict_p(), do_reduction_detection(), do_reduction_propagation(), do_redundant_load_store_elimination(), do_scalar_renaming_in_graph(), do_scalar_renaming_in_successors(), do_scalar_renaming_in_vertex(), DoInvariantsStatements(), DoRedundantsStatements(), end_idle_clusters(), find_covering_reference_path(), find_level_l_loop_statement(), flint_initialize_statement_def_use_variables(), graph_to_live_writes(), ignore_this_conflict(), init_statement_equivalence_table(), initialization(), invariant_vertex_to_invariant_entities(), IsolatedStatement(), make_filtered_dg_or_dvdg(), parse_instrumented_file(), predecessors(), prettyprint_dependence_graph(), prettyprint_dependence_graph_view(), prettyprint_dot_dependence_graph(), prettyprint_successor(), prettyprint_vertex(), print_loopnest_dependence_cone(), print_SDGs(), PrintScc(), quick_privatize_graph(), quick_privatize_loop(), ready_node(), remove_dependance(), rice_update_dependence_graph(), scc_region(), schedule_failsafe(), search_parallel_loops(), sequence_dg(), SimplifyInvariantVertex(), SimplifyRedundantVertex(), some_conflicts_between(), statement_conflicts_p(), statement_to_vertex(), statements_conflict_p(), statements_conflict_relaxed_p(), statements_to_successors(), stats_has_rw_conf_p(), step_analyse_CHAINS_DG(), successor_only_has_rr_conflict_p(), successors(), t_level(), tlevel_decrease(), topological_sort(), TopSortSccs(), update_priority_values(), vertex_invariant_p(), vertex_partially_invariant_p(), vertex_redundant_p(), vertex_sort_callback(), vertex_to_chains(), vertices_to_statements(), xml_Chain_Graph(), and zeroing_multiple_edges().
|
static |
Definition at line 89 of file util.c.
Referenced by prettyprint_dependence_graph(), and prettyprint_dependence_graph_view().