PIPS
Block/sequence statement constructors
+ Collaboration diagram for Block/sequence statement constructors:

Functions

statement instruction_to_statement (instruction instr)
 Build a statement from a give instruction. More...
 
statement make_block_statement (list body)
 Make a block statement from a list of statement. More...
 
statement make_empty_block_statement ()
 Build an empty statement (block/sequence) More...
 
statement make_empty_statement_with_declarations_and_comments (list d, string dt, string c)
 Build an empty statement with declaration list, declaration text and comment. More...
 
void move_statement_attributes (statement from, statement to)
 Move all the attributes from one statement to another one. More...
 
void copy_statement_attributes (statement from, statement to)
 Copy all the attributes from one statement to another one. More...
 
statement make_statement_from_statement_list_or_empty_block (list l)
 Build a statement sequence from a statement list. More...
 
statement make_statement_from_statement_list (list l)
 Build a statement sequence from a statement list. More...
 
statement make_statement_from_statement_varargs_list (statement s,...)
 Build a statement sequence from a statement NULL-terminated varargs list. More...
 
statement make_block_with_stmt_if_not_already (statement stmt)
 Build a statement block from a statement if not already a statement block. More...
 

Detailed Description

Function Documentation

◆ copy_statement_attributes()

void copy_statement_attributes ( statement  from,
statement  to 
)

Copy all the attributes from one statement to another one.

Do not copy the instruction

Parameters
fromis the statement we pick the attributes from
tois the statement we copy the attributes into
Parameters
fromrom
too

Definition at line 678 of file statement.c.

679  {
680  statement_label(to) = statement_label(from);
684  //statement_instruction(to) = statement_instruction(from);
688 }
extensions copy_extensions(extensions p)
EXTENSIONS.
Definition: ri.c:947
list gen_copy_seq(list l)
Copy a list structure.
Definition: list.c:501
string decls_text_dup(string dt)
Duplicate statement decls_text.
Definition: statement.c:574
string comments_dup(string comment)
functions to generate statements
Definition: statement.c:557
#define statement_ordering(x)
Definition: ri.h:2454
#define statement_label(x)
Definition: ri.h:2450
#define statement_extensions(x)
Definition: ri.h:2464
#define statement_declarations(x)
Definition: ri.h:2460
#define statement_comments(x)
Definition: ri.h:2456
#define statement_decls_text(x)
Definition: ri.h:2462
#define statement_number(x)
Definition: ri.h:2452

References comments_dup(), copy_extensions(), decls_text_dup(), gen_copy_seq(), statement_comments, statement_declarations, statement_decls_text, statement_extensions, statement_label, statement_number, and statement_ordering.

+ Here is the call graph for this function:

◆ instruction_to_statement()

statement instruction_to_statement ( instruction  instr)

Build a statement from a give instruction.

Parameters
instrnstr

Definition at line 597 of file statement.c.

597  {
598  return(
604  instr,
605  NIL,
609  )
610  );
611 }
statement make_statement(entity a1, intptr_t a2, intptr_t a3, string a4, instruction a5, list a6, string a7, extensions a8, synchronization a9)
Definition: ri.c:2222
synchronization make_synchronization_none(void)
Definition: ri.c:2424
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
Definition: newgen-local.h:35
#define string_undefined
Definition: newgen_types.h:40
#define STATEMENT_NUMBER_UNDEFINED
default values
#define empty_comments
Empty comments (i.e.
entity entity_empty_label(void)
Definition: entity.c:1105
extensions empty_extensions(void)
extension.c
Definition: extension.c:43

References empty_comments, empty_extensions(), entity_empty_label(), make_statement(), make_synchronization_none(), NIL, STATEMENT_NUMBER_UNDEFINED, STATEMENT_ORDERING_UNDEFINED, and string_undefined.

Referenced by __attribute__(), abc_instrumentation_insert_before_statement(), begin_omp_construct(), bottom_up_abc_insert_before_statement(), BuildStatementForEntry(), C_MakeReturnStatement(), compile_master(), compute_region(), controlize_sequence(), create_block_if_needed(), do_clone_statement(), do_group_constants_terapix(), do_isolate_statement(), do_loop_expansion_init(), do_loop_nest_unswitching_purge(), do_loop_to_while_loop(), do_loop_unroll_with_epilogue(), do_loop_unroll_with_prologue(), do_split_structure(), do_split_structure_return_hook(), do_split_structure_return_hook_walker(), do_symbolic_tiling(), dowhile_to_while_walker(), effects_to_dma(), ExpressionToStatement(), FindDefinitionsOf_rewrite(), for_to_do_loop_conversion(), forloop_header(), forloop_inc(), free_guards(), freia_insert_added_stats(), fusion(), fusion_buffer(), gather_and_remove_all_format_statements_rewrite(), generate_c1_beta(), Generate_C_ReturnStatement(), generate_compact(), generate_guarded_statement(), generate_loop_workchunk(), generate_prelude(), gfc2pips_code2instruction(), gfc2pips_code2instruction_(), gfc2pips_code2instruction__TOP(), gfc2pips_dumpSELECT(), gfc2pips_namespace(), hcfg(), Hierarchical_tiling(), hierarchize_control_list(), hpfc_make_call_statement(), hpfc_translate_call_with_distributed_args(), inline_expression_call(), inline_return_crawler(), inline_statement_crawler(), insert_rwt(), interprocedural_abc_insert_before_statement(), loop_flt(), loop_nest_to_wp65_code(), loop_strip_mine(), make_assign_statement(), make_block_statement(), make_check_io_statement(), make_dma_transfert(), make_expression_statement(), make_fields_assignment_instruction(), make_get_rc_statement(), make_if_converted_test_statement(), make_loop_nest_for_overlap(), make_new_loop_statement(), make_print_statement(), make_set_rc_statement(), make_shuffle_statement(), MakeArithmIfInst(), MakeAssignedOrComputedGotoInst(), MakeCallInst(), MakeCurrentFunction(), MakeDoInst(), MakeLogicalIfInst(), MakeNewLabelledStatement(), MakeReturn(), MakeSwitchStatement(), MakeWhileDoInst(), parallel_tiling(), pips_code_abc_statement_rwt(), prepend_call(), rename_statement_declarations(), ReuseLabelledStatement(), sesamify(), st_compute_ith_local_index(), st_make_nice_test(), statement_filter(), substitute_and_create(), systeme_to_loop_nest(), take_out_the_entry_node_of_the_unstructured(), take_out_the_exit_node_if_not_a_continue(), Tiling2_buffer(), Tiling_buffer_allocation(), tiling_transformation(), top_down_abc_insert_before_statement(), unsugared_forloop_header(), unsugared_forloop_inc(), unsugared_forloop_test(), unsugared_loop_test(), unsugared_whileloop_test(), and update_statement_instruction().

+ Here is the call graph for this function:

◆ make_block_statement()

statement make_block_statement ( list  body)

Make a block statement from a list of statement.

Parameters
bodyody

Definition at line 616 of file statement.c.

616  {
617  statement b;
618 
620  return b;
621 }
statement instruction_to_statement(instruction instr)
Build a statement from a give instruction.
Definition: statement.c:597
instruction make_instruction_block(list statements)
Build an instruction block from a list of statements.
Definition: instruction.c:106

References instruction_to_statement(), and make_instruction_block().

Referenced by add_exec_mmcd(), add_index_statements(), add_label_to_statement(), add_omp_guard(), add_pvm_init_and_end(), add_toggle_inc_statements(), array_scalar_access_to_bank_communication(), array_scalar_access_to_compute_communication(), atomize_statement(), bound_generation(), broadcast(), build_call_STEP_WaitAll(), BuildStatementForEntry(), CodeGenerate(), com_call(), comEngine_generate_code(), comEngine_generate_procCode(), comEngine_opt_loop_interchange(), compile_loopbounds(), compile_loopslices(), compile_master(), compile_module(), compile_mpi(), controlize_list(), cstr_args_check(), define_node_processor_id(), do_group_constants_terapix(), do_isolate_statement(), do_kernelize(), do_loop_to_while_loop(), do_loop_unroll_with_prologue(), do_split_block_statements(), do_split_decl_block_statements(), do_transform_if_statements(), effects_to_dma(), elements_loop(), ensure_comment_consistency(), free_guards(), fusion(), fusion_buffer(), gen_omp_parallel(), generate_all_liveness_but(), generate_call_init_regionArray(), generate_code(), generate_code_call(), generate_code_loop(), generate_code_seq(), generate_code_test_proc(), generate_deducables(), generate_dynamic_liveness_for_primary(), generate_dynamic_liveness_management(), generate_io_statements_for_shared_arrays(), generate_optimized_code_for_loop_nest(), generate_remapping_code(), generate_remapping_guard(), generate_stat_from_ref_list_HRE(), generate_stat_from_ref_list_proc(), GENERATION(), Hierarchical_tiling(), hpf_compile_parallel_body(), hpf_compiler(), hpfc_broadcast_if_necessary(), hpfc_buffer_initialization(), hpfc_buffer_packing(), hpfc_hcast(), hpfc_hmessage(), hpfc_initsend(), hpfc_lazy_buffer_packing(), hpfc_lazy_message(), hpfc_lazy_packing(), hpfc_message(), hpfc_nrecv(), hpfc_nsend(), HRE_distribute(), inline_statement_crawler(), insert_before_statement(), insert_run_time_communications(), insert_statements_after_declarations(), insert_test_before_caller(), insert_test_before_statement(), io_efficient_compile(), loop_flt(), loop_nest_to_wp65_code(), make_block_with_stmt_if_not_already(), make_bottom_up_abc_tests(), make_c_stop_statement(), make_compute_block(), make_empty_block_statement(), make_empty_statement_with_declarations_and_comments(), make_exit_statement(), make_interprocedural_abc_tests(), make_layout_statement(), make_load_blocks(), make_loadsave_statement(), make_loop_nest_for_overlap(), make_loopStat1(), make_movements_loop_body_wp65(), make_scanning_over_one_tile(), make_scanning_over_tiles(), make_seqStat(), make_sequence_from_statement_list(), make_shared_statement(), make_statement_from_statement_list_or_empty_block(), make_statement_from_statement_varargs_list(), make_store_blocks(), MakeForloopWithIndexDeclaration(), MakeLabeledStatement(), MakeLoopAs(), MakeNestOfStatementList(), MakeNewLabelledStatement(), messages_handling(), module_to_wp65_modules(), mpi_initialize(), outliner(), Overlap_Analysis(), phrase_remove_dependences_rwt(), processor_loop(), promote_statement(), reductions_rewrite(), regenerate_toggles(), remapping_compile(), remapping_stats(), replace_array_ref_with_fifos(), replace_array_ref_with_fifos2(), replace_glCurRep_in_seq(), root_statement_remapping_inits(), sesamify(), st_get_value_locally_and_send(), st_one_message(), step_parser(), systeme_to_loop_nest(), terapix_loop_optimizer(), Tiling2_buffer(), Tiling_buffer_allocation(), top_down_abc_array(), update_runtime_for_remapping(), update_unstructured_declarations(), usual_loop_tiling(), verify_array_element(), verify_array_variable(), and verify_scalar_variable().

+ Here is the call graph for this function:

◆ make_block_with_stmt_if_not_already()

statement make_block_with_stmt_if_not_already ( statement  stmt)

Build a statement block from a statement if not already a statement block.

Returns
the new block statement or the old statement

It is already a block statement

Parameters
stmttmt

Definition at line 768 of file statement.c.

768  {
770  /* It is already a block statement */
771  return stmt;
772  else
774 }
statement make_block_statement(list body)
Make a block statement from a list of statement.
Definition: statement.c:616
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
bool statement_sequence_p(statement s)
Statement classes induced from instruction type.
Definition: statement.c:335
#define STATEMENT(x)
STATEMENT.
Definition: ri.h:2413
Definition: statement.c:54

References CONS, make_block_statement(), NIL, STATEMENT, and statement_sequence_p().

Referenced by atomizer_of_loop(), atomizer_of_test(), loop_normalize_of_loop(), loop_normalize_of_statement(), loop_normalize_of_unstructured(), make_send_receive_conversion(), and make_sequence_from_statement_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_empty_block_statement()

◆ make_empty_statement_with_declarations_and_comments()

statement make_empty_statement_with_declarations_and_comments ( list  d,
string  dt,
string  c 
)

Build an empty statement with declaration list, declaration text and comment.

Shouldn't we also update the extensions field? Can we really make an non empty_comment for block? cf text_statement_enclosed() or clean_up_sequences_rewrite() "block statement should be labelless, numberless and commentless"

Parameters
dtt

Definition at line 638 of file statement.c.

640  {
643  statement_decls_text(s) = dt;
644  statement_comments(s) = c;
645  return s;
646 }

References make_block_statement(), NIL, statement_comments, statement_declarations, and statement_decls_text.

Referenced by controlize_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_statement_from_statement_list()

statement make_statement_from_statement_list ( list  l)

Build a statement sequence from a statement list.

Returns
:
  • statement_undefined if the statement list is NIL
  • the statement of a list with one statement, after discarding the list
  • a statement block with the statement list else.

Definition at line 719 of file statement.c.

719  {
720  if (l == NIL)
721  return statement_undefined;
722  else
724 }
statement make_statement_from_statement_list_or_empty_block(list l)
Build a statement sequence from a statement list.
Definition: statement.c:700
#define statement_undefined
Definition: ri.h:2419

References make_statement_from_statement_list_or_empty_block(), NIL, and statement_undefined.

Referenced by st_make_nice_test().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_statement_from_statement_list_or_empty_block()

statement make_statement_from_statement_list_or_empty_block ( list  l)

Build a statement sequence from a statement list.

Parameters
[in]lis the statement list
Returns
the statement if there is only 1 statement in the list l or build a block from the statement list. So, if the list was NIL, this makes an empty statement block.

Definition at line 700 of file statement.c.

700  {
701  if (gen_length(l) == 1) {
702  statement stat = STATEMENT(CAR(l));
703  gen_free_list(l);
704  return stat;
705  }
706  else
707  return make_block_statement(l);
708 }
size_t gen_length(const list l)
Definition: list.c:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327

References CAR, gen_free_list(), gen_length(), make_block_statement(), and STATEMENT.

Referenced by make_statement_from_statement_list().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_statement_from_statement_varargs_list()

statement make_statement_from_statement_varargs_list ( statement  s,
  ... 
)

Build a statement sequence from a statement NULL-terminated varargs list.

It is called with make_statement_from_statement_varargs_list(s1, s2,..., sn, NULL)

Returns
a statement block with the statement list

The statement list

Analyze in args the variadic arguments that may be after s:

Since a variadic function in C must have at least 1 non variadic argument (here the s), just skew the varargs analysis:

No more statement

Use an O(n2) algorithm that would be enough to concatenate few statements

Get the next argument:

Release the variadic analyzis:

Build a statement block from a normal list:

Definition at line 735 of file statement.c.

735  {
736  va_list args;
737  /* The statement list */
738  list sl = NIL;
739 
740  /* Analyze in args the variadic arguments that may be after s: */
741  va_start(args, s);
742  /* Since a variadic function in C must have at least 1 non variadic
743  argument (here the s), just skew the varargs analysis: */
744  for(;;) {
745  if (s == NULL)
746  /* No more statement */
747  break;
748  /* Use an O(n2) algorithm that would be enough to concatenate few
749  statements */
750  sl = gen_nconc(sl, CONS(STATEMENT, s, NIL));
751  /* Get the next argument: */
752  s = va_arg(args, statement);
753  }
754  /* Release the variadic analyzis: */
755  va_end(args);
756 
757  /* Build a statement block from a normal list: */
758  return make_block_statement(sl);
759 }
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References CONS, gen_nconc(), make_block_statement(), NIL, and STATEMENT.

Referenced by for_to_while_loop_conversion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move_statement_attributes()

void move_statement_attributes ( statement  from,
statement  to 
)

Move all the attributes from one statement to another one.

Do not copy the instruction

Parameters
fromis the statement we pick the attributes from
tois the statement we copy the attributes into
Parameters
fromrom
too

Definition at line 657 of file statement.c.

658  {
659  statement_label(to) = statement_label(from);
663  //statement_instruction(to) = statement_instruction(from);
667 }

References statement_comments, statement_declarations, statement_decls_text, statement_extensions, statement_label, statement_number, and statement_ordering.

Referenced by begin_omp_construct(), and statement_filter().

+ Here is the caller graph for this function: