PIPS
one_thread_kernel.c File Reference
#include <stdio.h>
#include <ctype.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "resources.h"
#include "misc.h"
#include "ri-util.h"
#include "effects-util.h"
#include "control.h"
#include "pipsdbm.h"
#include "text-util.h"
#include "properties.h"
+ Include dependency graph for one_thread_kernel.c:

Go to the source code of this file.

Functions

static statement enclose_in_a_parallel_loop (statement module_statement)
 
bool one_thread_parallelize (string mod_name)
 one_thread_kernel.c More...
 

Function Documentation

◆ enclose_in_a_parallel_loop()

static statement enclose_in_a_parallel_loop ( statement  module_statement)
static

Loop range is created

Definition at line 47 of file one_thread_kernel.c.

47  {
49  pips_user_error("Module statement is not a block\n");
50  }
53  (void *) 4));
54  /* Loop range is created */
58  entity label_entity = entity_empty_label();
60  make_loop(loop_idx,
61  rg,
63  label_entity,
65  NIL));
66 
71  loop_inst,
72  NIL,
73  NULL,
75 }
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
Definition: ri.c:1301
basic make_basic(enum basic_utype tag, void *val)
Definition: ri.c:155
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
instruction make_instruction(enum instruction_utype tag, void *val)
Definition: ri.c:1166
synchronization make_synchronization_none(void)
Definition: ri.c:2424
execution make_execution_parallel(void)
Definition: ri.c:844
range make_range(expression a1, expression a2, expression a3)
Definition: ri.c:2041
static statement module_statement
Definition: alias_check.c:125
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define pips_user_error
Definition: misc-local.h:147
#define STATEMENT_ORDERING_UNDEFINED
mapping.h inclusion
Definition: newgen-local.h:35
#define statement_block_p(stat)
#define STATEMENT_NUMBER_UNDEFINED
default values
#define empty_comments
Empty comments (i.e.
entity entity_empty_label(void)
Definition: entity.c:1105
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
extensions empty_extensions(void)
extension.c
Definition: extension.c:43
entity make_new_scalar_variable(entity, basic)
Definition: variable.c:741
@ is_basic_int
Definition: ri.h:571
@ is_instruction_loop
Definition: ri.h:1471

References empty_comments, empty_extensions(), entity_empty_label(), get_current_module_entity(), int_to_expression(), is_basic_int, is_instruction_loop, make_basic(), make_execution_parallel(), make_instruction(), make_loop(), make_new_scalar_variable(), make_range(), make_statement(), make_synchronization_none(), module_statement, NIL, pips_user_error, statement_block_p, STATEMENT_NUMBER_UNDEFINED, and STATEMENT_ORDERING_UNDEFINED.

Referenced by one_thread_parallelize().

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

◆ one_thread_parallelize()

bool one_thread_parallelize ( string  mod_name)

one_thread_kernel.c

Set the current module entity required to have many things working in PIPS:

Parameters
mod_nameod_name

Definition at line 77 of file one_thread_kernel.c.

77  {
79  mod_name,
80  true);
81 
83 
84  /* Set the current module entity required to have many things
85  working in PIPS: */
87 
88  debug_on("ONE_THREAD_PARALLELIZE_DEBUG_LEVEL");
89  pips_assert("Statement should be OK at entry...",
91 
94 
95  DB_PUT_MEMORY_RESOURCE(DBR_CODE, mod_name, (char*) module_statement);
96 
97  debug_off();
98 
101 
102  return true;
103 }
bool statement_consistent_p(statement p)
Definition: ri.c:2195
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
#define debug_on(env)
Definition: misc-local.h:157
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define debug_off()
Definition: misc-local.h:160
static statement enclose_in_a_parallel_loop(statement module_statement)
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
Definition: reorder.c:244
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
Definition: entity.c:1479

References db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, enclose_in_a_parallel_loop(), module_name_to_entity(), module_reorder(), module_statement, pips_assert, reset_current_module_entity(), reset_current_module_statement(), set_current_module_entity(), set_current_module_statement(), and statement_consistent_p().

+ Here is the call graph for this function: