27 #include "pips_config.h"
72 #define SEMICOLON ";" NL
75 #define OPENBRACKET "["
76 #define CLOSEBRACKET "]"
79 #define CLOSEPAREN ")"
82 #define CLOSEBRACE "}"
85 #define CLOSEANGLE ">"
88 #define SHARPDEF "#define"
89 #define COMMENT "//" SPACE
93 #define XML_TASK_PREFIX "T_"
94 #define XML_MOTIF_PREFIX "M_"
95 #define XML_ARRAY_PREFIX "A_"
97 #define XML_RL NL,TAB,TAB
99 #define code_is_a_box 0
100 #define code_is_a_te 1
101 #define code_is_a_main 2
102 #define USER_MAIN "main"
133 #define MEM_PREFIX "-MEM:"
184 #define current_module_is_a_function() \
185 (entity_function_p(get_current_module_entity()))
195 #define RESULT_NAME "result"
296 #define ITEM_NOT_IN_ARRAY -1
315 string origins =
"origins = list<integer>(";
316 string dimensions =
"dimSizes = list<integer>(";
317 string deuxpoints =
" :: ";
318 string data_array =
"DATA_ARRAY(";
319 string data_decl =
"name = symbol!(";
320 string dimstring =
"dim = ";
321 string datatype =
"dataType = INTEGER)";
322 string name4p = name;
323 string * namep =
malloc(
sizeof(
string));
324 int * nbdimptr =
malloc(
sizeof(
int));
328 result =
strdup(
concatenate(name, deuxpoints, data_array, data_decl,
QUOTE, name,
QUOTE,
CLOSEPAREN,
COMMA,
NL, NULL));
366 string result =
strdup(
"");
408 bool (*consider_this_entity)(
entity),
412 string result =
strdup(
"");
422 if (consider_this_entity(var))
424 string old =
strdup(result);
427 svar, lastsep? separator:
"", NULL));
459 *input_provided =
true;
494 paving_array[iterator_nr] =
strdup(
"1");
497 fitting_array[iterator_nr] =
strdup(
"1");
503 paving_array[iterator_nr] =
strdup(
"1");
506 fitting_array[iterator_nr] =
strdup(
"1");
515 paving_array[iterator_nr] =
strdup(
"1");
518 fitting_array[iterator_nr] =
strdup(
"1");
527 pips_user_error(
"APOTRES doesn't allow negative coefficients in paving and fitting matrices\n");
532 pips_user_error(
"Only scalar * reference are allowed here. Please develop expressions.\n");
539 paving_array[extern_nr] = mult;
542 fitting_array[intern_nr] =
strdup(mult);
552 *offset_array = funname;
559 #define XML_ARRAY_PREFIX "A_"
580 string offset_array[index_of_array];
584 string paving_array[index_of_array][extern_nb];
589 string fitting_array[index_of_array][intern_nb];
594 bool null_fitting_p =
true;
595 string internal_index_declarations =
strdup(
"");
596 string fitting_declaration =
strdup(
"");
597 string fitting_declaration2 =
strdup(
"");
600 for (i=0; i<index_of_array; i++)
601 offset_array[i] =
"0";
603 for (i=0; i<index_of_array ; i++)
604 for (j=0; j<extern_nb; j++)
605 paving_array[i][j] =
"0";
607 for (i=0; i<index_of_array ; i++)
608 for (j=0; j<intern_nb; j++)
609 fitting_array[i][j] =
"0";
613 "\" /+ \"", varname,
"\"),",
NL,
TAB,
TAB, NULL));
615 result =
strdup(
concatenate(result,
"darray = ", varname,
"," NL,
TAB,
TAB,
"accessMode = ", (first?
"Wmode,":
"Rmode,"),
616 NL,
TAB,
TAB,
"offset = list<VARTYPE>(", NULL));
626 paving_array[indice_nr][iterator_nr] =
strdup(
"1");
629 fitting_array[indice_nr][iterator_nr] =
strdup(
"1");
636 xml_call_from_indice(c, &(offset_array[indice_nr]), paving_array[indice_nr], fitting_array[indice_nr]);
649 for(i=0; i<index_of_array - 1; i++){
658 for(i=0;i<intern_nb; i++){
659 bool is_null_p =
true;
660 for(j = 0; j<index_of_array; j++){
661 is_null_p = is_null_p && (
same_string_p(fitting_array[j][i],
"0"));
664 null_fitting_p =
false;
666 for(j = 0; j<index_of_array-1; j++){
667 fitting_declaration =
strdup(
concatenate(fitting_declaration,
"vartype!(", fitting_array[j][i],
"), ", NULL));
678 fitting_declaration2 =
680 strlen(fitting_declaration) - 2),
689 null_fitting_p =
true;
693 for(i=0;i<extern_nb-1; i++){
695 for(j = 0; j<index_of_array-1; j++){
696 result =
strdup(
concatenate(result,
"vartype!(", paving_array[j][i],
"), ", NULL));
701 for(j = 0; j<index_of_array-1; j++){
702 result =
strdup(
concatenate(result,
"vartype!(", paving_array[j][i],
"), ", NULL));
706 #define MONMAX(a, b) ((a<b)?b:a)
712 for (j = 0; j<intern_nb; j++){
713 bool is_null_p =
true;
714 for(i = 0; i < index_of_array; i++){
715 is_null_p = is_null_p && (
same_string_p(fitting_array[i][j],
"0"));
731 for (j = 0; j<intern_nb; j++){
732 bool is_null_p =
true;
733 for(i = 0; i < index_of_array; i++){
734 is_null_p = is_null_p && (
same_string_p(fitting_array[i][j],
"0"));
737 null_fitting_p =
false;
743 internal_index_declarations =
756 internal_index_declarations =
758 strlen(internal_index_declarations) -2),
768 result =
strdup(
concatenate(result,
NL,
TAB,
"names = list<string>(", internal_index_declarations, NULL));
781 string first_result =
"";
783 bool input_provided =
false, output_provided =
false;
794 pips_user_error(
"Call not allowed in left-hand side argument of assignation.\n");
808 output_provided =
true;
813 input_provided =
true;
825 result =
strdup(
concatenate(
"data = list<DATA>(dummyDATA, ", result, first_result, NULL));
830 if(!output_provided){
888 string * up =
malloc(
sizeof(
string));
889 string * xml_name =
malloc(
sizeof(
string));
907 if( (*xml_name)[0] ==
'M'){
948 string * taskname = (
string *)(
malloc(
sizeof(
string)));
957 string * name =
malloc(
sizeof(
string));
958 string * up =
malloc(
sizeof(
string));
968 " :: TASK(unitSpentTime = vartype!(1),"
969 NL,
TAB,
"exLoopNest = LOOPNEST(deep = ", NULL));
983 if((*name)[0] ==
'M'){
1014 pips_user_error(
"Only loops and one significant call allowed in a loop.");
1078 int task_number = 0;
1081 string oldresult =
strdup(result);
1104 string result =
"tasks\n";
1121 result =
strdup(
concatenate(result,
NL,
NL,
"PRES:APPLICATION := APPLICATION(name = symbol!(",
QUOTE,
global_module_name,
QUOTE,
"), ",
NL,
TAB,NULL));
1137 string decls=
"", tasks=
"", result=
"";
1141 printf(
"Module statement: \n");
1143 printf(
"and declarations: \n");
1165 string ppt, xml, dir, filename;
1185 debug_on(
"XMLPRETTYPRINTER_DEBUG_LEVEL");
1234 for(ld = ldecl; !
ENDP(ld); ld =
CDR(ld)){
1247 " dataType = ",
QUOTE,
1396 for (j = 0; j<numberOfTasks; j++)
1434 concatenate(
TAB,
SPACE,
SPACE,
SPACE,
SPACE,
OPENANGLE,
"bound idx =",
QUOTE,
entity_user_name(
loop_index(l)),
QUOTE,NULL));
1466 Pcontrainte c, next, cl, cu, cl_dup, cu_dup,lind, lind_dup,
1489 if (!SC_EMPTY_P(ps)) {
1502 sc_projection_along_variables_ofl_ctrl(&ps,vars_to_eliminate ,
NO_OFL_CTRL);
1504 for(c = sc_inegalites(ps), next=(c==NULL ? NULL : c->
succ);
1506 c=next, next=(c==NULL ? NULL : c->
succ))
1520 nb_indices=
vect_size(indices_in_vecteur);
1521 nb_indices = (nb_indices >2) ? 2 : nb_indices;
1524 c->
succ = bounds[upper][nb_indices+1];
1525 bounds[upper][nb_indices+1] = c;
1531 c->
succ = bounds[lower][nb_indices+1];
1532 bounds[lower][nb_indices+1] = c;
1536 lind->
succ = bounds[ind][nb_indices+1];
1537 bounds[ind][nb_indices+1] = lind;
1547 for(cl = bounds[lower][2], lind= bounds[ind][2]; cl !=NULL; cl=cl->
succ,lind=lind->
succ) {
1548 for(cu = bounds[upper][2]; cu !=NULL; cu =cu->
succ) {
1554 cl_dup->
succ = list_cl, list_cl=cl_dup;
1556 cu_dup->
succ = list_cu, list_cu=cu_dup;
1558 lind_dup->
succ = list_ind, list_ind = lind_dup;
1563 *bound_inf= list_cl;
1564 *bound_sup = list_cu;
1565 *iterator = list_ind;
1572 *bound_inf= bounds[lower][1];
1573 *bound_sup = bounds[upper][1];
1574 *iterator = bounds[ind][1];
1585 *motif_up_bound = 1;
1605 string string_bound =
"";
1606 string string_offset =
"";
1607 string string_paving =
"";
1608 string string_fitting =
"";
1613 int motif_up_bound =0;
1617 int pav_matrix[10][10], fit_matrix[10][10];
1621 pav_matrix[i][j]=0, fit_matrix[i][j]=0;
1628 for(i=1; i<=dim ; i++) {
1632 find_motif(ps, pi, i, dim, &bound_inf, &bound_up, &iterator,
1644 fit_matrix[i][i]= (motif_up_bound >1) ? 1:0;
1656 for (j=1; j<=dim_indices ; j++){
1659 for(i=1; i<=dim ; i++)
1667 for(i=1; i<=dim ; i++) {
1670 for(j=1; j<=dim ; j++)
1672 int2a( fit_matrix[i][j]),
1683 free(string_offset);
1692 free(string_fitting);
1693 string_fitting=NULL;
1700 free(string_paving);
1728 bool atleast_one_read_ref =
false;
1729 bool atleast_one_written_ref =
false;
1731 for ( lr = l_regions; !
ENDP(lr); lr =
CDR(lr))
1736 atleast_one_read_ref =
true;
1742 if (!atleast_one_read_ref)
1745 for ( lr = l_regions; !
ENDP(lr); lr =
CDR(lr))
1750 atleast_one_written_ref =
true;
1756 if (!atleast_one_written_ref)
1797 string_buffer_append(result,
concatenate(
NL,
TAB,
OPENANGLE,
"task name =",
QUOTE,
XML_TASK_PREFIX,
int2a(taskNumber),
QUOTE,
CLOSEANGLE,
NL, NULL));
1802 xml_data (taskNumber, s,sindices, result);
1829 xml_task(taskNumber, &nest,result);
1833 "application name = ",
1915 debug_on(
"XMLPRETTYPRINTER_DEBUG_LEVEL");
1916 pips_debug(1,
"Spec validation before xml prettyprinter for %s\n",
2083 if (strstr(s,
"PARAM")!=NULL || strstr(s,
"param")!=NULL) b =
true;
2115 for(patt1 = *patt; patt1 !=NULL; patt1=patt1->
next) {
2120 for (pv = patt1->
diff;pv!=NULL;pv=pv->
succ) {
2124 else pattcx = patt1;
2129 else pattcp = patt1;
2131 if (pattn!=NULL ) *patt=pattn;
2132 else if (pattc1!= NULL) *patt=pattc1;
2133 else if (pattcx!=NULL ) *patt=pattcx;
2172 if (!SC_EMPTY_P(ps)) {
2191 sc_projection_along_variables_ofl_ctrl(&ps_dup,vars_to_eliminate ,
NO_OFL_CTRL);
2196 for(c = sc_inegalites(ps_dup),
next=(c==NULL ? NULL : c->
succ);
2211 nb_indices=
vect_size(indices_in_vecteur);
2212 nb_indices = (nb_indices >2) ? 2 : nb_indices;
2216 bounds[
upper][nb_indices+1] = c;
2224 bounds[
lower][nb_indices+1] = c;
2228 lind->
succ = bounds[ind][nb_indices+1];
2229 bounds[ind][nb_indices+1] =
lind;
2238 for (
int nb_ind=2; nb_ind>=1; nb_ind--){
2242 for(cu = bounds[
upper][nb_ind]; cu !=NULL; cu =cu->
succ) {
2280 patt1->
next = *patt, *patt=patt1;
2320 string string_paving =
"";
2321 string string_pattern =
"";
2339 if (!SC_UNDEFINED_P(ps_reg))
2344 "Pattern AccessMode=",
2349 "Pavage AccessMode=",
2353 for(i=1; i<=dim; i++) {
2363 find_pattern(ps_reg, paving_indices, formal_parameters, i, &patt);
2365 vpattern=patt->
diff;
2366 iterator= patt->
lind;
2369 voffset = patt->
lower;
2473 "RefLoopIndex Name=",
2490 free(string_pattern);
2491 string_pattern=NULL;
2493 free(string_paving);
2529 for (pc= effects_list;pc !=
NIL; pc =
CDR(pc)){
2566 if (!SC_UNDEFINED_P(ps_reg)) {
2568 for (i=1;i<=dim;i++) {
2571 string string_sbi, string_sbu;
2579 for(pc = sc_inegalites(ps_reg); pc!=NULL;pc= pc->
succ)
2660 if (!SC_UNDEFINED_P(ps_reg)) {
2661 for(pc = sc_egalites(ps_reg); pc!=NULL;pc= pc->
succ) {
2679 if (new_s != NULL) {
2682 new_s[i-
start] = s[i];
2684 new_s[i-
start] =
'\0';
2693 string initial_ts =ts;
2705 string end_ts=strrchr(ts,
'_');
2706 if (strlen(ts_tmp)-strlen(end_ts)-1>0)
2707 initial_ts =
str_sub (ts,1,strlen(ts_tmp)-strlen(end_ts)-1);
2730 if (!suffix_only_p) {
2786 printf(
" additional basic type, PB \n");
2810 else printf(
"pb avec le STRUCT\n");
2830 else printf(
"pb avec le UNION\n");
2850 else printf(
"pb avec le ENUM\n");
2855 printf(
"Not implemented\n");
2995 if (max_step <=30) {
3003 "Reference Name= ",
QUOTE,NULL));
3017 bool effet_read =
true;
3025 for ( lr = pattern_region; !
ENDP(lr); lr =
CDR(lr))
3044 "ReferencedParameter",
" Name=",
3056 "AccessMode=",
QUOTE, (effet_read)?
"USE":
"DEF",
QUOTE,
BL,
3081 for ( lr = leff; !
ENDP(lr); lr =
CDR(lr)) {
3087 er =
true, *effr =eff;
3088 else ew =
true, *effw=eff;
3091 effet_rwb = (er?1:0) +(ew?2:0);
3115 for (ith=1;ith<=FormalParameterNumber;ith++) {
3121 for (ld = ldim, dim =1 ; !
ENDP(ld); ld =
CDR(ld), dim++) {
3133 "TaskParameterUsedFor",
" ArrayName=",
QUOTE, NULL));
3171 c1->
succ=ldef, ll=c1;
3188 const char* datatype =
"";
3219 bool effet_read =
true;
3222 const char* datatype =
"";
3223 int size=0, rw_ef=0, prems=0;
3228 bool pavp=
true, RW_effet=
false;
3233 if (assign_function){
3239 rw_ef=(!effet_read)?2:1;
3242 if (!is_not_main_p) {
3254 reg=rwr, effet_read=
false;
3255 else reg= rre, effet_read=
true;
3262 v = var, effet_read =
true;
3279 RW_effet=((!is_not_main_p || assign_function) && !effet_read) || (is_not_main_p && (rw_ef==2 || prems==2));
3287 "AssignParameter",
" Name=",
3305 paving_indices, buffer_assign);
3308 paving_indices, buffer_assign);
3319 " Name=",
QUOTE, NULL));
3337 paving_indices, sb_result);
3340 paving_indices, sb_result);
3344 if (assign_function && rw_ef>=2 && statnb>0) {
3349 cst1->
func = assign_ent;
3394 string string_temp =
"";
3405 if (assign_function){
3423 for (lr = pattern_region; !
ENDP(lr); lr =
CDR(lr)) {
3431 formal_parameters,lr,paving_indices,sb_result, buffer_assign);
3436 for (ith=1;ith<=FormalParameterNumber;ith++) {
3443 for (ith=1;ith<=FormalParameterNumber;ith++) {
3447 formal_parameters,pattern_region,paving_indices,sb_result, buffer_assign);
3451 for (lr = pattern_region; !
ENDP(lr); lr =
CDR(lr)) {
3454 formal_parameters,lr,paving_indices,sb_result, buffer_assign);
3484 *
min=INT_MIN,*
max =INT_MAX;
3496 else result =
false;
3500 *
min=INT_MIN,*
max =INT_MAX;
3503 else if (*
max==*
min && result) {
3598 if (valr ==
min && valr ==
max)
3601 if (
min != INT_MIN) {
3609 if (
max != INT_MAX) {
3629 if (valr ==
min && valr ==
max)
3632 if (
min != INT_MIN) {
3640 if (
max != INT_MAX) {
3658 xml_Bounds(elow, eup,t,prec,formal_p, sb_result);
3666 if (valr==
min && valr==
max)
3677 string result = NULL;
3697 result=(
char *)
malloc(n+1);
3708 const char* datatype =
"";
3712 char* layout_up[nb_dim];
3713 char *layout_low[nb_dim];
3725 "Allocation=",
QUOTE,
3739 if (spec_location!=NULL) {
3752 for (ld = ldim ; !
ENDP(ld); ld =
CDR(ld)) {
3759 xml_Bounds(elow,eup,t,prec, formal_p, sb_result);
3774 for (i =0; i<= no_dim-1; i++) {
3784 for (j=no_dim-1; j>=i+1; j--)
3786 if (strcmp(layout_low[j],
"0")==0)
3792 layout_low[j],
"+1)",NULL));
3808 const char* datatype =
"";
3818 "Allocation=",
QUOTE,
3940 if(FormalParameterNumber >=1) {
3944 for (ith=1;ith<=FormalParameterNumber;ith++) {
3949 xml_Array(FormalArrayName,t, prec,
true, sb_result);
3950 else xml_Scalar(FormalArrayName,prec,sb_result);
3963 string name=
"MOTIF";
4001 else return (
false);
4018 "Loop Index=",
QUOTE, NULL));
4022 "ExecutionMode=",
QUOTE,
4033 bool in_motif_p=!call_external_loop_p && !motif_in_te_p;
4034 bool motif_on_loop_p=
false;
4036 if (call_external_loop_p)
4061 if (motif_on_loop_p) {
4069 in_motif_p = (!call_external_loop_p && !motif_in_te_p)
4084 if (call_external_loop_p)
4120 for (i=1;i<=n;i++) {
4121 for (j=1;j<=m;j++) {
4129 string srow, scolumn;
4132 if (n==0 && m!=0) m=0;
4133 if (m==0 && n!=0) n=0;
4143 for (i=1;i<=n;i++) {
4148 for (j=1;j<=m;j++) {
4169 static void tri_abc(
int a[12],
int dim,
int result[12])
4173 memcpy(a_copy,a,(2*dim+1)*
sizeof(
int));
4175 qsort(&a_copy[1+dim],dim,
sizeof(
int),
int_compare);
4176 for (
int k=0;k<=1;k++)
4177 for ( i=1; i<=dim; i++) {
4178 for (
int j=1; j<=dim; j++)
4179 if (a_copy[i+dim*k]==a[j+dim*k])
4195 ,
int a[12],
int ArrayDim1,
_UNUSED_ int ArrayDim2)
4199 int result[]={0,0,0,0,0,0,0,0,0,0,0,0};
4201 for (i=1; i<= ArrayDim1; i++) {
4202 n = result[i+ArrayDim1];
4203 for (j=1;j<=ArrayDim1;j++) {
4268 int tab[]={0,0,0,0,0,0,0,0,0,0,0,0};
4275 if ((version==0) && (
int)
gen_length(args)==3+3*d) {
4276 for (i=1; i<=d; i++) {
4280 for (i=1;i<=2*d;i++){
4304 else if ((version==1) && (
int)
gen_length(args)==3+2*d) {
4308 for (i=1; i<= d; i++) {
4318 for (i=1; i<= d; i++)
4326 spear_warning(s,
"Change the arguments to be consistent with the prototype ",
4327 "The prototype of the function %s is not correct ",
4370 bool motif_in_te_p =
false;
4438 mat =
matrix_new(ActualArrayDim,FormalArrayDim);
4441 for (i=1;i<=ActualArrayDim && i<= FormalArrayDim;i++)
4445 for (i=ActualArrayDim, j=FormalArrayDim;i>=1 && j>=1;i=i-1,j=j-1)
4457 xml_Matrix(mat,ActualArrayDim,FormalArrayDim,sb_result);
4465 int nestloop_dim =
vect_size(loop_indices2);
4470 mat =
matrix_new(ActualArrayDim,nestloop_dim);
4481 xml_Matrix(mat,ActualArrayDim,nestloop_dim,sb_result);
4544 int valr = 0,
min = 0,
max = 0;
4575 "Array %s is read and written into the same function and "
4576 "appears twice as actual argument in the Call",
4597 "ScalarArgument ActualName=",
QUOTE, NULL));
4601 "FormalName=",
QUOTE,
4604 "AccessMode=",
QUOTE,
4605 (rw_ef >= 2) ? ((rw_ef == 2) ?
"DEF" :
"DEF_USE") :
"USE",
4612 "ScalarArgument ActualName=",
QUOTE, NULL));
4616 "AccessMode=",
QUOTE,
4617 (rw_ef >= 2) ? ((rw_ef == 2) ?
"DEF" :
"DEF_USE") :
"USE",
4627 if (valr==
min && valr==
max)
4630 if (
min != INT_MIN) {
4638 if (
max != INT_MAX) {
4652 cst1->
func =
function;
4659 char *SActualArrayDim =
strdup(
i2a(ActualArrayDim));
4670 "ArrayArgument ActualName=",
QUOTE,NULL));
4676 "FormalName=",
QUOTE,
4680 "AccessMode=",
QUOTE,
4681 (rw_ef >= 2) ? ((rw_ef == 2) ?
"DEF" :
"DEF_USE") :
"USE",
4687 "ArrayArgument ActualName=",
QUOTE, NULL));
4693 "AccessMode=",
QUOTE, (rw_ef >= 2) ? ((rw_ef == 2) ?
"DEF" :
"DEF_USE") :
"USE",
4699 cst1->
func =
function;
4704 free(SActualArrayDim);
4705 xml_Connection(ActualArrayInd, ActualArrayDim, FormalArrayDim, sb_result);
4706 xml_LoopOffset(ActualArrayInd, ActualArrayDim, loop_indices, sb_result);
4727 int valr = 0,
min = 0,
max = 0;
4736 printf(
"PB traduction AssignParameter\n");
4748 "ScalarArgument ActualName=",
QUOTE, NULL));
4760 if (valr==
min && valr==
max)
4766 cst1->
func =
function;
4772 char *SActualArrayDim =
strdup(
i2a(ActualArrayDim));
4781 "ArrayArgument ActualName=",
QUOTE, NULL));
4786 "AccessMode=",
QUOTE, (rw_ef >= 2) ? ((rw_ef == 2) ?
"DEF" :
"DEF_USE") :
"USE",
QUOTE,
4791 cst1->
func =
function;
4795 free(SActualArrayDim);
4797 xml_Connection(ActualArrayInd, ActualArrayDim, FormalArrayDim, sb_result);
4798 xml_LoopOffset(ActualArrayInd, ActualArrayDim, loop_indices, sb_result);
4813 bool func_as_rhs_of_assign =
false;
4841 call final_call = (func_as_rhs_of_assign)? rhs_call:c;
4842 entity final_func = (func_as_rhs_of_assign)? rhs_func:
function;
4843 bool asb = (!assign_func || (assign_func && func_as_rhs_of_assign && !
io_intrinsic_p(rhs_func)));
4849 xml_Argument(s,final_func,statnb, (assign_func && !func_as_rhs_of_assign),
exp,FormalName, loop_indices,t,prec,sb_result);
4851 if (func_as_rhs_of_assign) {
4854 xml_AssignArgument(s,final_func,statnb, assign_func,lhs_exp,FormalName, loop_indices,t, prec,sb_result);
4884 "NON BINARY OPERATORS in conditional are not accepted outside task");
4886 else spear_warning(
s1,
"Change the test or Encapsulate it into a function",
4887 "NON LOGICAL OPERATORS in conditional are not accepted outside task");
4891 "The conditional is not a LOGICAL TEST");
4935 cons *pv1, *ps, *pc;
4940 string string_temp, stn1=
"", stn2=
"";
4941 bool new_temp=
false, empty_buff_computed_by_func1=
true,new_cond=
false;
4942 bool new_temp2=
false, empty_buff_needed_from_func1=
true;
4943 bool empty_buff_cumul_needed=
true;
4952 int stat_kind1=-1,stat_kind2=-1;
4954 list cumulated_effects_list=
NIL, local_effects=
NIL;
4955 string st_nb1, st_nb2;
4992 taskNumber=callnumber;
4994 if (taskNumber>=0) {
5016 "Condition Branch=",
5019 "Test=",
QUOTE, NULL));
5055 if (nb_cond>0) new_cond=
true;
5069 empty_buff_needed_from_func1=
true;
5079 if ( nb_conflicts > 1 ) {
5093 stat_kind1=-1, stat_kind2=-1;
5096 if ((( 0<=stat_kind1 && stat_kind1 <=1)
5098 || ((stat_kind1==2 || stat_kind1==3) && ( 0<=stat_kind2 && stat_kind2 <=1) )
5099 || ((stat_kind2==2 || stat_kind2==3) && ( 0<=stat_kind1 && stat_kind1 <=1))) {
5103 switch(stat_kind1) {
5110 stn1 =
strdup(
"DeclarationInstruction");
5122 stn1 =
strdup(
"LocalAssignment");
5125 stn1 =
strdup(
"LocalAssignment");
5129 stn1 =
strdup(
"TestInstruction");
5135 switch(stat_kind2) {
5142 stn2 =
strdup(
"DeclarationInstruction");
5154 stn2 =
strdup(
"LocalAssignment");
5157 stn2 =
strdup(
"LocalAssignment");
5162 stn2 =
strdup(
"TestInstruction");
5174 (stat_kind1>=0 && stat_kind1<=1)?
"TaskRef Name=" :
"Instruction Name=",
QUOTE,stn1,
QUOTE,
BL,
5179 empty_buff_computed_by_func1=
true;
5185 (stat_kind2>=0 && stat_kind2<=1)?
"TaskRef Name=" :
"Instruction Name=",
QUOTE,stn2,
QUOTE,
BL,
5190 empty_buff_needed_from_func1=
true;
5235 empty_buff_computed_by_func1=
false;
5259 empty_buff_needed_from_func1=
false;
5268 "Elements of Array %s written into two different functions %s and %s",
5292 empty_buff_computed_by_func1=
false;
5300 if (!empty_buff_needed_from_func1) {
5303 empty_buff_cumul_needed=
false;
5307 empty_buff_needed_from_func1=
true;
5315 if (new_cond && !new_temp) {
5318 if (!empty_buff_computed_by_func1) {
5320 for (
int tp=1;tp<=nb_cond;tp++) {
5332 empty_buff_computed_by_func1=
true;
5340 if (taskNumber>=0) {
5362 for (pc= local_effects;!
ENDP(pc); pc =
CDR(pc)){
5426 for (
int tp=1;tp<=nb_cond;tp++) {
5442 "Instruction Name=",
QUOTE,
"TestInstruction",
QUOTE,
BL,
5450 "Needs ",
"ScalarName=",
5475 if (!empty_buff_cumul_needed) {
5483 for (pc= cumulated_effects_list;pc !=
NIL; pc =
CDR(pc)){
5505 taskNumber=callnumber;
5507 if (taskNumber>=0) {
5527 "Condition Branch=",
5530 "Test=",
QUOTE, NULL));
5549 if (nb_cond>0) new_cond=
true;
5560 "NestedCall",
QUOTE,
5582 for (
int tp=1;tp<=nb_cond;tp++) {
5703 bool motif_in_te_p=
false;
5704 bool func_as_rhs_of_assign =
false;
5706 entity cond, encapsulated_func,func ;
5736 spear_warning(s,
"Please use only scalar variable on the left hand side of assignements not included in a MOTIF",
5737 "Non scalar variable as LHS part of a LocalAssignment");
5742 spear_warning(s,
"Please use only scalar variable on the right hand side of assignements not included in a MOTIF",
5743 "Non scalar variable as RHS part of a LocalAssignment");
5747 spear_warning(s,
"Please use only one varaible on the right hand side of assignements not included in a MOTIF",
5748 "More than 1 variable as RHS part of a LocalAssignment");
5774 "CallCondition Branch=",
5777 "Test=",
QUOTE, NULL));
5781 "LHS=",
QUOTE, NULL));
5812 if (strstr(strtmp,
"cornerturn_5D")!=NULL)
5814 else if (strstr(strtmp,
"cornerturn_4D")!=NULL)
5816 else if (strstr(strtmp,
"cornerturn_3D")!=NULL)
5819 if (strstr(strtmp,
"cornerturn_2D")!=NULL)
5822 if (strstr(strtmp,
"transpose_5D")!=NULL)
5824 else if (strstr(strtmp,
"transpose_4D")!=NULL)
5826 else if (strstr(strtmp,
"transpose_3D")!=NULL)
5829 if (strstr(strtmp,
"transpose_2D")!=NULL)
5841 for (
int tp=1;tp<=nb_cond;tp++) {
5854 string string_needs =
"";
5861 for (pc= effects_list;pc !=
NIL; pc =
CDR(pc)){
5891 for (pc= effects_list;pc !=
NIL; pc =
CDR(pc)){
5926 bool wmotif =
false;
5938 if (wmotif && !wbox)
5950 string string_types;
5954 int st_nb1=0, st_sauv=0;
6014 for (
int callnumber = 0; callnumber<nb_call; callnumber++) {
6018 if (callnumber==0 || st_nb1!=st_sauv)
6122 string dir, filename;
6126 string resource = is_app? DBR_SPEAR_APP_FILE : DBR_SPEAR_CODE_FILE;
6164 debug_on(
"XMLPRETTYPRINTER_DEBUG_LEVEL");
6167 fprintf(
out,
"%s<!-- XML prettyprint for %s \"%s\" --> \n",
6169 is_app?
"application": code_tag ==
code_is_a_te?
"task":
"box",
void free_transformer(transformer p)
entity_to_entity make_entity_to_entity(void)
bool bound_entity_to_entity_p(entity_to_entity f, entity k)
void update_entity_to_entity(entity_to_entity f, entity k, entity v)
void extend_entity_to_entity(entity_to_entity f, entity k, entity v)
entity apply_entity_to_entity(entity_to_entity f, entity k)
struct _newgen_struct_entity_ * entity
static reference ref
Current stmt (an integer)
void list_to_array(list l, gen_array_t a)
args.c
string list_to_string(list l)
Return the malloc()ed version of the concatenation of all the strings in the list.
void const char const char const int
size_t gen_array_nitems(const gen_array_t a)
gen_array_t gen_array_make(size_t size)
declarations...
void ** gen_array_pointer(const gen_array_t a)
Observers...
void * gen_array_item(const gen_array_t a, size_t i)
void gen_array_append(gen_array_t a, void *what)
void gen_array_free(gen_array_t a)
Pbase base_normalize(Pbase b)
bool transformer_is_rn_p(transformer t)
Check that transformer t is the canonical representation of the whole afine space defined by its basi...
static graph dg
dg is the dependency graph ; FIXME : should not be static global ?
struct _newgen_struct_statement_ * statement
bool complexity_zero_p(complexity comp)
zero complexity check.
char * complexity_sprint(complexity comp, bool print_stats_p, bool print_local_names_p)
void init_cost_table()
Completes the intrinsic cost table with the costs read from the files specified in the "COMPLEXITY_CO...
static bool reduction_p(set reductions_l[STEP_UNDEF_REDUCE], entity e)
complexity load_statement_complexity(statement)
void reset_complexity_map(void)
void set_complexity_map(statement_mapping)
#define CONTRAINTE_UNDEFINED_P(c)
#define contrainte_vecteur(c)
passage au champ vecteur d'une contrainte "a la Newgen"
#define CONTRAINTE_UNDEFINED
Pcontrainte contrainte_make(Pvecteur pv)
Pcontrainte contrainte_make(Pvecteur pv): allocation et initialisation d'une contrainte avec un vecte...
Pcontrainte contrainte_dup(Pcontrainte c_in)
Pcontrainte contrainte_dup(Pcontrainte c_in): allocation d'une contrainte c_out prenant la valeur de ...
struct _newgen_struct_dg_arc_label_ * dg_arc_label
#define CONFLICT(x)
CONFLICT.
#define dg_arc_label_conflicts(x)
#define conflict_source(x)
#define region_write_p(reg)
#define region_system(reg)
#define region_read_p(reg)
useful region macros
#define region_undefined_p(reg)
#define region
simulation of the type region
entity make_phi_entity(int)
void set_rw_effects(statement_effects)
list load_proper_rw_effects_list(statement)
void reset_proper_rw_effects(void)
void set_proper_rw_effects(statement_effects)
void set_cumulated_rw_effects(statement_effects)
void reset_cumulated_rw_effects(void)
list load_statement_local_regions(statement)
void reset_rw_effects(void)
#define effect_any_reference(e)
FI: cannot be used as a left hand side.
#define effect_read_p(eff)
#define effect_scalar_p(eff) entity_scalar_p(effect_entity(eff))
bool store_effect_p(effect)
void set_pt_to_list(statement_points_to)
bool environment_effect_p(effect)
void reset_pt_to_list(void)
#define effect_undefined_p(x)
#define action_write_p(x)
string make_entity_fullname(const char *module_name, const char *local_name)
END_EOLE.
const char * module_name(const char *s)
Return the module part of an entity name.
FILE * safe_fopen(const char *filename, const char *what)
char * get_string_property(const char *)
int safe_fclose(FILE *stream, const char *filename)
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
#define gen_context_recurse(start, ctxt, domain_number, flt, rwt)
#define gen_recurse(start, domain_number, flt, rwt)
static char start[1024]
The name of the variable from which to start counting domain numbers.
#define successor_vertex(x)
#define successor_arc_label(x)
struct _newgen_struct_graph_ * graph
#define vertex_successors(x)
#define SUCCESSOR(x)
SUCCESSOR.
#define graph_vertices(x)
void reset_current_module_entity(void)
Reset the current module entity.
void reset_current_module_statement(void)
Reset the current module statement.
const char * get_current_module_name(void)
Get the name of the current module.
statement set_current_module_statement(statement)
Set the current module statement.
void push_current_module_statement(statement)
Set the statement of the current module and push the statement of the previous one on a stack.
statement get_current_module_statement(void)
Get 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.
void pop_current_module_statement(void)
Pop the current module statement stack and use it as the current module statement.
void gen_context_multi_recurse(void *o, void *context,...)
Multi-recursion with context function visitor.
void gen_null2(__attribute__((unused)) void *u1, __attribute__((unused)) void *u2)
idem with 2 args, to please overpeaky compiler checks
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
bool gen_true(__attribute__((unused)) gen_chunk *unused)
Return true and ignore the argument.
#define ENDP(l)
Test if a list is empty.
#define list_undefined_p(c)
Return if a list is undefined.
#define POP(l)
Modify a list pointer to point on the next element of the list.
#define NIL
The empty list (nil in Lisp)
size_t gen_length(const list l)
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
#define CAR(pcons)
Get the value of the first element of a list.
void gen_free_list(list l)
free the spine of the list
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
#define CDR(pcons)
Get the list less its first element.
list gen_append(list l1, const list l2)
#define list_undefined
Undefined list definition :-)
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
void gen_sort_list(list l, gen_cmp_func_t compare)
Sorts a list of gen_chunks in place, to avoid allocations...
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 DB_PUT_FILE_RESOURCE
Put a file resource into the current workspace database.
bool statement_call_p(statement)
bool statement_loop_p(statement)
bool return_statement_p(statement)
Test if a statement is a C or Fortran "return".
bool continue_statement_p(statement)
Test if a statement is a CONTINUE, that is the FORTRAN nop, the ";" in C or the "pass" in Python....
bool declaration_statement_p(statement)
Had to be optimized according to Beatrice Creusillet.
hash_table hash_table_make(hash_key_type key_type, size_t size)
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
void hash_table_free(hash_table htp)
this function deletes a hash table that is no longer useful.
void * hash_del(hash_table htp, const void *key)
this function removes from the hash table pointed to by htp the couple whose key is equal to key.
#define full_name(dir, name)
bool expression_constant_p(expression)
HPFC module by Fabien COELHO.
statement vertex_to_statement(vertex v)
Vertex_to_statement looks for the statement that is pointed to by vertex v.
static statement mod_stat
We want to keep track of the current statement inside the recurse.
static int upperbound(Pproblem XX, struct rproblem *RR, int iv, int rvar, float epss)
static int cutbounds(Pproblem XX,struct rproblem *RR,int iv, int rvar,float epss)
bool vect_opposite_except(Pvecteur v1, Pvecteur v2, Variable var)
bool vect_opposite_except(Pvecteur v1, Pvecteur v2, Variable var): test a egalite des projections sel...
int vect_dimension(Pvecteur v)
int vect_dimension(Pvecteur v): calcul du nombre de composantes non nulles et non constantes d'un vec...
int vect_size(Pvecteur v)
package vecteur - reductions
string db_build_file_resource_name(const char *rname, const char *oname, const char *suffix)
returns an allocated file name for a file resource.
#define matrix_free(m)
Allocation et desallocation d'une matrice.
#define MATRIX_ELEM(matrix, i, j)
Macros d'acces aux elements d'une matrice.
Pmatrix matrix_new(int m, int n)
package matrix
#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 pips_internal_error
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
#define spear_warning(...)
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
#define MEMBER_SEP_STRING
#define GEN_ARRAY_FOREACH(type, s, array)
string gen_strndup0(string, size_t)
Like strdup() but copy at most n characters.
char * i2a(int)
I2A (Integer TO Ascii) yields a string for a given Integer.
string strupper(string, const char *)
string concatenate(const char *,...)
Return the concatenation of the given strings.
#define HASH_UNDEFINED_VALUE
value returned by hash_get() when the key is not found; could also be called HASH_KEY_NOT_FOUND,...
#define hash_table_undefined
Value of an undefined hash_table.
#define same_string_p(s1, s2)
void * gen_find_tabulated(const char *, int)
#define STACK_NULL
defines for empty values
#define STACK_MAP_X(_item, _itemtype, _code, _stack, _downwards)
not needed
stack stack_copy(const stack)
duplicate a stack with its contents.
void * stack_head(const stack)
returns the item on top of stack s
int stack_size(const stack)
observers
void stack_push(void *, stack)
stack use
void stack_free(stack *)
type, bucket_size, policy
stack stack_make(int, int, int)
allocation
void * stack_pop(stack)
POPs one item from stack s.
void string_buffer_append(string_buffer, const string)
append string s (if non empty) to string buffer sb, the duplication is done if needed according to th...
string string_buffer_to_string(const string_buffer)
return malloc'ed string from string buffer sb
void string_buffer_free(string_buffer *)
free string buffer structure, also free string contents according to the dup field
string_buffer string_buffer_make(bool dup)
allocate a new string buffer
bool string_buffer_empty_p(const string_buffer)
return whether string_buffer sb is empty.
void string_buffer_append_xml_text(string_buffer, const string, bool)
append a string with XML escapes
#define string_undefined_p(s)
int(* gen_cmp_func_t)(const void *, const void *)
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
void print_ordering_to_statement(void)
Dump the ordering with the corresponding statement address.
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
normalized NormalizeExpression(expression e)
normalize.c
string db_get_current_workspace_directory(void)
string expression_to_string(expression e)
void print_reference(reference r)
list Words_Syntax(syntax obj)
string basic_to_string(basic)
void print_statement(statement)
Print a statement on stderr.
Pvecteur vect_reversal(Pvecteur vect_in)
Pvecteur vect_reversal(Pvecteur vect_in); produces the reversal vector of the vect_in.
#define pattern_indices(x)
#define ENTITY_ASSIGN_P(e)
#define PLUS_OPERATOR_NAME
#define NORMALIZE_EXPRESSION(e)
#define ADDRESS_OF_OPERATOR_NAME
#define ENTITY_LOGICAL_OPERATOR_P(e)
Attention : This definition is different with the Fortran Standard where the logical operators are th...
#define ASSIGN_OPERATOR_NAME
bool stack_area_p(entity aire)
bool heap_area_p(entity aire)
const char * entity_user_name(entity e)
Since entity_local_name may contain PIPS special characters such as prefixes (label,...
bool io_intrinsic_p(entity e)
rue is a statement s is an io intrinsic
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
bool array_entity_p(entity e)
bool same_entity_p(entity e1, entity e2)
predicates on entities
bool entity_subroutine_p(entity e)
bool std_file_entity_p(entity e)
entity module_name_to_entity(const char *mn)
This is an alias for local_name_to_top_level_entity.
bool entity_main_module_p(entity e)
bool entity_function_p(entity e)
bool effects_package_entity_p(entity e)
checks if an entity is an IO_EFFECTS_PACKAGE_NAME, a MALLOC_EFFECTS_NAME or a RAND_EFFECTS_PACKAGE_NA...
void print_entities(list l)
bool fortran_module_p(entity m)
Test if a module is in Fortran.
bool top_level_entity_p(entity e)
Check if the scope of entity e is global.
entity find_ith_formal_parameter(entity the_fnct, int rank)
This function gives back the ith formal parameter, which is found in the declarations of a call or a ...
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
value EvalExpression(expression e)
Evaluate statically an expression.
bool expression_integer_value(expression e, intptr_t *pval)
expression make_vecteur_expression(Pvecteur pv)
make expression for vector (Pvecteur)
bool expression_field_p(expression e)
The expression is of kind "s.a", where "s" is a struct and a "a" field.
int expression_to_int(expression exp)
================================================================
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
call expression_call(expression e)
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
bool reference_equal_p(reference r1, reference r2)
bool array_argument_p(expression e)
list module_formal_parameters(entity func)
list module_formal_parameters(entity func) input : an entity representing a function.
dimension find_ith_dimension(list, int)
This function returns the ith dimension of a list of dimensions.
bool entity_static_variable_p(entity)
return true if the entity is declared with the keyword static
type expression_to_type(expression)
For an array declared as int a[10][20], the type returned for a[i] is int [20].
statement pop_statement_global_stack(void)
size_t maximal_type_depth(type)
Number of steps to access the lowest leave of type t without a recursive test.
bool integer_type_p(type)
type entity_basic_concrete_type(entity)
retrieves or computes and then returns the basic concrete type of an entity
_int SizeOfElements(basic)
This function returns the length in bytes of the Fortran or C type represented by a basic,...
void push_statement_on_statement_global_stack(statement)
type compute_basic_concrete_type(type)
computes a new type which is the basic concrete type of the input type (this new type is not stored i...
bool variable_heap_p(entity)
void free_statement_global_stack(void)
int variable_entity_dimension(entity)
variable_entity_dimension(entity v): returns the dimension of variable v; scalar have dimension 0.
void make_statement_global_stack(void)
#define type_functional_p(x)
#define entity_to_entity_undefined_p(x)
#define value_undefined_p(x)
#define test_domain
newgen_entity_domain_defined
#define normalized_undefined
#define syntax_reference_p(x)
#define transformer_undefined
#define functional_result(x)
#define transformer_undefined_p(x)
#define loop_execution(x)
#define storage_formal_p(x)
#define value_constant(x)
#define syntax_reference(x)
#define value_reference(x)
#define reference_undefined
#define extension_pragma_p(x)
#define reference_variable(x)
#define loop_domain
newgen_language_domain_defined
#define basic_typedef_p(x)
#define reference_undefined_p(x)
#define instruction_loop(x)
#define type_functional(x)
#define dimension_lower(x)
#define pragma_string_p(x)
#define call_undefined_p(x)
#define basic_pointer_p(x)
#define basic_derived_p(x)
#define entity_storage(x)
#define statement_domain
newgen_sizeofexpression_domain_defined
#define code_declarations(x)
#define range_increment(x)
#define value_constant_p(x)
#define call_domain
newgen_callees_domain_defined
#define EXPRESSION(x)
EXPRESSION.
#define cast_expression(x)
#define extension_pragma(x)
#define EXTENSION(x)
EXTENSION.
#define entity_undefined_p(x)
#define reference_domain
newgen_range_domain_defined
#define constant_int_p(x)
#define expression_undefined
@ is_instruction_sequence
#define instruction_tag(x)
#define loop_undefined_p(x)
#define transformer_relation(x)
#define expression_normalized(x)
#define sequence_statements(x)
#define dimension_upper(x)
#define reference_indices(x)
#define statement_extensions(x)
#define instruction_sequence(x)
#define dimension_undefined
#define instruction_call_p(x)
#define test_condition(x)
#define value_reference_p(x)
#define variable_dimensions(x)
#define statement_declarations(x)
#define statement_instruction(x)
#define statement_comments(x)
#define instruction_call(x)
#define extensions_extension(x)
struct _newgen_struct_transformer_ * transformer
#define instruction_test_p(x)
#define call_arguments(x)
#define instruction_test(x)
#define statement_undefined_p(x)
#define statement_number(x)
#define normalized_linear(x)
#define expression_syntax(x)
#define execution_parallel_p(x)
#define storage_return_p(x)
#define type_variable_p(x)
#define predicate_system(x)
#define entity_domain
newgen_syntax_domain_defined
#define variable_basic(x)
#define statement_undefined
#define entity_to_entity_undefined
#define STATEMENT(x)
STATEMENT.
#define entity_initial(x)
int vertex_sort_callback(const vertex *, const vertex *)
This is a callback for qsort function, it compares two vertex.
int successor_sort_callback(const successor *, const successor *)
This is a callback for qsort function, it compares two successor.
int conflicts_sort_callback(conflict *, conflict *)
This is a callback for qsort function, it compares two conflicts.
void sc_rm(Psysteme ps)
void sc_rm(Psysteme ps): liberation de l'espace memoire occupe par le systeme de contraintes ps;
Psysteme sc_dup(Psysteme ps)
Psysteme sc_dup(Psysteme ps): should becomes a link.
Psysteme sc_free(Psysteme in_ps)
Psysteme sc_free( in_ps ) AL 30/05/94 Free of in_ps.
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
void vect_chg_sgn(Pvecteur v)
void vect_chg_sgn(Pvecteur v): multiplie v par -1
void module_to_value_mappings(entity m)
void module_to_value_mappings(entity m): build hash tables between variables and values (old,...
void integer_expression_and_precondition_to_integer_interval(expression, transformer, int *, int *)
Could be used for bool expressions too? Extended to any kind of expression?
transformer load_statement_precondition(statement)
void reset_precondition_map(void)
void set_precondition_map(statement_mapping)
struct Scontrainte * succ
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
internally defined structure.
The structure used to build lists in NewGen.
Warning! Do not modify this file that is automatically generated!
gen_array_t nested_loop_indices
#define CHAIN_SWORD(l, s)
string words_to_string(cons *lw)
static int depth
la sequence de nids
#define exp
Avoid some warnings from "gcc -Wshadow".
#define TCST
VARIABLE REPRESENTANT LE TERME CONSTANT.
#define VECTEUR_NUL
DEFINITION DU VECTEUR NUL.
#define VECTEUR_UNDEFINED
struct Svecteur * Pvecteur
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
#define BASE_NULLE
MACROS SUR LES BASES.
#define VECTEUR_UNDEFINED_P(v)
Pbase vect_copy(Pvecteur b)
direct duplication.
Pvecteur vect_dup(Pvecteur v_in)
Pvecteur vect_dup(Pvecteur v_in): duplication du vecteur v_in; allocation de et copie dans v_out;.
Pvecteur vect_new(Variable var, Value coeff)
Pvecteur vect_new(Variable var,Value coeff): allocation d'un vecteur colineaire au vecteur de base va...
void vect_rm(Pvecteur v)
void vect_rm(Pvecteur v): desallocation des couples de v;
Pvecteur vect_cl2(Value x1, Pvecteur v1, Value x2, Pvecteur v2)
Pvecteur vect_add(Pvecteur v1, Pvecteur v2)
package vecteur - operations binaires
void vect_erase_var(Pvecteur *ppv, Variable v)
void vect_erase_var(Pvecteur * ppv, Variable v): projection du vecteur *ppv selon la direction v (i....
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Value vect_coeff(Variable var, Pvecteur vect)
Variable vect_coeff(Variable var, Pvecteur vect): coefficient de coordonnee var du vecteur vect —> So...
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val)
void vect_chg_coeff(Pvecteur *ppv, Variable var, Value val): mise de la coordonnee var du vecteur *pp...
static bool variable_p(entity e)
static void push_if(_UNUSED_ test l, nest_context_p nest)
static string array_mem_string
static void xml_Connection(list ActualArrayInd, int ActualArrayDim, int FormalArrayDim, string_buffer sb_result)
static string xml_code_string(entity module, statement stat)
Creates string for xml pretty printer.
struct Spattern * Ppattern
#define ITEM_NOT_IN_ARRAY
static string xml_sequence_from_task(sequence seq)
Concatentates each task to the final result.
static void xml_Arguments(statement s, entity function, int statnb, bool assign_func, Pvecteur loop_indices, transformer t, Psysteme prec, string_buffer sb_result)
static string xml_array_in_task(reference r, bool first, int task_number)
bool print_xml_application_main(const char *module_name)
static string this_entity_xmldeclaration(entity var)
static int int_compare(void const *a, void const *b)
static bool same_callst_p(Pcallst c1, Pcallst c2)
static void xml_ConstOffset(list ActualArrayInd, int ActualArrayDim, string_buffer sb_result)
static void xml_task(int taskNumber, nest_context_p nest, string_buffer result)
static bool box_in_statement_p
static loop sequence_loop(sequence seq)
static void xml_LoopOffset(list ActualArrayInd, int ActualArrayDim, Pvecteur loop_indices, string_buffer sb_result)
static Pvecteur global_application_variables
static transformer first_precondition_of_module(const char *module_name __attribute__((unused)), Psysteme *ps)
static void xml_Regions(string_buffer sb_result __attribute__((unused)))
static void string_buffer_append_word(string str, string_buffer sb_result)
static void push_current_statement(statement s, nest_context_p nest)
static void motif_in_statement(statement s)
static hash_table hash_entity_def_into_tasks
static expression skip_cast_and_addop_expression(expression exp)
static void xml_Matrix(Pmatrix mat, int n, int m, string_buffer sb_result)
static int gen_array_index(gen_array_t ar, string item)
static void xml_FormalVariables(entity module, transformer t, Psysteme prec, string_buffer sb_result)
static statement test_statement_of_reference
static void type_and_size_of_var(entity var, const char **datatype, int *size)
UNUSED static bool vect_one_p(Pvecteur v) { return (!VECTEUR_NUL_P(v) && vect_size(v) == 1 && vect_co...
static void xml_Argument(statement s, entity function, int statnb, bool assign_func, expression exp0, entity FormalName, Pvecteur loop_indices, transformer t, _UNUSED_ Psysteme prec, string_buffer sb_result)
static void find_pattern(Psysteme ps, Pvecteur paving_indices, Pvecteur formal_parameters, int dim, Ppattern *patt)
static gen_array_t extern_indices_array
array containing extern loop indices names
static void xml_Loops(stack st, bool call_external_loop_p, list *pattern_region, Pvecteur *paving_indices, Pvecteur *pattern_indices, bool motif_in_te_p, string_buffer sb_result)
static int find_effect_actions_for_entity(list leff, effect *effr, effect *effw, entity e)
static void def_to_task_store(entity var, entity fun)
static bool fortran_appli
static void string_buffer_append_numeric(string str, string_buffer sb_result)
bool print_xml_application_main_with_points_to(const char *module_name)
static string xml_entity_local_name(entity var)
static void xml_AccessFunction(string_buffer sb_result __attribute__((unused)))
static void xml_Chain_Graph(entity module, statement mod_stat, graph mod_graph, nest_context_p nest, string_buffer sb_result)
static void xml_TaskReturnParameter(entity function, _UNUSED_ int statnb, string_buffer sb_result)
static bool string_parameter_p(entity e)
static void __attribute__((unused))
static void find_loops_and_calls_in_box(statement stmp, nest_context_p nest)
static void update_def_into_tasks_table(entity v, Pcallst c1)
bool print_xml_application_with_points_to(const char *module_name)
static void xml_Full_Type(type pt, int max_step, string_buffer type_result)
static void xml_data(int taskNumber, statement s, stack indices, string_buffer result)
static void two_string_buffer_append_symbolic(string str1, string str2, string_buffer sb_result)
static void xml_loop(stack st, string_buffer result)
static gen_array_t array_names
static void store_call_context(call c __attribute__((unused)), nest_context_p nest)
static expression skip_field_and_cast_expression(expression exp)
static void xml_TaskParameter(bool assign_function, _UNUSED_ entity function, int statnb, bool is_not_main_p, entity var, Pvecteur formal_parameters, list pattern_region, Pvecteur paving_indices, string_buffer sb_result, string_buffer buffer_assign)
static bool logic_condition_filter(statement s1, statement sx, entity *cond, expression *lhs, expression *rhs)
static gen_array_t intern_indices_array
array containing intern loop indices (name : "M_")
static bool statement_in_truebranch_p
static bool region_range_nul_p(region reg, Variable phi)
tatic bool string_in_list_p(string ts,list lr){ bool trouve=false; MAPL(tt, {trouve= trouve || strcmp...
static void pop_current_statement(statement s __attribute__((unused)), nest_context_p nest)
static void xml_reference(int taskNumber __attribute__((unused)), reference r, bool wmode, string_buffer result)
static list local_declaration_list
static string memory_location_for_array_p(const char *sa)
static void xml_Transposition(statement s, call c, int d, string_buffer sb_result, int version)
static bool print_name_1_level_p()
static void xml_Compute_and_Need(entity func, list effects_list, Pvecteur vargs, string_buffer sb_result)
static bool valid_specification_p(entity module __attribute__((unused)), statement stat __attribute__((unused)))
static void xml_call_from_indice(call c, string *offset_array, string paving_array[], string fitting_array[])
static void xml_Boxes(const char *module_name, int code_tag, string_buffer sb_result)
static bool pragma_motif_p(statement s)
static void xml_Library(string_buffer sb_result)
static void search_nested_loops_and_calls(statement stmp, nest_context_p nest)
static void dependencies_filter(statement s1, int *k1)
static string xml_expression(expression)
forward declaration
static entity_to_entity def_to_task_mapping
static void find_motif(Psysteme ps, Pvecteur nested_indices, int dim, int nb_dim __attribute__((unused)), Pcontrainte *bound_inf, Pcontrainte *bound_sup, Pcontrainte *iterator, int *motif_up_bound, int *lowerbound, int *upperbound)
static void xml_Bounds(expression elow, expression eup, transformer t, _UNUSED_ Psysteme prec, bool formal_p, string_buffer sb_result)
UNUSED static bool eval_linear_expression2( expression exp, Psysteme ps, int *val,...
dg_vertex_label vertex_label
static void xml_Type_Entity(entity vv, string_buffer type_buffer)
static bool entity_in_expression_p(expression exp, entity e)
bool print_xml_code(const char *module_name)
Initiates xml pretty print modules.
static void xml_Region_Parameter(list pattern_region, string_buffer sb_result)
static void string_buffer_append_symbolic(string str, string_buffer sb_result)
static void pop_loop(_UNUSED_ loop l, nest_context_p nest)
static entity def_to_task_get(entity var)
static void xml_Application(const char *module_name, int code_tag, string_buffer sb_result)
static void pop_test(test t __attribute__((unused)), nest_context_p nest __attribute__((unused)))
static call xml_loop_from_loop(loop l, string *result, int task_number)
static void tri_abc(int a[12], int dim, int result[12])
static void xml_declarations(entity module, string_buffer result)
static string xml_reference_with_explicit_motif(reference r)
Attention with Fortran: the indices are reversed.
static void xml_Pattern_Paving(region reg, entity var, bool effet_read, Pvecteur formal_parameters, Pvecteur paving_indices, string_buffer sb_result)
static void xml_Scalar(entity var, _UNUSED_ Psysteme prec, string_buffer sb_result)
char * pointer_to_initial_name(char *ts, _UNUSED_ char *ste)
static void xml_Chains(entity module, const char *mod_name, statement mod_stat, nest_context_p nest, string_buffer sb_result)
static void xml_references(int taskNumber, list l_regions, stack indices, string_buffer result)
static void xml_tiling(int taskNumber, reference ref, region reg, stack indices, string_buffer result)
static expression skip_cast_expression(expression exp)
static bool indice_p(stack indices, entity v)
static void xml_Array(entity var, transformer t, Psysteme prec, bool formal_p, string_buffer sb_result)
static void store_local_array_declaration(statement s)
static void xml_TaskParameters(statement stat, bool assign_function, int code_tag, entity module, list pattern_region, Pvecteur paving_indices, string_buffer sb_result)
#define current_module_is_a_function()
static const char * global_module_name
static bool push_test(test t __attribute__((unused)), nest_context_p nest __attribute__((unused)))
static void xml_Bounds_and_Stride(expression elow, expression eup, expression stride, transformer t, Psysteme prec, bool formal_p, string_buffer sb_result)
static string task_complexity(statement s)
static void add_margin(int gm, string_buffer sb_result)
static void add_def_into_tasks_table(entity v, Pcallst c1)
static void xml_ParameterUseToArrayBound(entity var, string_buffer sb_result)
static Pvecteur local_application_variables
static bool print_full_name_p()
=======================================================
static bool entity_xml_parameter_p(entity e)
static string vect_to_string(Pvecteur pv)
static string xml_declarations_with_explicit_motif(entity module, bool(*consider_this_entity)(entity), string separator, bool lastsep)
static void cumul_and_update_effects_of_statement(statement s)
static call encapsulated_call
static void vars_read_and_written(list effects_list, Pvecteur *vr, Pvecteur *vw)
UNUSED static void array_vars_read_or_written(list effects_list, Pvecteur *vl) { Pvecteur vin=VECTEUR...
static gen_array_t array_dims
static call sequence_call(sequence seq)
static gen_array_t extern_upperbounds_array
array containing extern upperbounds
static string array_location_string
static void print_call_precondition(Psysteme prec, string_buffer sb_result)
static int check_alias_args(reference r, alias_in_args *p)
static void choose_pattern(Ppattern *patt)
static void xml_Returns(string_buffer sb_result __attribute__((unused)))
static bool motif_in_statement_p
static int find_code_status(const char *module_name)
static void def_to_task_init(void)
char * str_sub(const char *s, int start, int end)
static void xml_Timecosts(string_buffer sb_result __attribute__((unused)))
static void xml_Call(entity module, int code_tag, int taskNumber, nest_context_p nest, string_buffer sb_result)
static void xml_tasks(statement stat, string_buffer result)
static string xml_loop_from_sequence(loop l, int task_number)
We enter a loop nest.
static void xml_Transposed_Matrix3_5D(Pmatrix mat, int a[12], int ArrayDim1, _UNUSED_ int ArrayDim2)
static string xml_dim_string(list ldim, string name)
static void xml_AssignArgument(_UNUSED_ statement s, entity function, int statnb, bool assign_func, expression exp, entity FormalName, Pvecteur loop_indices, transformer t, _UNUSED_ Psysteme prec, string_buffer sb_result)
static void xml_LocalVariables(entity module, transformer t, Psysteme prec, string_buffer sb_result)
bool eval_linear_expression(expression exp, transformer ps, int *val, int *min, int *max)
static bool call_selection(call c, nest_context_p nest __attribute__((unused)))
static void xml_Region_Range(region reg, string_buffer sb_result)
static void xml_Loop(statement s, string_buffer sb_result)
static void search_1r_function_call(call c)
static void xml_Task(const char *module_name, int code_tag, string_buffer sb_result)
static void pop_if(test l __attribute__((unused)), nest_context_p nest)
static string xml_call_from_loopnest(call c, int task_number)
static list cumulated_list
static string xml_call_from_assignation(call c, int task_number, bool *input_provided)
static string xml_statement_from_sequence(statement s, int task_number)
We are here at the highest level of statements.
static string xml_code(entity module, statement stat)
Creates string for xml pretty printer.
static void statement_in_truebranch(statement s)
static void box_in_statement(statement s)
currently unused static void motif_in_statement2(statement s) { string comm = statement_comments(s); ...
static void def_to_task_set(entity_to_entity mapping)
static gen_array_t intern_upperbounds_array
array containing intern upperbounds
bool print_xml_application(const char *module_name)
static bool generic_print_xml_application(const char *module_name, bool is_app)
static string xml_tasks_with_motif(statement stat)
Manages tasks.
static gen_array_t tasks_names
array containing the tasks names
static void def_to_task_reset(void)
static void same_entities(reference r, expression_ctxt *ctxt)
static void push_loop(loop l, nest_context_p nest)
static void xml_Transposed_Matrix2D(Pmatrix mat)
static expression expression_plusplus(expression e)
static void find_memory_comment_on_array(statement s)
static bool aliasing_p(call c, reference refname)
static void xml_GlobalVariables(transformer t, Psysteme prec, bool printp, string_buffer sb_result)
static void cumul_effects_of_statement(statement s)
static const char * words_points_to_reference(reference rv, bool suffix_only_p, region reg)
bool print_xml_code_with_explicit_motif(const char *module_name)
Initiates xml pretty print modules.
static void matrix_init(Pmatrix mat, int n, int m)
static void xml_CodeSize(string_buffer sb_result)