PIPS
|
#include <stdio.h>
#include <strings.h>
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "text.h"
#include "text-util.h"
#include "database.h"
#include "misc.h"
#include "ri-util.h"
#include "resources.h"
#include "pipsdbm.h"
#include "control.h"
Go to the source code of this file.
Macros | |
#define | bool_undefined ((bool) (-15)) |
TRAVELLING on the control graph. More... | |
#define | bool_undefined_p(b) ((b)==bool_undefined) |
Functions | |
void | clean_ctrl_graph () |
global mapping from statements to their control in the full control graph More... | |
static void | add_arrow_in_ctrl_graph (statement s1, statement s2) |
add (s1) --> (s2), that is s2 as successor of s1 and s1 as predecessor of s2. More... | |
static void | add_arrows_in_ctrl_graph (statement s, list l) |
list | control_list_to_statement_list (list lc) |
of statement More... | |
static void | statement_arrows (statement s, list next) |
static void | stmt_rewrite (statement s) |
void | build_full_ctrl_graph (statement s) |
void | full_control_graph (string name) |
FULL CONTROL GRAPH for module NAME. More... | |
static void | push_if_necessary (statement s) |
static void | push (list l) |
it is pushed in reverse order to preserve the depth first view. More... | |
static void | push_successors (statement s) |
void | init_ctrl_graph_travel (statement s, bool(*decision)(statement)) |
bool | next_ctrl_graph_travel (statement *ps) |
void | close_ctrl_graph_travel (void) |
Variables | |
static bool(* | travel_decision )(statement) |
Static data for the travel. More... | |
#define bool_undefined ((bool) (-15)) |
TRAVELLING on the control graph.
init, next, close functions.
#define bool_undefined_p | ( | b | ) | ((b)==bool_undefined) |
add (s1) --> (s2), that is s2 as successor of s1 and s1 as predecessor of s2.
last added put in first place. this property is used for a depth first enumeration.
Definition at line 78 of file graph.c.
References control_predecessors, control_successors, gen_once(), load_ctrl_graph(), ORDERING_NUMBER, ORDERING_STATEMENT, pips_debug, s1, statement_number, and statement_ordering.
Referenced by add_arrows_in_ctrl_graph(), and statement_arrows().
l | statement |
Definition at line 96 of file graph.c.
References add_arrow_in_ctrl_graph(), CAR, CDR, ENDP, and STATEMENT.
Referenced by statement_arrows().
void build_full_ctrl_graph | ( | statement | s | ) |
first pass to initialize the ctrl_graph controls
STATEMENT
second pass to link the statements
Definition at line 238 of file graph.c.
References gen_multi_recurse(), gen_true(), init_ctrl_graph(), NIL, ORDERING_NUMBER, ORDERING_STATEMENT, pips_debug, statement_arrows(), statement_domain, statement_number, statement_ordering, and stmt_rewrite().
Referenced by full_control_graph(), and handle_hpf_directives().
void clean_ctrl_graph | ( | void | ) |
global mapping from statements to their control in the full control graph
the crtl_graph is freed by hand, because the default behavior is not convenient for my purpose. I would have needed a persistant statement in the control, but it is not desired in pips.
now it can be freed safely
Definition at line 53 of file graph.c.
References close_ctrl_graph(), control_predecessors, control_statement, control_successors, CONTROLMAP_MAP, gen_free_list(), get_ctrl_graph(), NIL, ORDERING_NUMBER, ORDERING_STATEMENT, pips_debug, statement_ordering, and statement_undefined.
Referenced by handle_hpf_directives().
void close_ctrl_graph_travel | ( | void | ) |
Definition at line 340 of file graph.c.
Referenced by handle_independent_directive(), handle_reduction_directive(), and propagate_synonym().
of statement
of statements
lc | control |
Definition at line 103 of file graph.c.
References CONS, CONTROL, control_statement, MAP, NIL, and STATEMENT.
Referenced by compute_cumulated_reductions(), and statement_arrows().
void full_control_graph | ( | string | name | ) |
FULL CONTROL GRAPH for module NAME.
should put something in the db if made as a pass
name | ame |
Definition at line 259 of file graph.c.
References build_full_ctrl_graph(), and db_get_memory_resource().
initializations
no loop back
Definition at line 315 of file graph.c.
References push_successors(), and travel_decision.
Referenced by handle_independent_directive(), handle_reduction_directive(), and propagate_synonym().
ps | s |
Definition at line 325 of file graph.c.
References push_successors(), and travel_decision.
Referenced by handle_independent_directive(), handle_reduction_directive(), and propagate_synonym().
|
static |
it is pushed in reverse order to preserve the depth first view.
l | control |
Definition at line 303 of file graph.c.
References CAR, CDR, CONTROL, control_statement, ENDP, and push_if_necessary().
Referenced by push_successors().
|
static |
|
static |
Definition at line 310 of file graph.c.
References control_successors, load_ctrl_graph(), and push().
Referenced by init_ctrl_graph_travel(), and next_ctrl_graph_travel().
of statements
else
true is before false
of statements
no iteration
some iterations, first
of statements
hmmm... I'm not too confident in this loop. ??? what should be done with next? ??? should I trust the graph? I hope I can.
next | statement |
Definition at line 110 of file graph.c.
References add_arrow_in_ctrl_graph(), add_arrows_in_ctrl_graph(), blocks, c_in, CAR, CDR, CONS, control_list_to_statement_list(), CONTROL_MAP, control_statement, control_successors, current, ENDP, gen_copy_seq(), gen_free_list(), gen_nconc(), instruction_block, instruction_loop, instruction_loop_p, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_block, is_instruction_call, is_instruction_goto, is_instruction_loop, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_body, NIL, pips_internal_error, STATEMENT, STATEMENT_, statement_instruction, statement_undefined, test_false, test_true, unstructured_control, whileloop_body, and x.
Referenced by build_full_ctrl_graph().
|
static |
Definition at line 232 of file graph.c.
References bound_ctrl_graph_p(), make_control(), NIL, and store_ctrl_graph().
Referenced by build_full_ctrl_graph(), and drop_dummy_loops().
Static data for the travel.
Definition at line 290 of file graph.c.
Referenced by init_ctrl_graph_travel(), and next_ctrl_graph_travel().