PIPS
control.h
Go to the documentation of this file.
1 /* Warning! Do not modify this file that is automatically generated! */
2 /* Modify src/Libs/control/control-local.h instead, to add your own modifications. */
3 
4 /* header file built by cproto */
5 
6 #ifndef control_header_included
7 #define control_header_included
8 /* control-local.h */
9 /*
10 
11  $Id: control-local.h 23065 2016-03-02 09:05:50Z coelho $
12 
13  Copyright 1989-2016 MINES ParisTech
14 
15  This file is part of PIPS.
16 
17  PIPS is free software: you can redistribute it and/or modify it
18  under the terms of the GNU General Public License as published by
19  the Free Software Foundation, either version 3 of the License, or
20  any later version.
21 
22  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
23  WARRANTY; without even the implied warranty of MERCHANTABILITY or
24  FITNESS FOR A PARTICULAR PURPOSE.
25 
26  See the GNU General Public License for more details.
27 
28  You should have received a copy of the GNU General Public License
29  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
30 
31 */
32 /* -- control.h */
33 
34 #ifndef CONTROL_INCLUDED
35 #define CONTROL_INCLUDED
36 
37 /* Define the environment variables used to select which controlizer
38  version to use independently of which one was activated at the pipsmake
39  level: */
40 /* The name of the one to force the use of the new controlizer: */
41 #define USE_NEW_CONTROLIZER_ENV_VAR_NAME "PIPS_USE_NEW_CONTROLIZER"
42 /* The name of the one to force the use of the old controlizer: */
43 #define USE_OLD_CONTROLIZER_ENV_VAR_NAME "PIPS_USE_OLD_CONTROLIZER"
44 #endif
45 /* cproto-generated files */
46 /* controlizer.c */
47 extern char vcid_control_controlizer[];
56 extern control find_exit_control_node(list /*ctls*/, control /*succ*/);
57 extern control find_or_create_exit_control_node(list /*ctls*/, control /*succ*/);
58 extern bool controlize_statement(control /*c_res*/, control /*succ*/, hash_table /*used_labels*/);
59 extern statement hcfg(statement /*st*/);
60 /* old_controlizer.c */
61 extern char vcid_control_old_controlizer[];
62 extern statement loop_header(statement /*sl*/);
63 extern statement loop_test(statement /*sl*/);
64 extern statement loop_inc(statement /*sl*/);
65 extern statement forloop_header(statement /*sl*/);
66 extern statement forloop_test(statement /*sl*/);
67 extern statement forloop_inc(statement /*sl*/);
68 extern unstructured control_graph(statement /*st*/);
69 /* graph.c */
70 extern bool ctrl_graph_undefined_p(void);
71 extern void reset_ctrl_graph(void);
72 extern void error_reset_ctrl_graph(void);
73 extern void set_ctrl_graph(controlmap /*o*/);
75 extern void init_ctrl_graph(void);
76 extern void close_ctrl_graph(void);
77 extern void store_ctrl_graph(statement /*k*/, control /*v*/);
78 extern void update_ctrl_graph(statement /*k*/, control /*v*/);
81 extern bool bound_ctrl_graph_p(statement /*k*/);
82 extern void store_or_update_ctrl_graph(statement /*k*/, control /*v*/);
83 extern void clean_ctrl_graph(void);
85 extern void build_full_ctrl_graph(statement /*s*/);
86 extern void full_control_graph(string /*name*/);
87 extern void init_ctrl_graph_travel(statement /*s*/, bool (* /*decision*/)(statement));
88 extern bool next_ctrl_graph_travel(statement */*ps*/);
89 extern void close_ctrl_graph_travel(void);
90 /* hierarchize.c */
92 /* module.c */
93 extern bool new_controlizer(const char */*module_name*/);
94 extern bool controlizer(const char */*module_name*/);
95 /* unspaghettify.c */
96 extern char vcid_unspaghettify[];
97 extern void fuse_sequences_in_unstructured(statement /*s*/);
99 extern void unspaghettify_or_restructure_statement(statement /*mod_stmt*/);
100 extern void unspaghettify_statement(statement /*mod_stmt*/);
101 extern void simple_restructure_statement(statement /*mod_stmt*/);
102 extern bool unspaghettify(const string /*mod_name*/);
103 extern void restructure_statement(statement /*mod_stmt*/);
104 extern bool restructure_control(const string /*mod_name*/);
105 /* cfg.c */
106 extern bool unstructured_consistency_p(unstructured /*u*/, bool /*assert_p*/);
107 extern bool unstructured_while_p(unstructured /*u*/);
108 /* unreachable.c */
109 extern void init_reachable(statement /*start*/);
110 extern bool statement_reachable_p(statement /*s*/);
111 extern bool statement_continued_p(statement /*s*/);
112 extern void close_reachable(void);
113 /* bourdoncle.c */
114 extern bool meaningless_control_p(control /*c*/);
115 extern bool control_test_p(control /*c*/);
117 extern control control_to_ancestor(control /*vertex*/, hash_table /*ancestor_map*/);
118 extern control control_shallow_copy(control /*c*/);
119 extern unstructured unstructured_shallow_copy(unstructured /*u*/, hash_table /*ancestor_map*/);
120 extern unstructured partition_to_unstructured(control /*vertex*/, list /*partition*/);
121 extern void intersect_successors_with_partition_or_complement(control /*c*/, list /*partition*/, bool /*complement_p*/);
122 extern void intersect_successors_with_partition(control /*c*/, list /*partition*/);
123 extern void intersect_successors_with_partition_complement(control /*c*/, list /*partition*/);
124 extern list bourdoncle_partition(unstructured /*u*/, unstructured */*p_ndu*/, hash_table */*p_ancestor_map*/, hash_table */*p_scc_map*/);
125 extern list bourdoncle_component(control /*vertex*/, hash_table /*ancestor_map*/, hash_table /*scc_map*/);
126 extern int bourdoncle_visit(control /*vertex*/, list */*ppartition*/, hash_table /*ancestor_map*/, hash_table /*scc_map*/);
127 extern unstructured ancestor_cycle_head_to_scc(control /*a*/, hash_table /*scc_map*/);
128 extern unstructured proper_cycle_head_to_scc(control /*h*/, hash_table /*scc_map*/);
129 extern bool cycle_head_p(control /*c*/, hash_table /*ancestor_map*/, hash_table /*scc_map*/);
130 extern bool proper_cycle_head_p(control /*c*/, hash_table /*scc_map*/);
131 extern bool direct_cycle_head_p(control /*c*/, hash_table /*scc_map*/);
132 extern unstructured cycle_head_to_scc(control /*c*/, hash_table /*ancestor_map*/, hash_table /*scc_map*/);
133 extern bool one_successor_kind_only_p(control /*c*/, bool /*true_p*/);
134 extern bool true_successors_only_p(control /*c*/);
135 extern bool false_successors_only_p(control /*c*/);
136 extern void bourdoncle_free(unstructured /*ndu*/, hash_table /*ancestor_map*/, hash_table /*scc_map*/);
137 /* for_to_do_or_while_loops.c */
138 extern bool guess_late_read_effect_on_entity(expression /*init*/, entity /*loop_index*/);
139 extern sequence for_to_do_loop_conversion(forloop /*theloop*/, statement /*parent*/);
141 extern bool for_loop_to_do_loop(const string /*module_name*/);
142 extern sequence for_to_while_loop_conversion(expression /*init*/, expression /*cond*/, expression /*incr*/, statement /*body*/, extensions /*exts*/);
145 extern bool for_loop_to_while_loop(const string /*module_name*/);
146 /* dowhile_to_while.c */
147 extern bool dowhile_to_while(const char */*module_name*/);
148 extern void do_loop_to_while_loop(statement /*sl*/);
149 extern void do_loop_to_for_loop(statement /*sl*/);
150 #endif /* control_header_included */
void do_loop_to_while_loop(statement)
converts a doloop to a while loop, in place
void reset_ctrl_graph(void)
void full_control_graph(string)
FULL CONTROL GRAPH for module NAME.
Definition: graph.c:259
void set_ctrl_graph(controlmap)
bool control_test_p(control)
Check that a node is used as a test in a CFG.
Definition: bourdoncle.c:175
bool cycle_head_p(control, hash_table, hash_table)
This node is a cycle call site.
Definition: bourdoncle.c:2385
char vcid_control_old_controlizer[]
old_controlizer.c
bool ctrl_graph_undefined_p(void)
graph.c
statement take_out_the_exit_node_if_not_a_continue(statement)
Extract the statement from an exit node of an unstructured statement if it is a useful statement.
void simple_restructure_statement(statement)
A simple cleaning of the control graph without major topological restructuring.
bool unstructured_consistency_p(unstructured, bool)
cfg.c
Definition: cfg.c:52
void unspaghettify_or_restructure_statement(statement)
The entry point common to unspaghettify or restructure a module:
bool meaningless_control_p(control)
bourdoncle.c
Definition: bourdoncle.c:154
bool unstructured_while_p(unstructured)
Test if an unstructured is found to be like a structured while-loop.
Definition: cfg.c:191
void restructure_statement(statement)
The real entry point of control graph restructuring:
void transform_a_for_loop_statement_into_a_while_loop(statement)
Same as above, but with no calls to ancestors.
bool true_successors_only_p(control)
Definition: bourdoncle.c:2474
bool controlizer(const char *)
The old controlizer user interface.
Definition: module.c:224
list control_list_to_statement_list(list)
of statement
Definition: graph.c:103
bool false_successors_only_p(control)
Definition: bourdoncle.c:2481
void control_graph_recursive_decomposition(unstructured)
hierarchize.c
Definition: hierarchize.c:563
bool restructure_control(const string)
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code,...
bool dowhile_to_while(const char *)
dowhile_to_while.c
bool guess_late_read_effect_on_entity(expression, entity)
for_to_do_or_while_loops.c
char vcid_control_controlizer[]
cproto-generated files
Definition: controlizer.c:40
unstructured partition_to_unstructured(control, list)
Build a new unstructured (CFG) for partition.
Definition: bourdoncle.c:1053
control control_to_ancestor(control, hash_table)
If vertex is an ancestor control node from the input control graph, return vertex,...
Definition: bourdoncle.c:854
controlmap get_ctrl_graph(void)
void fuse_sequences_in_unstructured(statement)
Try to transform each control sequence in a single statement instead of a list of control nodes:
void store_ctrl_graph(statement, control)
control control_shallow_copy(control)
Definition: bourdoncle.c:970
bool for_loop_to_while_loop(const string)
For-loop to while-loop transformation phase.
void transform_a_for_loop_into_a_while_loop(forloop)
Try to to transform the C-like for-loops into Fortran-like do-loops.
bool unspaghettify(const string)
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code.
void do_loop_to_for_loop(statement)
converts a doloop to a for loop, in place
void build_full_ctrl_graph(statement)
Definition: graph.c:238
bool statement_reachable_p(statement)
Test if the given statement is reachable from some statements given at init_reachable(start)
Definition: unreachable.c:234
void intersect_successors_with_partition_complement(control, list)
Definition: bourdoncle.c:1230
bool new_controlizer(const char *)
module.c
Definition: module.c:102
bool for_loop_to_do_loop(const string)
For-loop to do-loop transformation phase.
control delete_ctrl_graph(statement)
bool statement_continued_p(statement)
Test if the execution goes on after the given statement.
Definition: unreachable.c:242
bool next_ctrl_graph_travel(statement *)
Definition: graph.c:325
void init_ctrl_graph_travel(statement, bool(*)(statement))
Definition: graph.c:315
void clean_ctrl_graph(void)
global mapping from statements to their control in the full control graph
Definition: graph.c:53
void close_ctrl_graph(void)
control load_ctrl_graph(statement)
void init_ctrl_graph(void)
bool direct_cycle_head_p(control, hash_table)
This node is directly associated to a specific cycle.
Definition: bourdoncle.c:2422
void intersect_successors_with_partition(control, list)
Definition: bourdoncle.c:1224
unstructured cycle_head_to_scc(control, hash_table, hash_table)
The ancestor of this node is associated to a specific cycle.
Definition: bourdoncle.c:2433
bool bound_ctrl_graph_p(statement)
void bourdoncle_free(unstructured, hash_table, hash_table)
Definition: bourdoncle.c:2506
unstructured unstructured_shallow_copy(unstructured, hash_table)
Definition: bourdoncle.c:1009
void intersect_successors_with_partition_or_complement(control, list, bool)
If complement_p, preserve successors in the complement of partition.
Definition: bourdoncle.c:1181
sequence for_to_do_loop_conversion(forloop, statement)
Try to convert a C-like for-loop into a Fortran-like do-loop.
void store_or_update_ctrl_graph(statement, control)
void add_control_to_embedding_control_list(control)
Definition: bourdoncle.c:535
unstructured proper_cycle_head_to_scc(control, hash_table)
Retrieve a scc_u from its head.
Definition: bourdoncle.c:2368
void close_ctrl_graph_travel(void)
Definition: graph.c:340
int bourdoncle_visit(control, list *, hash_table, hash_table)
Definition: bourdoncle.c:2293
bool proper_cycle_head_p(control, hash_table)
This node is really the head of a cycle (red on daVinci pictures).
Definition: bourdoncle.c:2405
char vcid_unspaghettify[]
unspaghettify.c
Definition: unspaghettify.c:30
list bourdoncle_partition(unstructured, unstructured *, hash_table *, hash_table *)
Definition: bourdoncle.c:1902
unstructured ancestor_cycle_head_to_scc(control, hash_table)
scc_map maps either the ancestor node to its scc if the transformers are computed without context,...
Definition: bourdoncle.c:2356
bool one_successor_kind_only_p(control, bool)
useful for non-deterministic control flow graph only
Definition: bourdoncle.c:2451
void close_reachable(void)
Remove reachability information about previously checked statements.
Definition: unreachable.c:252
void update_ctrl_graph(statement, control)
list bourdoncle_component(control, hash_table, hash_table)
Definition: bourdoncle.c:2218
void try_to_transform_a_for_loop_into_a_do_loop(forloop)
Try to to transform the C-like for-loops into Fortran-like do-loops.
void error_reset_ctrl_graph(void)
sequence for_to_while_loop_conversion(expression, expression, expression, statement, extensions)
Build a sequence with a while-loop from for-loop parameters.
void unspaghettify_statement(statement)
The real entry point of unspaghettify:
statement unsugared_whileloop_header(statement)
void init_reachable(statement)
unreachable.c
Definition: unreachable.c:223
statement loop_header(statement)
LOOP_HEADER, LOOP_TEST and LOOP_INC build the desugaring phases of a do-loop L for the loop header (i...
statement loop_test(statement)
bool controlize_statement(control, control, hash_table)
Controlize a statement that is in a control node, that is restructure it to have a HCFG recursively (...
Definition: controlizer.c:2493
unstructured control_graph(statement)
CONTROL_GRAPH returns the control graph of the statement ST.
statement forloop_header(statement)
control find_or_create_exit_control_node(list, control)
FI: remake of function above, incomplete backward approach, now obsolete because the forward approach...
Definition: controlizer.c:1809
statement forloop_inc(statement)
statement loop_inc(statement)
control find_exit_control_node(list, control)
Find the exit node of a sub-CFG defined by the list of nodes ctls and by the first node to execute wh...
Definition: controlizer.c:1739
statement forloop_test(statement)
statement hcfg(statement)
Compute the hierarchical control flow graph (HCFG) of a statement.
Definition: controlizer.c:2621
statement unsugared_forloop_inc(statement)
Definition: controlizer.c:569
statement unsugared_loop_inc(statement)
Do an index increment instruction for do-loop unsugaring.
Definition: controlizer.c:554
statement unsugared_loop_test(statement)
Do a crude test of end of do-loop for do-loop unsugaring.
Definition: controlizer.c:502
statement unsugared_whileloop_test(statement)
Definition: controlizer.c:531
statement unsugared_forloop_header(statement)
Definition: controlizer.c:474
statement unsugared_forloop_test(statement)
Definition: controlizer.c:518
statement unsugared_loop_header(statement)
LOOP_HEADER, LOOP_TEST and LOOP_INC build the desugaring phases of a do-loop L for the loop header (i...
Definition: controlizer.c:463
The structure used to build lists in NewGen.
Definition: newgen_list.h:41