PIPS
freia_aipo.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include "genC.h"
#include "misc.h"
#include "linear.h"
#include "ri.h"
#include "freia.h"
#include "hwac.h"
+ Include dependency graph for freia_aipo.c:

Go to the source code of this file.

Functions

list freia_aipo_compile_calls (string module, dag fulld, list ls, const hash_table occs, hash_table exchanges, int number)
 freia_aipo.c More...
 

Function Documentation

◆ freia_aipo_compile_calls()

list freia_aipo_compile_calls ( string  module,
dag  fulld,
list  ls,
const hash_table  occs,
hash_table  exchanges,
int  number 
)

freia_aipo.c

Parameters
moduleodule
fulldulld
lsof statements
occsccs
exchangesxchanges
numberumber

Definition at line 48 of file freia_aipo.c.

55 {
56  pips_debug(3, "considering %d statements\n", (int) gen_length(ls));
57  pips_assert("some statements", ls);
58 
59  // about aipo statistics: no helper file to put them...
60 
61  // handle intermediate images
63  list new_images = dag_fix_image_reuse(fulld, init, occs);
64 
65  // optimize dag
66  list added_before = NIL, added_after = NIL;
67  freia_dag_optimize(fulld, exchanges, &added_before, &added_after);
68 
69  // dump final optimised dag
70  dag_dot_dump_prefix(module, "dag_cleaned_", number, fulld,
71  added_before, added_after);
72 
73  // now may put actual allocations, which messes up statement numbers
74  list reals =
75  freia_allocate_new_images_if_needed(ls, new_images, occs, init, NULL);
76 
77  // ??? should it be NIL because it is not useful in AIPO->AIPO?
78  freia_insert_added_stats(ls, added_before, true);
79  added_before = NIL;
80  freia_insert_added_stats(ls, added_after, false);
81  added_after = NIL;
82 
83  // cleanup
84  gen_free_list(new_images);
86 
87  return reals;
88 }
list dag_fix_image_reuse(dag d, hash_table init, const hash_table occs)
fix intermediate image reuse in dag
Definition: dag-utils.c:2779
void freia_dag_optimize(dag d, hash_table exchanges, list *lbefore, list *lafter)
remove dead image operations.
Definition: dag-utils.c:1416
void dag_dot_dump_prefix(const string module, const string prefix, int number, const dag d, const list lb, const list la)
Definition: dag-utils.c:504
list freia_allocate_new_images_if_needed(list ls, list images, const hash_table occs, const hash_table init, const hash_table signatures)
insert image allocation if needed, for intermediate image inserted before if an image is used only tw...
Definition: freia-utils.c:1650
void freia_insert_added_stats(list ls, list stats, bool before)
insert statements to actual code sequence in "ls" BEWARE that ls is assumed to be in reverse order....
Definition: freia-utils.c:1185
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
Definition: hash.c:327
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
@ hash_pointer
Definition: newgen_hash.h:32
static char * module
Definition: pips.c:74
static int init
Maximal value set for Fortran 77.
Definition: entity.c:320
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References dag_dot_dump_prefix(), dag_fix_image_reuse(), freia_allocate_new_images_if_needed(), freia_dag_optimize(), freia_insert_added_stats(), gen_free_list(), gen_length(), hash_pointer, hash_table_free(), hash_table_make(), init, module, NIL, pips_assert, and pips_debug.

Referenced by freia_compile().

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