PIPS
|
#include <stdlib.h>
#include <stdio.h>
#include "linear_assert.h"
#include "boolean.h"
#include "arithmetique.h"
#include "vecteur.h"
#include "contrainte.h"
#include "sc.h"
Go to the source code of this file.
Functions | |
Psysteme | new_loop_bound (Psysteme scn, Pbase base_index) |
Psysteme new_loop_bound(Psysteme scn, Pbase base_index) computation of the new iteration space (given the loop bounds) in the new basis G. More... | |
Psysteme | get_other_constraints (Psysteme *psyst, Pbase vars) |
Psysteme get_other_constraints(psyst, vars) Psysteme *psyst; Pbase vars;. More... | |
void | algorithm_row_echelon_generic (Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration, bool redundancy) |
each variable should be at least within one <= and one >=; scn IS NOT modified. More... | |
void | algorithm_row_echelon (Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration) |
see comments above. More... | |
void | sc_set_row_echelon_redundancy (bool b __attribute__((unused))) |
void | algorithm_tiling (Psysteme syst, Pbase outer, Pbase inner, Psysteme *pcondition, Psysteme *ptile_enum, Psysteme *piter_enum) |
void algorithm_row_echelon | ( | Psysteme | scn, |
Pbase | base_index, | ||
Psysteme * | pcondition, | ||
Psysteme * | penumeration | ||
) |
see comments above.
Definition at line 248 of file sc_new_loop_bound.c.
References algorithm_row_echelon_generic().
Referenced by build_third_comb(), copy_write_statement_with_cumulated_regions(), prepare_reindexing(), and verify_array_variable().
void algorithm_row_echelon_generic | ( | Psysteme | scn, |
Pbase | base_index, | ||
Psysteme * | pcondition, | ||
Psysteme * | penumeration, | ||
bool | redundancy | ||
) |
each variable should be at least within one <= and one >=; scn IS NOT modified.
ALGORITHM ROW ECHELON from Ancourt and Irigoin, PPoPP'91
The algorithm is slightly different:
conditions are taken out of the system built.
void algorithm_row_echelon(syst, scans, pcondition, penumeration) Psysteme syst; Pbase scans; Psysteme *pcondition, *penumeration;
IN: syst, scans
OUT: pcondition, penumeration
(c) FC 16/05/94
returns a a la Omega system, with no innerward redundancy. in fact this is just a quick approximation of that property. the way the system is computed may keep some outerward redundancies, because a constraint may be redundant with some not yet computed projection...
ELSE remove redundancy in the system...
include the original system again, to recover simple constraints that may have been removed. May not be interesting...
what is returned must be ok.
base_index | initial system, which is not touched. |
pcondition | enumeration variables, from outer to inner. |
penumeration | returned condition (what remains from scn). |
redundancy | returned enumeration system. whether to allow outwards redundancy. |
Definition at line 134 of file sc_new_loop_bound.c.
References assert, Ssysteme::base, base_difference(), base_reversal(), base_rm, contrainte_append(), contrainte_dup_extract(), Ssysteme::dimension, free(), get_other_constraints(), malloc(), sc_append(), sc_dup(), sc_empty(), sc_empty_p(), sc_make(), sc_rm(), sc_rn(), sc_sort_constraints(), sc_transform_eg_in_ineg(), sc_transform_ineg_in_eg(), sc_triang_elim_redund(), Svecteur::succ, Svecteur::var, vect_erase_var(), vect_in_basis_p(), vect_size(), and VECTEUR_NUL_P.
Referenced by algorithm_row_echelon(), algorithm_tiling(), hpfc_algorithm_row_echelon(), new_loop_bound(), and Psysteme_to_loop_nest().
void algorithm_tiling | ( | Psysteme | syst, |
Pbase | outer, | ||
Pbase | inner, | ||
Psysteme * | pcondition, | ||
Psysteme * | ptile_enum, | ||
Psysteme * | piter_enum | ||
) |
ALGORITHM TILING from Ancourt and Irigoin, PPoPP'91
The algorithm is slightly different:
constraints may appear thru the projections that do not contain the desired loop variables. These constraints are taken out of the systems. The inner ones are reinjected to help for the outer loop, and those of the outer loop are stored as conditions to be checked before the loop nest. The intuition is that if these constraints are violated, the polyhedron is empty, and the loop nest must be avoided.
Corinne ANCOURT, Fabien COELHO, Apr 1 94.
void algorithm_tiling(syst, outer, inner, pcondition, ptile_enum, piter_enum) Psysteme syst; Pbase outer, inner; Psysteme *pcondition, *ptile_enum, *piter_enum;
IN: syst, outer, inner OUT: pcondition, ptile_enum, piter_enum
tiles iterations enumeration row echelon
project variables
tiles enumeration row echelon
clean bases
Definition at line 292 of file sc_new_loop_bound.c.
References algorithm_row_echelon_generic(), BASE_NULLE, base_rm, sc_creer_base(), sc_empty(), sc_empty_p(), sc_rm(), sc_rn(), sc_safe_intersection(), Svecteur::succ, and var_of.
Referenced by hpfc_algorithm_tiling().
Psysteme get_other_constraints(psyst, vars) Psysteme *psyst; Pbase vars;.
IN: vars IN/OUT: psyst OUT: returned system
returns the constraints that do not contain any of the variables listed in Pbase vars, which are removed from the original Psysteme *psyst. if the original system is undefined, the same thing is returned.
(c) FC 16/05/94
else
result in built and syst is modified.
Definition at line 84 of file sc_new_loop_bound.c.
References assert, base_difference(), Pcontrainte_separate_on_vars(), sc_empty(), sc_empty_p(), sc_make(), and sc_rm().
Referenced by algorithm_row_echelon_generic().
Psysteme new_loop_bound(Psysteme scn, Pbase base_index) computation of the new iteration space (given the loop bounds) in the new basis G.
scn is destroyed
if the list of indexes is empty, the system is assumed to be a list of constraints that have to be verified for the set of solutions not to be empty, so scn is returned.
Reference about the algorithm PPoPP'91
Definition at line 51 of file sc_new_loop_bound.c.
References algorithm_row_echelon_generic(), sc_fusion(), and sc_rm().
Referenced by hyperplane(), make_scanning_over_one_tile(), make_scanning_over_tiles(), terapix_loop_handler(), tiling_transformation(), and unimodular().
void sc_set_row_echelon_redundancy | ( | bool b | __attribute__(unused) | ) |
Definition at line 258 of file sc_new_loop_bound.c.