PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "linear.h"
#include "genC.h"
#include "ri.h"
#include "ri-util.h"
#include "workspace-util.h"
#include "text-util.h"
#include "database.h"
#include "misc.h"
#include "pipsdbm.h"
#include "resources.h"
#include "properties.h"
#include "control.h"
Go to the source code of this file.
Enumerations | |
enum | { N_ITER_RESTRUCTURE_FIX_POINT = 10 } |
lint More... | |
enum | structured_test_type { STRUCTURED_NULL_IF = 1901 , STRUCTURED_IF_THEN = 1966 , STRUCTURED_IF_ELSE = 1997 , STRUCTURED_IF_THEN_ELSE = 2000 } |
Functions | |
static void | initialize_unspaghettify_statistics () |
static int | total_number_of_restructurations () |
Compute the number of all the computations that have been done. More... | |
static void | display_unspaghettify_statistics () |
static void | remove_useless_continue_or_empty_code_in_unstructured (unstructured u) |
Remove a useless continue in a sequence of control since it is typically the kind of useless things generated by the controlizer... More... | |
static void | clean_up_exit_node (unstructured u) |
The controlizer of PIPS seems to have a bug: it put an empty successor node to the so-called exit node. More... | |
void | fuse_sequences_in_unstructured (statement s) |
Try to transform each control sequence in a single statement instead of a list of control nodes: More... | |
static bool | take_out_the_entry_node_of_the_unstructured (statement s, statement *new_unstructured_statement) |
Take the entry node out of the unstructured if it is not useful, such as not an IF or a node without predecessor. More... | |
static bool | __attribute__ ((unused)) |
If the unstructured begin and/or end with a sequence, move the sequence(s) out of the unstructured and return a new statement with an equivalent but more structured code. More... | |
statement | take_out_the_exit_node_if_not_a_continue (statement s) |
Extract the statement from an exit node of an unstructured statement if it is a useful statement. More... | |
static void | restructure_this_test (control c, structured_test_type t) |
static bool | restructure_if_then_else (statement s) |
Try to restructure the unstructured IF/THEN/ELSE. More... | |
static void | recursively_restructure_an_unstructured (statement s) |
Try to recursively restructure the unstructured: More... | |
static void | clean_up_control (statement s) |
This is the function that is applied on each statement of the code in a bottom-up way to clean up easy things after the controlizer. More... | |
static void | recover_structured_while (unstructured u) |
Try to recover structured while loops in an already recursively restructured control graph. More... | |
void | unspaghettify_or_restructure_statement (statement mod_stmt) |
The entry point common to unspaghettify or restructure a module: More... | |
void | unspaghettify_statement (statement mod_stmt) |
The real entry point of unspaghettify: More... | |
void | simple_restructure_statement (statement mod_stmt) |
A simple cleaning of the control graph without major topological restructuring. More... | |
bool | unspaghettify (const string mod_name) |
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code. More... | |
void | restructure_statement (statement mod_stmt) |
The real entry point of control graph restructuring: More... | |
bool | restructure_control (const string mod_name) |
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code, etc. More... | |
Variables | |
char | vcid_unspaghettify [] = "%A% ($Date: 2004/01/23 13:55:04 $, ) version $Revision: 14223 $, got on %D%, %T% [%P%].\n Copyright (c) ï¿œcole des Mines de Paris Proprietary." |
Ronan Keryell, 1995. More... | |
static bool | currently_apply_test_restructuring |
static bool | currently_apply_recursive_decomposition |
static int | number_of_restructured_if_then |
To print some statistics about control graph restructuration: More... | |
static int | number_of_restructured_if_else |
static int | number_of_restructured_if_then_else |
static int | number_of_restructured_null_if |
static int | number_of_recovered_do_while |
static int | number_of_recovered_while |
anonymous enum |
lint
Avoid infinite restructuring in some cases:
Enumerator | |
---|---|
N_ITER_RESTRUCTURE_FIX_POINT |
Definition at line 53 of file unspaghettify.c.
enum structured_test_type |
Enumerator | |
---|---|
STRUCTURED_NULL_IF | |
STRUCTURED_IF_THEN | |
STRUCTURED_IF_ELSE | |
STRUCTURED_IF_THEN_ELSE |
Definition at line 55 of file unspaghettify.c.
|
static |
If the unstructured begin and/or end with a sequence, move the sequence(s) out of the unstructured and return a new statement with an equivalent but more structured code.
It returns true if the unstructured has disappeared and else FALSE.
If the unstructured is still here, the statement directly owning it is returned in new_unstructured_statement: Still buggy. No longer used.
no gcc warning
The entry point of the unstructured:
and its exit point:
Find the biggest sequence from the begin:
Well, we have an unstructured with one control node, it is still a sequence:
It is in fact the exit_node:
OK, there is a sequence at the beginning of the unstructured:
If there is still something in the sequence:
Find the biggest sequence from the end:
In fact, an unstructured IF is noted as a control node with 2 successors, that means that we cannot take the biggest sequence since it may move one successor of such an IF and PIPS would be out.
OK, it is actually an IF before the end sequence. Try to keep a spare node from the sequence. Since the controllizer seems to put always a continue as an IF successor, it is seems sensible.
There is one successor, that is the sequence has at least 2 control node. Keep the first node as part as IF unstructured:
There is only one node in the sequence. It remains in the unstructured:
Then there is a sequence at the end of the unstructured:
Now, restructure all the stuff only if there is something to do:
All the unstructured is a sequence, replace it with the equivalent block of statement statement:
Discard the unstructured instruction:
Warn that the unstructured no longer exist:
There is still an unstructured, but with one pre- or post-sequence:
Put the unstructured in the new statement list:
There is a pre-sequence before the unstructured:
Put the sequence before the unstructured:
Update the entry node of the unstructured:
Clean up the equivalent control sequence:
There is a post-sequence after the unstructured:
Update the exit node of the unstructured:
Clean up the equivalent control sequence:
Make the instruction of the old statement with the sequence(s) and the stripped-down unstructured:
By default the unstructured is not changed, thus return the statement owning it:
Definition at line 562 of file unspaghettify.c.
References CAR, CONS, CONTROL, control_predecessors, control_successors, control_undefined, discard_a_control_sequence_without_its_statements(), discard_an_unstructured_without_its_statements(), gen_length(), gen_nconc(), generate_a_statement_list_from_a_control_sequence(), instruction_to_statement(), instruction_unstructured, make_instruction_block(), NIL, STATEMENT, statement_instruction, statement_undefined, unstructured_control, and unstructured_exit.
|
static |
This is the function that is applied on each statement of the code in a bottom-up way to clean up easy things after the controlizer.
Even if we deal with the control graph, that is the "unstructured" instruction, we need to deal with the statement over the unstructured since the restructuration can move some code outside of the unstructured in the statement.
fprintf(stderr, "[ The current statement : ]\n");
print_statement(s);
print_statement(s);
print_statement(s);
Definition at line 1098 of file unspaghettify.c.
References clean_up_exit_node(), display_linked_control_nodes(), ifdebug, instruction_unstructured, instruction_unstructured_p, pips_assert, pips_debug, remove_all_unreachable_controls_of_an_unstructured(), remove_useless_continue_or_empty_code_in_unstructured(), statement_instruction, unstructured_consistent_p(), unstructured_control, and unstructured_exit.
Referenced by unspaghettify_or_restructure_statement().
|
static |
The controlizer of PIPS seems to have a bug: it put an empty successor node to the so-called exit node.
Correct this fact:
Remove the useless node:
Now the exit node has no longer a successor:
Definition at line 221 of file unspaghettify.c.
References CAR, CONTROL, CONTROL_, control_predecessors, control_statement, control_successors, control_undefined, empty_statement_or_continue_p(), gen_free_list(), gen_length(), NIL, pips_assert, and unstructured_exit.
Referenced by clean_up_control().
|
static |
Definition at line 99 of file unspaghettify.c.
References currently_apply_test_restructuring, get_bool_property(), number_of_recovered_do_while, number_of_recovered_while, number_of_restructured_if_else, number_of_restructured_if_then, number_of_restructured_if_then_else, number_of_restructured_null_if, total_number_of_restructurations(), and user_log().
Referenced by unspaghettify_or_restructure_statement().
void fuse_sequences_in_unstructured | ( | statement | s | ) |
Try to transform each control sequence in a single statement instead of a list of control nodes:
The entry point of the unstructured:
and its exit point:
To store the list of the controls to fuse we use a mapping since we need to keep track of eventual previous fuse on a control:
print_statement(s);
Select a node with only one successor:
Since I use an O(n) algorithm instead of an O(n^2) all this condition must be checked again later since these topological and semantical properties may have changed during the fusion phase. I think it is true because the fused graph is included into the former graph but I am too lazy to write a proof... :-( Have a look to Validation/Control/create.f.
...Accept the exit node
Ok, we have found a node in a sequence. Note that we cannot fuse with the entry node since it must keep this role...
But if c is empty, we can fuse it with any successor without changing the semantincs, even if the successor is the entry node. Don't do this if there is a comment since it mess up the original source look-alike.
The fact we can have a cycle is considered a page below...
Put the control in the fuse list. Since no fusing occurs yet, the address of a control node is itself:
Use also a real list to remove the non-determinism of a later HASH_MAP. Note that since it follow a depth-first algorithm, the output program is more likely to be similar to the output, especially with cycles in the control graph:
Reverse the list to follow the order of appearance :
Now, since we have the list of the control nodes to fuse with their successors, do the fusion:
Find the address of a control node to fuse even if it has already been fused with predecessors through a transitive closure:
...The control node has not been moved
...or it has not been moved because it is not a control node to fuse anyway.
Ok, the node has been located:
Follow a former control movement:
fprintf(stderr,"Statement with label \"s" for control a_control_fo_fuse=p
",
entity_local_name(statement_label(control_statement(a_control_to_fuse))),
a_control_to_fuse);
print_statement(control_statement(a_control_to_fuse));
fprintf(stderr,"Let's print the statement a second time to see its label again:\n");
print_statement(control_statement(a_control_to_fuse));
}
pips_debug(5, "All the unstructured %p:\n", u);
print_statement(s);
}
Verify that the fusion is still valid:
...Accept the exit node
||entity_empty_label_p(statement_to_label(control_statement(the_successor)))
Well, it seems to be a real sequence, at most a loop with 2 control nodes...
make st with the statements of 2 following nodes:
Update the entry node if we fuse with it:
If the node "the_successor" is in the fuse list, we want to keep track of its new place, that is in fact fused in "a_control_to_fuse", so that an eventual fusion will use "a_control_to_fuse" instead of "the_successor":
Ok, "the_successor" is a node to fuse or that has been already fused (in this case the following is useless, but anyway...). Thus we keep track of its new location:
Update the potentially modified entry and exit nodes:
Definition at line 250 of file unspaghettify.c.
References CAR, CONS, CONTROL, control_consistent_p(), CONTROL_MAP, control_predecessors, control_statement, control_successors, empty_statement_or_continue_p(), empty_statement_or_continue_without_comment_p(), fprintf(), fuse_2_control_nodes(), gen_free_list(), gen_in_list_p(), gen_length(), gen_nreverse(), get_bool_property(), hash_defined_p(), hash_get(), hash_pointer, hash_put(), hash_table_free(), hash_table_make(), hash_update(), ifdebug, instruction_unstructured, MAP, NIL, pips_assert, pips_debug, print_arguments(), statement_instruction, statement_to_implicit_target_labels(), statement_to_label(), unstructured_consistent_p(), unstructured_control, and unstructured_exit.
Referenced by recursively_restructure_an_unstructured().
|
static |
Definition at line 76 of file unspaghettify.c.
References number_of_recovered_do_while, number_of_recovered_while, number_of_restructured_if_else, number_of_restructured_if_then, number_of_restructured_if_then_else, and number_of_restructured_null_if.
Referenced by unspaghettify_or_restructure_statement().
|
static |
Try to recover structured while loops in an already recursively restructured control graph.
It looks like a single node unstructured. Nothing to look at, here. Anyway, it should not exist if the restructured was launched on the graph before...
There is one simple node at unstructured entry: try to detect a "do ... while();"
We have entry: ... if (cond) goto entry; exit:
We have entry: ... if (cond) goto exit; else goto entry;
Build the equivalent " do body; while(cond)". Do not save any label yet, but use the same line number as the "if" one:
Remove the test control node after having protected recycled old stuff from being discarded:
Relink the remaining nodes in sequence, to be fused later somewhere else:
we have: entry: if (cond) goto entry; exit:
so we can generate a while(cond);
we have: entry: if (cond) { body goto entry; } exit:
so we can generate a while(cond) body;
we have: entry: if (cond) goto exit; else goto entry; exit:
so we can generate a while(!cond);
we have: entry: if (cond) goto exit; else { body goto entry; } exit:
so we can generate a while(!cond) body;
Build the equivalent "while(cond) body;". Do not save any label yet, but use the same line number as the "if" one:
Other restructuring is applied afterwards to replace the unstructured by a simple statement, the entry and the exit are still linked into a lazy sequence.
Increase the statistics. Used to rerun a restrustructuring shot after a modification too:
Definition at line 1140 of file unspaghettify.c.
References C_NOT_OPERATOR_NAME, CAR, CDR, CONTROL, control_statement, control_successors, control_undefined, CreateIntrinsic(), display_linked_control_nodes(), entity_empty_label(), expression_undefined, free_statement(), gen_length(), ifdebug, instruction_test, link_2_control_nodes(), make_continue_statement(), make_whileloop_statement(), MakeUnaryCall(), number_of_recovered_do_while, number_of_recovered_while, pips_debug, pips_internal_error, remove_a_control_from_an_unstructured_without_relinking(), statement_instruction, statement_number, statement_undefined, test_condition, unlink_2_control_nodes(), unstructured_control, and unstructured_exit.
Referenced by unspaghettify_or_restructure_statement().
|
static |
Try to recursively restructure the unstructured:
Used to keep track of the statement that contains directly the unstructured:
Just stop, it is not or no longer an unstructured.
Replace control sequences by simple nodes:
print_statement(s);
If take_out_the_entry_node_of_the_unstructured() has not been able to discard the unstructured, go on with some other optimizations:
pips_debug(5,
"after take_out_the_entry_node_of_the_unstructured\n");
print_statement(s);
}
print_statement(s);
If we ask for, try to restructure the tests:
print_statement(s);
Well, some tests has been restructured, recurse:
Definition at line 1039 of file unspaghettify.c.
References currently_apply_test_restructuring, fuse_sequences_in_unstructured(), ifdebug, instruction_unstructured_p, pips_assert, pips_debug, restructure_if_then_else(), statement_consistent_p(), statement_instruction, take_out_the_entry_node_of_the_unstructured(), and take_out_the_exit_node_if_not_a_continue().
Referenced by unspaghettify_or_restructure_statement().
|
static |
Remove a useless continue in a sequence of control since it is typically the kind of useless things generated by the controlizer...
The entry point of the unstructured:
and its exit point:
Do not remove the exit nor the entry node node since it is boring to relink the entry and exit node... That is not important since there is another pass that fuse the sequences. Dead code elimination should remove these structured CONTINUE afterward...
Do not deal with any number of predecessor since we do not want to remove the node 100 in : goto 100 100 goto 200 200 goto 100
There may be also some unreachable continues, that are without predecessors (0)... We want to remove them also.
Well with this modification, I am not sure that this procedure is still useful...
So only 0 or 1 predecessor:
It is some useless code with no comment to spare: put it in the remove list:
Now we have the list of the control node to discard. Do the cleaning:
Definition at line 137 of file unspaghettify.c.
References CAR, CONS, CONTROL, control_consistent_p(), CONTROL_MAP, control_predecessors, control_statement, control_successors, debug(), empty_statement_or_continue_without_comment_p(), gen_free_list(), gen_length(), ifdebug, MAPL, NIL, pips_assert, pips_debug, remove_a_control_from_an_unstructured(), statement_identification(), unstructured_control, and unstructured_exit.
Referenced by clean_up_control().
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code, etc.
as in unspaghettify.
Do also test restructuring and control graph recursive graph decomposition.
Get the true resource, not a copy.
Reorder the module, because new statements may have been changed.
mod_name | od_name |
Definition at line 1492 of file unspaghettify.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, local_name_to_top_level_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), restructure_statement(), set_current_module_entity(), set_current_module_statement(), and strdup().
Try to restructure the unstructured IF/THEN/ELSE.
Assume that all the sequences has been previously fused.
The entry point of the unstructured:
To store the tests that can be restructured with their test types:
First mark the IF that can be restructured:
Only look at test nodes:
Note that if a node is the entry node, its fan in is once more! Nasty bug...
We've found a structured null if, that is with the then and else branches pointing to the same target:
We've found a structured if/then/else:
We've found a structured if/then without else:
We've found a structured if/else without then:
Then restructure if needed:
Hidden in a function to ease debugging...
The code has been modified:
Return the number of tests that has been restructured:
Definition at line 930 of file unspaghettify.c.
References CAR, CDR, CONTROL, control_consistent_p(), CONTROL_MAP, control_predecessors, control_successors, debug(), gen_free_list(), gen_length(), hash_int, HASH_MAP, hash_put(), hash_table_make(), instruction_unstructured, NIL, number_of_restructured_if_else, number_of_restructured_if_then, number_of_restructured_if_then_else, number_of_restructured_null_if, pips_assert, restructure_this_test(), statement_instruction, STRUCTURED_IF_ELSE, STRUCTURED_IF_THEN, STRUCTURED_IF_THEN_ELSE, STRUCTURED_NULL_IF, and unstructured_control.
Referenced by recursively_restructure_an_unstructured().
void restructure_statement | ( | statement | mod_stmt | ) |
The real entry point of control graph restructuring:
mod_stmt | od_stmt |
Definition at line 1477 of file unspaghettify.c.
References currently_apply_recursive_decomposition, currently_apply_test_restructuring, and unspaghettify_or_restructure_statement().
Referenced by restructure_control().
|
static |
print_statement(the_test_statement);
Find the exit node of the test:
Discard and unlink the then_node and else_node if any:
Now rebuild a structured test in the node c from the previous test branch contents:
print_statement(then_statement);
print_statement(else_statement);
Replace the useless CONTINUE by a NOP to improve the prettyprinted code:
Remove one of the 2 branches, since it is symetrical. In fact, since unlink_2_control_nodes() removes all the redundant branches, need to relink later:
Relink the structured test node to the successor since both pathes have been removed:
In the other case, the remaining link is just what needed.
print_statement(the_test_statement);
Definition at line 836 of file unspaghettify.c.
References CAR, CDR, CONTROL, control_statement, control_successors, discard_a_control_sequence_without_its_statements(), free_statement(), ifdebug, instruction_test, link_2_control_nodes(), make_empty_statement, pips_assert, pips_debug, statement_consistent_p(), statement_instruction, STRUCTURED_IF_ELSE, STRUCTURED_IF_THEN, STRUCTURED_IF_THEN_ELSE, STRUCTURED_NULL_IF, test_false, test_true, and unlink_2_control_nodes().
Referenced by restructure_if_then_else().
void simple_restructure_statement | ( | statement | mod_stmt | ) |
A simple cleaning of the control graph without major topological restructuring.
Used by example by PHRASE.
mod_stmt | od_stmt |
Definition at line 1435 of file unspaghettify.c.
References currently_apply_recursive_decomposition, currently_apply_test_restructuring, and unspaghettify_or_restructure_statement().
Referenced by full_spaghettify(), identify_statements_to_distribute(), and safescale_distributor().
|
static |
Take the entry node out of the unstructured if it is not useful, such as not an IF or a node without predecessor.
Return true if there is still an unstructured, false if the unstructured has been replaced by a structured statement.
If the first node is taked out, then * new_unstructured_statement returns the new statement that own the unstructured, else s.
Well, this node is useful here since it is an unstructured IF or there is a GOTO on it.
In fact the unstructured has only one control node! Transform it in a structured block of statements:
Since the unstructured may have a comment on it, we cannot put the comment on the statement block but on a CONTINUE:
Remove the unstructured:
No longer unstructured:
Take out the entry node:
The entry node is now the second node:
Definition at line 495 of file unspaghettify.c.
References CAR, CONS, CONTROL, control_predecessors, control_statement, control_successors, discard_a_control_sequence_without_its_statements(), empty_comments, entity_empty_label(), free_instruction(), gen_length(), instruction_to_statement(), instruction_unstructured, make_continue_statement(), make_instruction_block(), NIL, pips_assert, STATEMENT, statement_comments, statement_instruction, statement_label, statement_undefined, statement_with_empty_comment_p(), unlabelled_statement_p(), and unstructured_control.
Referenced by recursively_restructure_an_unstructured().
Extract the statement from an exit node of an unstructured statement if it is a useful statement.
s | is the statement that contains an unstructured |
The exit node is the landing pad of the control graph. But if it is not a continue, that means that its statement is a useful instruction at the end of the unstructured and we can take it out of the unstructured. We just return the statement directly containing the unstructured.
Right now, it does not extract a RETURN since as explained in ᅵ PIPS: Internal Representation of Fortran and C Code ᅵ about RETURN_LABEL_NAME in the Entities section, since a RETURN with a label at the exit of un unstructured is always the representation of a RETURN in Fortran unstructured code... So even for C code, a return stay inside an unstructured. RK does not think it is important anyway...
To return and keep track of the unstructured:
pips_debug(5,
"Statement at entry:\n");
print_statement(s);
}
First, linearize the exit statement since fuse_sequences_in_unstructured() may have gathered many statements in a messy way:
Then normalize to have only one non-sequence statement as the exit node:
Well, this should be always true if the sequence survived to clean_up_sequences_rewrite()...
Then, append the last statements at the end of the unstructured:
...followed by the last statements:
Fix the variables for the following pass:
Here the_exit_statement is not a sequence.
Put an empty exit node and keep the statement for the label:
Replace the unstructured by an unstructured followed by the out-keeped instruction:
Keep track of the statement number:
Heavily rely on a later clean_up_sequences to normalize the above...
Definition at line 734 of file unspaghettify.c.
References CAR, CDR, clean_up_sequences_internal(), CONS, control_statement, empty_statement_or_continue_p(), gen_free_list(), gen_length(), ifdebug, instruction_sequence, instruction_sequence_p, instruction_to_statement(), instruction_unstructured, instruction_unstructured_p, make_continue_instruction(), make_instruction_block(), NIL, nop_statement_p(), pips_assert, return_statement_p(), sequence_statements, STATEMENT, statement_consistent_p(), statement_instruction, statement_number, and unstructured_exit.
Referenced by recursively_restructure_an_unstructured().
|
static |
Compute the number of all the computations that have been done.
Definition at line 89 of file unspaghettify.c.
References number_of_recovered_do_while, number_of_recovered_while, number_of_restructured_if_else, number_of_restructured_if_then, number_of_restructured_if_then_else, and number_of_restructured_null_if.
Referenced by display_unspaghettify_statistics(), and unspaghettify_or_restructure_statement().
Try to simplify the control graph of a module by removing useless CONTINUEs, unreachable code.
Try to structure a little bit more and so on according to some properties.
Unspaguettify is now targetted to be included in the controlizer.
Get the true resource, not a copy.
Reorder the module, because new statements may have been changed.
mod_name | od_name |
Definition at line 1450 of file unspaghettify.c.
References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, local_name_to_top_level_entity(), module_reorder(), reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), strdup(), and unspaghettify_statement().
void unspaghettify_or_restructure_statement | ( | statement | mod_stmt | ) |
The entry point common to unspaghettify or restructure a module:
Track the number of restructurations done for a fix point:
To track the number of restructuring iterations:
pips_debug(5, "Statement before unspaghettify_or_restructure_statement:\n");
print_statement(mod_stmt);
}
Split the recursion in three parts to fit in my brain:
First, clean up easy things done by the controlizer:
Then try to hierarchize the control flow:
Now apply some local rule, such as if/then/else restructuring and so on:
End by removing parasitic sequences:
If something changed, retry further restructuring:
pips_debug(5, "Statement after unspaghettify_or_restructure_statement:\n");
print_statement(mod_stmt);
}
mod_stmt | od_stmt |
Definition at line 1330 of file unspaghettify.c.
References clean_up_control(), clean_up_sequences(), control_graph_recursive_decomposition(), currently_apply_recursive_decomposition, debug_off, debug_on, display_unspaghettify_statistics(), gen_recurse, gen_true(), get_bool_property(), ifdebug, initialize_unspaghettify_statistics(), N_ITER_RESTRUCTURE_FIX_POINT, pips_assert, pips_debug, pips_user_warning, put_formats_at_module_beginning(), put_formats_at_module_end(), recover_structured_while(), recursively_restructure_an_unstructured(), statement_consistent_p(), statement_domain, total_number_of_restructurations(), and unstructured_domain.
Referenced by restructure_statement(), simple_restructure_statement(), and unspaghettify_statement().
void unspaghettify_statement | ( | statement | mod_stmt | ) |
The real entry point of unspaghettify:
mod_stmt | od_stmt |
Definition at line 1421 of file unspaghettify.c.
Referenced by unspaghettify().
|
static |
Definition at line 64 of file unspaghettify.c.
Referenced by restructure_statement(), simple_restructure_statement(), unspaghettify_or_restructure_statement(), and unspaghettify_statement().
|
static |
Definition at line 63 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), recursively_restructure_an_unstructured(), restructure_statement(), simple_restructure_statement(), and unspaghettify_statement().
|
static |
Definition at line 71 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), recover_structured_while(), and total_number_of_restructurations().
|
static |
Definition at line 72 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), recover_structured_while(), and total_number_of_restructurations().
|
static |
Definition at line 68 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), restructure_if_then_else(), and total_number_of_restructurations().
|
static |
To print some statistics about control graph restructuration:
Definition at line 67 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), restructure_if_then_else(), and total_number_of_restructurations().
|
static |
Definition at line 69 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), restructure_if_then_else(), and total_number_of_restructurations().
|
static |
Definition at line 70 of file unspaghettify.c.
Referenced by display_unspaghettify_statistics(), initialize_unspaghettify_statistics(), restructure_if_then_else(), and total_number_of_restructurations().