25 #include "pips_config.h"
65 int chunk_size,
int chunk_number)
78 debug(9,
"loop_strip_mine",
"begin: chunk_size = %d,chunk_number = %d\n",
79 chunk_size, chunk_number);
80 pips_assert(
"loop_strip_mine", ( chunk_size > 1 && chunk_number == -1 )
82 (chunk_size == -1 && chunk_number > 1) );
86 "Loop increment has to be one for strip-mining!\n");
156 return(loop_statement);
172 int chunk_number = -1;
178 if( kind!=0 && kind!=1 ) {
179 resp =
user_request(
"Type of strip-mining:\n - in fixed-size chunks "
180 "(enter 0)\n - in a fixed number of chunks (enter 1)");
185 if(sscanf(resp,
"%d", &kind)!=1 || (kind!= 0 && kind !=1)) {
196 "(choose integer greater or egal to 2): ",
197 kind ?
"number" :
"size");
202 if(sscanf(resp,
"%d", &factor)!=1 || factor <= 1) {
204 "stripe size or number should be greater than 2\n");
215 chunk_number = factor;
218 pips_debug(1,
"strip mine in %d chunks of size %d \n",
219 chunk_number, chunk_size);
224 user_log(
"Strip mining has been cancelled.\n");
237 const char *lp_label=NULL;
244 if (lp_label[0] ==
'\0') {
245 user_log(
"Strip mining has been cancelled.\n");
246 return_status =
false;
251 user_error(
"strip_mine",
"loop label `%s' does not exist\n", lp_label);
272 return_status =
true;
275 debug(2,
"strip_mine",
"done for %s\n", mod_name);
278 return return_status;
float a2sf[2] __attribute__((aligned(16)))
USER generates a user error (i.e., non fatal) by printing the given MSG according to the FMT.
int get_int_property(const string)
void user_log(const char *format,...)
execution make_execution(enum execution_utype tag, void *val)
loop make_loop(entity a1, range a2, statement a3, entity a4, execution a5, list a6)
expression copy_expression(expression p)
EXPRESSION.
bool statement_consistent_p(statement p)
instruction make_instruction(enum instruction_utype tag, void *val)
range make_range(expression a1, expression a2, expression a3)
struct _newgen_struct_statement_ * statement
void look_for_nested_loop_statements(statement, statement(*)(list, bool(*)(statement)), bool(*)(statement))
look_for_nested_loops.c
bool empty_string_p(const char *s)
statement instruction_to_statement(instruction)
Build a statement from a give instruction.
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
statement set_current_module_statement(statement)
Set the current module statement.
entity set_current_module_entity(entity)
static.c
entity get_current_module_entity(void)
Get the entity of the current module.
int loop_increment_value(loop l)
#define NIL
The empty list (nil in Lisp)
#define CAR(pcons)
Get the value of the first element of a list.
list gen_last(list l)
Return the last element of a list.
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
#define user_error(fn,...)
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
string user_request(const char *,...)
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
void print_statement(statement)
Print a statement on stderr.
const char * get_string_property_or_ask(const char *, const char[])
bool module_reorder(statement body)
Reorder a module and recompute order to statement if any.
#define MINUS_OPERATOR_NAME
#define PLUS_OPERATOR_NAME
#define DIVIDE_OPERATOR_NAME
#define MIN_OPERATOR_NAME
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
entity entity_empty_label(void)
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
expression MakeBinaryCall(entity f, expression eg, expression ed)
Creates a call expression to a function with 2 arguments.
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
expression make_op_exp(char *op_name, expression exp1, expression exp2)
================================================================
void AddEntityToDeclarations(entity, entity)
END_EOLE.
entity find_label_entity(const char *, const char *)
util.c
entity make_new_index_entity(entity, string)
#define loop_execution(x)
#define instruction_loop(x)
#define range_increment(x)
#define entity_undefined_p(x)
#define expression_undefined
#define execution_sequential_p(x)
#define statement_instruction(x)
@ is_execution_sequential
#define statement_undefined
#define STATEMENT(x)
STATEMENT.
entity selected_label
Interface with pipsmake for interactive loop transformations: loop interchange, hyperplane method,...
static statement loop_chunk_size_and_strip_mine(list lls, __attribute__((unused)) bool(*unused)(statement))
Hmmm...
char * current_module_name
statement loop_strip_mine(statement loop_statement, int chunk_size, int chunk_number)
loop_strip_mine():
bool strip_mine(const string mod_name)
Top-level function.
The structure used to build lists in NewGen.