PIPS
|
#include <stdio.h>
#include "linear.h"
#include "genC.h"
#include "text.h"
#include "text-util.h"
#include "ri.h"
#include "misc.h"
#include "ri-util.h"
#include "prettyprint.h"
Go to the source code of this file.
Functions | |
static statement | body_to_assignment_statement (statement b) |
The tests necessary to check the underlying assumptions have been performed in text_loop(): b is either an assignment or a sequence with only one statement which is an assignment. More... | |
text | text_loop_90 (entity module, const char *label, int margin, loop obj, int n) |
Generate range subscript for simple loop with only one assignment. More... | |
static expression | expand_call (expression e, entity f, list args) |
Only one call site for expand_call(). More... | |
expression | expand_reference (syntax s, expression e, entity i, range r) |
A reference cannot always be expanded. More... | |
expression | expand_expression (e, i, r) |
Expression with a non-expandable sub-expression, e.g. More... | |
Variables | |
static set | vectors |
Prettyprint one FORTRAN 90 loop as an array expression. More... | |
The tests necessary to check the underlying assumptions have been performed in text_loop(): b is either an assignment or a sequence with only one statement which is an assignment.
because of the input assumptions
Definition at line 61 of file fortran90.c.
References CAR, instruction_sequence, instruction_sequence_p, sequence_statements, STATEMENT, statement_instruction, and statement_undefined.
Referenced by text_loop_90().
|
static |
Only one call site for expand_call().
All args have been newly allocated there and are re-used here to build new_e, Or they are freed without forgetting the references thru set "vectors". There is no sharing between e and new_e.
strcmp( entity_local_name( f ), DIVIDE_OPERATOR_NAME ) == 0 ||
FI: Sharing thru args? Yes, but see above.
No sharing between e and new_e
Definition at line 145 of file fortran90.c.
References CAR, CDR, copy_expression(), entity_local_name(), EXPRESSION, expression_syntax, expression_undefined, f(), int_to_expression(), is_syntax_call, make_call(), make_expression(), make_syntax(), MakeBinaryCall(), MAP, MINUS_OPERATOR_NAME, MULTIPLY_OPERATOR_NAME, normalized_undefined, PLUS_OPERATOR_NAME, range_increment, range_lower, range_upper, set_add_element(), set_belong_p(), syntax_range, syntax_range_p, update_range(), and vectors.
Referenced by expand_expression().
expression expand_expression | ( | e | , |
i | , | ||
r | |||
) |
Expression with a non-expandable sub-expression, e.g.
a non-expandable reference, cannot be expanded.
Arguments are not (should not be) shared with the returned expression.
FI: I do not know why dim is computed. Old cut-and-paste from expand_reference()?
Definition at line 286 of file fortran90.c.
References call_arguments, call_function, CAR, CONS, expand_call(), expand_reference(), EXPRESSION, expression_syntax, expression_undefined, expression_undefined_p, f(), gen_nreverse(), is_syntax_call, is_syntax_range, is_syntax_reference, MAPL, NIL, pips_internal_error, set_belong_p(), syntax_call, syntax_tag, and vectors.
Referenced by expand_reference(), and text_loop_90().
expression expand_reference | ( | syntax | s, |
expression | e, | ||
entity | i, | ||
range | r | ||
) |
A reference cannot always be expanded.
Subscript expression coupling as in A(I,I) prevent expansion and an undefined expression is returned. Non-affine expressions such as A(I**2) cannot be transformed into triplets but can be tranformed into implicit DO vectors.
Arguments s, e, i and r should not be shared with the returned expression.
expand occurence of loop index
expand 1 subscript expression or fail or leave unexpanded
If dim is greater than 1, subscript expressions are coupled as in A(I,I+1).
new_args should be freed
Just the spine or more?
Definition at line 225 of file fortran90.c.
References CAR, CONS, copy_expression(), copy_range(), expand_expression(), EXPRESSION, expression_undefined, expression_undefined_p, gen_free_list(), gen_nreverse(), is_syntax_range, is_syntax_reference, make_expression(), make_reference(), make_syntax(), MAPL, NIL, normalized_undefined, reference_indices, reference_variable, same_entity_p(), set_add_element(), set_belong_p(), syntax_reference, and vectors.
Referenced by expand_expression().
Generate range subscript for simple loop with only one assignment.
fortran90.c
text_loop_90() only is called if the loop is parallel and if its body is a unique assignment statement or a list containing a unique assignment.
statement_ordering must be initialized too to avoid a prettyprinter warning
FI: Although new_s has been converted to text, it cannot always be freed. I do not know which part of new_s is reused in the result of text_statement() or somewhere else... Found with valgrind and validation case Prettyprint/aa01.tpips
No legal vector form has been found
module | odule |
label | abel |
margin | argin |
obj | bj |
Definition at line 77 of file fortran90.c.
References body_to_assignment_statement(), call_arguments, CAR, CDR, expand_expression(), EXPRESSION, expression_consistent_p(), expression_undefined, expression_undefined_p, free_expression(), gen_free_list(), instruction_call, loop_body, loop_consistent_p(), loop_index, loop_range, make_assign_statement(), module, NIL, pips_assert, set_free(), set_make(), set_pointer, statement_comments, statement_instruction, statement_number, statement_ordering, text_loop_default(), text_statement(), text_undefined, and vectors.
Referenced by text_loop().
|
static |
Prettyprint one FORTRAN 90 loop as an array expression.
Pierre Jouvelot
For one level only loop, with one assignment as body. Replaces occurences of the index variable by ranges in expressions. Ranges are prettyprinted as triplet when they occur as subscript expressions and as vectors with implicit DO otherwise. If the replacement cannot occur, for instance because subscript expressions are coupled, the loop is printed as a loop.
There are/were memory leaks here since a new expression is constructed. FI: To keep track of vectorized subexpressions (a guess...)
Definition at line 56 of file fortran90.c.
Referenced by expand_call(), expand_expression(), expand_reference(), and text_loop_90().