OpenScop  0.9.1
statement.c
Go to the documentation of this file.
1 
2  /*+-----------------------------------------------------------------**
3  ** OpenScop Library **
4  **-----------------------------------------------------------------**
5  ** statement.c **
6  **-----------------------------------------------------------------**
7  ** First version: 30/04/2008 **
8  **-----------------------------------------------------------------**
9 
10 
11  *****************************************************************************
12  * OpenScop: Structures and formats for polyhedral tools to talk together *
13  *****************************************************************************
14  * ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__, *
15  * / / / // // // // / / / // // / / // / /|,_, *
16  * / / / // // // // / / / // // / / // / / / /\ *
17  * |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/ \ *
18  * | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\ \ /\ *
19  * | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\ *
20  * | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \ \ *
21  * | P |n| l | = | s | t |=| = |d| = | = | = | | |=| o | | \# \ \ *
22  * | H | | y | | e | o | | = |l| | | = | | | | G | | \ \ \ *
23  * | I | | | | e | | | | | | | | | | | | | \ \ \ *
24  * | T | | | | | | | | | | | | | | | | | \ \ \ *
25  * | E | | | | | | | | | | | | | | | | | \ \ \ *
26  * | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | / \* \ \ *
27  * | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/ \ \ / *
28  * '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---' '--' *
29  * *
30  * Copyright (C) 2008 University Paris-Sud 11 and INRIA *
31  * *
32  * (3-clause BSD license) *
33  * Redistribution and use in source and binary forms, with or without *
34  * modification, are permitted provided that the following conditions *
35  * are met: *
36  * *
37  * 1. Redistributions of source code must retain the above copyright notice, *
38  * this list of conditions and the following disclaimer. *
39  * 2. Redistributions in binary form must reproduce the above copyright *
40  * notice, this list of conditions and the following disclaimer in the *
41  * documentation and/or other materials provided with the distribution. *
42  * 3. The name of the author may not be used to endorse or promote products *
43  * derived from this software without specific prior written permission. *
44  * *
45  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR *
46  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
47  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. *
48  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, *
49  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT *
50  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
51  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
52  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
53  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF *
54  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
55  * *
56  * OpenScop Library, a library to manipulate OpenScop formats and data *
57  * structures. Written by: *
58  * Cedric Bastoul <Cedric.Bastoul@u-psud.fr> and *
59  * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr> *
60  * *
61  *****************************************************************************/
62 
63 
64 #include <stdlib.h>
65 #include <stdio.h>
66 #include <string.h>
67 #include <ctype.h>
68 
69 #include <osl/macros.h>
70 #include <osl/util.h>
71 #include <osl/strings.h>
72 #include <osl/body.h>
73 #include <osl/relation.h>
74 #include <osl/relation_list.h>
75 #include <osl/names.h>
76 #include <osl/interface.h>
77 #include <osl/generic.h>
78 #include <osl/statement.h>
79 
80 
81 /*+***************************************************************************
82  * Structure display functions *
83  *****************************************************************************/
84 
85 
96 void osl_statement_idump(FILE * file, osl_statement_p statement, int level) {
97  int j, first = 1, number = 1;
98 
99  // Go to the right level.
100  for (j = 0; j < level; j++)
101  fprintf(file, "|\t");
102 
103  if (statement != NULL)
104  fprintf(file, "+-- osl_statement_t (S%d)\n", number);
105  else
106  fprintf(file, "+-- NULL statement\n");
107 
108  while (statement != NULL) {
109  if (!first) {
110  // Go to the right level.
111  for (j = 0; j < level; j++)
112  fprintf(file, "|\t");
113  fprintf(file, "| osl_statement_t (S%d)\n", number);
114  }
115  else
116  first = 0;
117 
118  // A blank line.
119  for (j = 0; j <= level + 1; j++)
120  fprintf(file, "|\t");
121  fprintf(file, "\n");
122 
123  // Print the domain of the statement.
124  osl_relation_idump(file, statement->domain, level + 1);
125 
126  // Print the scattering of the statement.
127  osl_relation_idump(file, statement->scattering, level + 1);
128 
129  // Print the array access information of the statement.
130  osl_relation_list_idump(file, statement->access, level + 1);
131 
132  // Print the original body expression.
133  osl_generic_idump(file, statement->extension, level + 1);
134 
135  statement = statement->next;
136  number++;
137 
138  // Next line.
139  if (statement != NULL) {
140  for (j = 0; j <= level; j++)
141  fprintf(file, "|\t");
142  fprintf(file, "V\n");
143  }
144  }
145 
146  // The last line.
147  for (j = 0; j <= level; j++)
148  fprintf(file, "|\t");
149  fprintf(file, "\n");
150 }
151 
152 
160 void osl_statement_dump(FILE * file, osl_statement_p statement) {
161  osl_statement_idump(file, statement, 0);
162 }
163 
164 
172 static
174  int nb_parameters = OSL_UNDEFINED;
175  int nb_iterators = OSL_UNDEFINED;
176  int nb_scattdims = OSL_UNDEFINED;
177  int nb_localdims = OSL_UNDEFINED;
178  int array_id = OSL_UNDEFINED;
179 
180  osl_statement_get_attributes(statement, &nb_parameters, &nb_iterators,
181  &nb_scattdims, &nb_localdims, &array_id);
182 
183  return osl_names_generate("P", nb_parameters,
184  "i", nb_iterators,
185  "c", nb_scattdims,
186  "l", nb_localdims,
187  "A", array_id);
188 }
189 
190 
199 void osl_statement_pprint(FILE * file, osl_statement_p statement,
200  osl_names_p names) {
201  size_t nb_relations;
202  int number = 1;
203  int generated_names = 0;
204  int iterators_backedup = 0;
205  int nb_ext = 0;
206  osl_body_p body = NULL;
207  osl_strings_p iterators_backup = NULL;
208 
209  // Generate the dimension names if necessary and replace iterators with
210  // statement iterators if possible.
211  if (names == NULL) {
212  generated_names = 1;
213  names = osl_statement_names(statement);
214  }
215 
216  while (statement != NULL) {
217  // If possible, replace iterator names with statement iterator names.
219  if (body && body->iterators != NULL) {
220  iterators_backedup = 1;
221  iterators_backup = names->iterators;
222  names->iterators = body->iterators;
223  }
224 
225  nb_relations = 0;
226 
227  fprintf(file, "# =============================================== ");
228  fprintf(file, "Statement %d\n", number);
229 
230  fprintf(file, "# Number of relations describing the statement:\n");
231 
232  if (statement->domain != NULL)
233  nb_relations ++;
234  if (statement->scattering != NULL)
235  nb_relations ++;
236  nb_relations += osl_relation_list_count(statement->access);
237 
238  fprintf(file, "%lu\n\n", nb_relations);
239 
240  fprintf(file, "# ---------------------------------------------- ");
241  fprintf(file, "%2d.1 Domain\n", number);
242  osl_relation_pprint(file, statement->domain, names);
243  fprintf(file, "\n");
244 
245  fprintf(file, "# ---------------------------------------------- ");
246  fprintf(file, "%2d.2 Scattering\n", number);
247  osl_relation_pprint(file, statement->scattering, names);
248  fprintf(file, "\n");
249 
250  fprintf(file, "# ---------------------------------------------- ");
251  fprintf(file, "%2d.3 Access\n", number);
252  osl_relation_list_pprint_elts(file, statement->access, names);
253  fprintf(file, "\n");
254 
255  fprintf(file, "# ---------------------------------------------- ");
256  fprintf(file, "%2d.4 Statement Extensions\n", number);
257  fprintf(file, "# Number of Statement Extensions\n");
258  nb_ext = osl_generic_number(statement->extension);
259  fprintf(file, "%d\n", nb_ext);
260  if(nb_ext>0)
261  osl_generic_print(file, statement->extension);
262 
263  fprintf(file, "\n");
264 
265  // If necessary, switch back iterator names.
266  if (iterators_backedup) {
267  iterators_backedup = 0;
268  names->iterators = iterators_backup;
269  }
270 
271  statement = statement->next;
272  number++;
273  }
274 
275  if (generated_names)
276  osl_names_free(names);
277 }
278 
279 
288 void osl_statement_pprint_scoplib(FILE * file, osl_statement_p statement,
289  osl_names_p names) {
290  int number = 1;
291  int generated_names = 0;
292  int iterators_backedup = 0;
293  osl_body_p body = NULL;
294  osl_strings_p iterators_backup = NULL;
295  int add_fakeiter;
296 
297  // Generate the dimension names if necessary and replace iterators with
298  // statement iterators if possible.
299  if (names == NULL) {
300  generated_names = 1;
301  names = osl_statement_names(statement);
302  }
303 
304  while (statement != NULL) {
305  // If possible, replace iterator names with statement iterator names.
307  if (body && body->iterators != NULL) {
308  iterators_backedup = 1;
309  iterators_backup = names->iterators;
310  names->iterators = body->iterators;
311  }
312 
313  add_fakeiter = statement->domain->nb_rows == 0 &&
314  statement->scattering->nb_rows == 1;
315 
316  fprintf(file, "# =============================================== ");
317  fprintf(file, "Statement %d\n", number);
318 
319  fprintf(file, "# ---------------------------------------------- ");
320  fprintf(file, "%2d.1 Domain\n", number);
321  fprintf(file, "# Iteration domain\n");
322  osl_relation_pprint_scoplib(file, statement->domain, names, 1, add_fakeiter);
323  fprintf(file, "\n");
324 
325  fprintf(file, "# ---------------------------------------------- ");
326  fprintf(file, "%2d.2 Scattering\n", number);
327  fprintf(file,"# Scattering function is provided\n1\n");
328  osl_relation_pprint_scoplib(file, statement->scattering, names, 0,
329  add_fakeiter);
330  fprintf(file, "\n");
331 
332  fprintf(file, "# ---------------------------------------------- ");
333  fprintf(file, "%2d.3 Access\n", number);
334  fprintf(file,"# Access informations are provided\n1\n");
335 
337  names, add_fakeiter);
338  fprintf(file, "\n");
339 
340  fprintf(file, "# ---------------------------------------------- ");
341  fprintf(file, "%2d.4 Body\n", number);
342  if (body != NULL) {
343  fprintf(file, "# Statement body is provided\n1\n");
344  osl_body_print_scoplib(file, body);
345  body = NULL; //re-initialize for next statement
346  }
347  else {
348  fprintf(file, "# Statement body is not provided\n0\n");
349  }
350 
351  fprintf(file, "\n");
352 
353  // If necessary, switch back iterator names.
354  if (iterators_backedup) {
355  iterators_backedup = 0;
356  names->iterators = iterators_backup;
357  }
358 
359  statement = statement->next;
360  number++;
361  }
362 
363  if (generated_names)
364  osl_names_free(names);
365 }
366 
367 
375 void osl_statement_print(FILE * file, osl_statement_p statement) {
376 
377  osl_statement_pprint(file, statement, NULL);
378 }
379 
380 
381 /*****************************************************************************
382  * Reading function *
383  *****************************************************************************/
384 
385 
395 static
397  osl_relation_list_p domain_list;
398  osl_relation_list_p scattering_list;
399  size_t nb_domains, nb_scattering, nb_accesses;
400 
401  // Domain.
402  domain_list = osl_relation_list_filter(list, OSL_TYPE_DOMAIN);
403  nb_domains = osl_relation_list_count(domain_list);
404  if (nb_domains > 1)
405  OSL_error("more than one domain for a statement");
406 
407  if (domain_list != NULL) {
408  stmt->domain = domain_list->elt;
409  domain_list->elt = NULL;
410  osl_relation_list_free(domain_list);
411  }
412  else {
413  stmt->domain = NULL;
414  }
415 
416  // Scattering.
417  scattering_list=osl_relation_list_filter(list,OSL_TYPE_SCATTERING);
418  nb_scattering = osl_relation_list_count(scattering_list);
419  if (nb_scattering > 1)
420  OSL_error("more than one scattering relation for a statement");
421 
422  if (scattering_list != NULL) {
423  stmt->scattering = scattering_list->elt;
424  scattering_list->elt = NULL;
425  osl_relation_list_free(scattering_list);
426  }
427  else {
428  stmt->scattering = NULL;
429  }
430 
431  // Access.
433  nb_accesses = osl_relation_list_count(stmt->access);
434 
435  if ((nb_domains + nb_scattering + nb_accesses) !=
436  (osl_relation_list_count(list)))
437  OSL_error("unexpected relation type to define a statement");
438 
440 }
441 
442 
453  int precision) {
455  osl_relation_list_p list;
456  osl_generic_p new = NULL;
457  int i, nb_ext = 0;
458 
459  if (file) {
460  // Read all statement relations.
461  list = osl_relation_list_pread(file, precision);
462 
463  // Store relations at the right place according to their type.
464  osl_statement_dispatch(stmt, list);
465 
466  // Read the Extensions
467  nb_ext = osl_util_read_int(file, NULL);
468  for (i=0; i<nb_ext; i++) {
469  new = osl_generic_read_one(file, registry);
470  osl_generic_add(&stmt->extension, new);
471  }
472  }
473 
474  return stmt;
475 }
476 
477 
487  int precision = osl_util_get_precision();
489  osl_statement_p statement = osl_statement_pread(foo, registry, precision);
490 
491  osl_interface_free(registry);
492  return statement;
493 }
494 
495 
496 /*+***************************************************************************
497  * Memory allocation/deallocation functions *
498  *****************************************************************************/
499 
500 
509  osl_statement_p statement;
510 
511  OSL_malloc(statement, osl_statement_p, sizeof(osl_statement_t));
512  statement->domain = NULL;
513  statement->scattering = NULL;
514  statement->access = NULL;
515  statement->extension = NULL;
516  statement->next = NULL;
517 
518  return statement;
519 }
520 
521 
529  osl_statement_p next;
530 
531  while (statement != NULL) {
532  next = statement->next;
533  osl_relation_free(statement->domain);
534  osl_relation_free(statement->scattering);
535  osl_relation_list_free(statement->access);
536  osl_generic_free(statement->extension);
537 
538  free(statement);
539  statement = next;
540  }
541 }
542 
543 
544 /*+***************************************************************************
545  * Processing functions *
546  *****************************************************************************/
547 
548 
557  osl_statement_p statement) {
558  while (*location != NULL)
559  location = &((*location)->next);
560 
561  *location = statement;
562 }
563 
564 
573  int number = 0;
574 
575  while (statement != NULL) {
576  number++;
577  statement = statement->next;
578  }
579  return number;
580 }
581 
582 
592  int first = 1, i = 0;
593  osl_statement_p clone = NULL, node, previous = NULL;
594 
595  while ((statement != NULL) && ((n == -1) || (i < n))) {
596  node = osl_statement_malloc();
597  node->domain = osl_relation_clone(statement->domain);
598  node->scattering = osl_relation_clone(statement->scattering);
599  node->access = osl_relation_list_clone(statement->access);
600  node->extension = osl_generic_clone(statement->extension);
601  node->next = NULL;
602 
603  if (first) {
604  first = 0;
605  clone = node;
606  previous = node;
607  }
608  else {
609  previous->next = node;
610  previous = previous->next;
611  }
612 
613  i++;
614  statement = statement->next;
615  }
616 
617  return clone;
618 }
619 
620 
629  return osl_statement_nclone(statement, -1);
630 }
631 
634  if (relation == NULL)
635  return NULL;
636  return osl_relation_nclone(relation, 1);
637 }
638 
651  osl_relation_p domain, scattering;
652  osl_statement_p statement_ptr = NULL, result;
653  if (!statement)
654  return NULL;
655 
656  // Make at least one new statement, even if there are no relations.
657  domain = statement->domain;
658  result = NULL;
659  do {
660  scattering = statement->scattering;
661  do {
662  osl_statement_p new_statement = osl_statement_malloc();
663  new_statement->domain = osl_relation_clone_one_safe(domain);
664  new_statement->scattering = osl_relation_clone_one_safe(scattering);
665  new_statement->access = osl_relation_list_clone(statement->access);
666  new_statement->extension = osl_generic_clone(statement->extension);
667  if (!result) {
668  statement_ptr = new_statement;
669  result = new_statement;
670  } else {
671  statement_ptr->next = new_statement;
672  statement_ptr = statement_ptr->next;
673  }
674  if (scattering == NULL || scattering->next == NULL)
675  break;
676  scattering = scattering->next;
677  } while (1);
678  if (domain == NULL || domain->next == NULL)
679  break;
680  domain = domain->next;
681  } while (1);
682 
683  return result;
684 }
685 
686 
687 
697 
698  if (s1 == s2)
699  return 1;
700 
701  if (((s1->next != NULL) && (s2->next == NULL)) ||
702  ((s1->next == NULL) && (s2->next != NULL))) {
703  OSL_info("statements are not the same");
704  return 0;
705  }
706 
707  if ((s1->next != NULL) && (s2->next != NULL)) {
708  if (!osl_statement_equal(s1->next, s2->next)) {
709  OSL_info("number of statements is not the same");
710  return 0;
711  }
712  }
713 
714  if (!osl_relation_equal(s1->domain, s2->domain)) {
715  OSL_info("statement domains are not the same");
716  return 0;
717  }
718 
719  if (!osl_relation_equal(s1->scattering, s2->scattering)) {
720  OSL_info("statement scatterings are not the same");
721  return 0;
722  }
723 
724  if (!osl_relation_list_equal(s1->access, s2->access)) {
725  OSL_info("statement accesses are not the same");
726  return 0;
727  }
728 
729  if (!osl_generic_equal(s1->extension, s2->extension)) {
730  OSL_info("statement bodies are not the same");
731  return 0;
732  }
733 
734  return 1;
735 }
736 
737 
749  int expected_nb_parameters) {
750  int expected_nb_iterators;
751  osl_body_p body = NULL;
752 
753  while (statement != NULL) {
754  // Check the domain.
755  if (!osl_relation_integrity_check(statement->domain,
758  0,
759  expected_nb_parameters)) {
760  return 0;
761  }
762 
763  // Get the number of iterators.
764  if (statement->domain != NULL)
765  expected_nb_iterators = statement->domain->nb_output_dims;
766  else
767  expected_nb_iterators = OSL_UNDEFINED;
768 
769  // Check the scattering relation.
773  expected_nb_iterators,
774  expected_nb_parameters)) {
775  return 0;
776  }
777 
778  // Check the access relations.
782  expected_nb_iterators,
783  expected_nb_parameters)) {
784  return 0;
785  }
786 
787  // Check the statement body.
789  if ((expected_nb_iterators != OSL_UNDEFINED) &&
790  body && body->iterators != NULL &&
791  ((size_t)expected_nb_iterators != osl_strings_size(body->iterators))) {
792  OSL_warning("unexpected number of original iterators");
793  return 0;
794  }
795 
796  statement = statement->next;
797  }
798 
799  return 1;
800 }
801 
802 
811 
812  if (statement->domain == NULL) {
813  OSL_warning("no statement domain, assuming 0 iterators");
814  return 0;
815  }
816  else {
817  return statement->domain->nb_output_dims;
818  }
819 }
820 
821 
841  int * nb_parameters,
842  int * nb_iterators,
843  int * nb_scattdims,
844  int * nb_localdims,
845  int * array_id) {
846  int local_nb_parameters = OSL_UNDEFINED;
847  int local_nb_iterators = OSL_UNDEFINED;
848  int local_nb_scattdims = OSL_UNDEFINED;
849  int local_nb_localdims = OSL_UNDEFINED;
850  int local_array_id = OSL_UNDEFINED;
851 
852  while (statement != NULL) {
854  &local_nb_parameters,
855  &local_nb_iterators,
856  &local_nb_scattdims,
857  &local_nb_localdims,
858  &local_array_id);
859 
861  &local_nb_parameters,
862  &local_nb_iterators,
863  &local_nb_scattdims,
864  &local_nb_localdims,
865  &local_array_id);
866 
868  &local_nb_parameters,
869  &local_nb_iterators,
870  &local_nb_scattdims,
871  &local_nb_localdims,
872  &local_array_id);
873  // Update.
874  *nb_parameters = OSL_max(*nb_parameters, local_nb_parameters);
875  *nb_iterators = OSL_max(*nb_iterators, local_nb_iterators);
876  *nb_scattdims = OSL_max(*nb_scattdims, local_nb_scattdims);
877  *nb_localdims = OSL_max(*nb_localdims, local_nb_localdims);
878  *array_id = OSL_max(*array_id, local_array_id);
879  statement = statement->next;
880  }
881 }
882 
883 
891  osl_body_p body;
892  osl_extbody_p ebody;
893 
894  if (statement == NULL || statement->extension == NULL) {
895  return NULL;
896  }
897 
899  if (body != NULL)
900  return body;
901  ebody = (osl_extbody_p)osl_generic_lookup(statement->extension,
903  if (ebody != NULL)
904  return ebody->body;
905  return NULL;
906 }
void osl_relation_list_pprint_elts(FILE *file, osl_relation_list_p list, osl_names_p names)
#define OSL_error(msg)
Definition: macros.h:149
#define OSL_TYPE_DOMAIN
Definition: macros.h:101
#define OSL_warning(msg)
Definition: macros.h:144
osl_statement_p osl_statement_read(FILE *foo)
Definition: statement.c:486
int osl_util_read_int(FILE *file, char **str)
Definition: util.c:140
void * osl_generic_lookup(osl_generic_p x, char const *const URI)
Definition: generic.c:687
osl_generic_p osl_generic_read_one(FILE *file, osl_interface_p registry)
Definition: generic.c:309
struct osl_statement * next
Definition: statement.h:95
osl_names_p osl_names_generate(char *parameter_prefix, int nb_parameters, char *iterator_prefix, int nb_iterators, char *scatt_dim_prefix, int nb_scatt_dims, char *local_dim_prefix, int nb_local_dims, char *array_prefix, int nb_arrays)
Definition: names.c:206
int nb_output_dims
Definition: relation.h:109
int osl_statement_number(osl_statement_p statement)
Definition: statement.c:572
osl_relation_p scattering
Definition: statement.h:90
osl_statement_p osl_statement_pread(FILE *file, osl_interface_p registry, int precision)
Definition: statement.c:452
int osl_statement_equal(osl_statement_p s1, osl_statement_p s2)
Definition: statement.c:696
osl_statement_p osl_statement_clone(osl_statement_p statement)
Definition: statement.c:628
#define OSL_URI_BODY
Definition: body.h:76
void osl_statement_add(osl_statement_p *location, osl_statement_p statement)
Definition: statement.c:556
void osl_relation_list_get_attributes(osl_relation_list_p list, int *nb_parameters, int *nb_iterators, int *nb_scattdims, int *nb_localdims, int *array_id)
#define OSL_info(msg)
Definition: macros.h:139
static void osl_statement_dispatch(osl_statement_p stmt, osl_relation_list_p list)
Definition: statement.c:396
void osl_relation_free(osl_relation_p relation)
Definition: relation.c:1734
void osl_interface_free(osl_interface_p interface)
Definition: interface.c:237
void osl_relation_idump(FILE *file, osl_relation_p relation, int level)
Definition: relation.c:164
void osl_statement_print(FILE *file, osl_statement_p statement)
Definition: statement.c:375
osl_body_p body
Definition: extbody.h:86
void osl_body_print_scoplib(FILE *file, osl_body_p body)
Definition: body.c:170
void osl_statement_free(osl_statement_p statement)
Definition: statement.c:528
osl_generic_p osl_generic_clone(osl_generic_p generic)
Definition: generic.c:540
void osl_relation_pprint_scoplib(FILE *file, osl_relation_p relation, osl_names_p names, int print_nth_part, int add_fakeiter)
Definition: relation.c:1260
osl_relation_list_p access
Definition: statement.h:91
osl_relation_list_p osl_relation_list_filter(osl_relation_list_p list, int type)
void osl_relation_pprint(FILE *file, osl_relation_p relation, osl_names_p names)
Definition: relation.c:1242
int osl_statement_get_nb_iterators(osl_statement_p statement)
Definition: statement.c:810
void osl_statement_pprint_scoplib(FILE *file, osl_statement_p statement, osl_names_p names)
Definition: statement.c:288
void osl_relation_list_free(osl_relation_list_p list)
osl_statement_p osl_statement_malloc(void)
Definition: statement.c:508
static osl_relation_p osl_relation_clone_one_safe(osl_relation_p relation)
Clone first part of the union, return NULL if input is NULL.
Definition: statement.c:633
static osl_names_p osl_statement_names(osl_statement_p statement)
Definition: statement.c:173
int osl_generic_equal(osl_generic_p x1, osl_generic_p x2)
Definition: generic.c:610
osl_relation_p domain
Definition: statement.h:89
osl_strings_p iterators
Definition: body.h:86
osl_relation_p osl_relation_clone(osl_relation_p relation)
Definition: relation.c:1866
int osl_relation_equal(osl_relation_p r1, osl_relation_p r2)
Definition: relation.c:2438
osl_strings_p names
Definition: scatnames.h:88
Definition: body.h:85
void osl_statement_get_attributes(osl_statement_p statement, int *nb_parameters, int *nb_iterators, int *nb_scattdims, int *nb_localdims, int *array_id)
Definition: statement.c:840
osl_statement_p osl_statement_remove_unions(osl_statement_p statement)
Definition: statement.c:650
int osl_relation_integrity_check(osl_relation_p relation, int expected_type, int expected_nb_output_dims, int expected_nb_input_dims, int expected_nb_parameters)
Definition: relation.c:2543
osl_relation_list_p osl_relation_list_clone(osl_relation_list_p list)
void osl_relation_list_pprint_access_array_scoplib(FILE *file, osl_relation_list_p list, osl_names_p names, int add_fakeiter)
osl_generic_p extension
Definition: statement.h:92
osl_relation_p elt
Definition: relation_list.h:82
int osl_statement_integrity_check(osl_statement_p statement, int expected_nb_parameters)
Definition: statement.c:748
int osl_relation_list_equal(osl_relation_list_p l1, osl_relation_list_p l2)
osl_statement_p osl_statement_nclone(osl_statement_p statement, int n)
Definition: statement.c:591
struct osl_body * osl_body_p
Definition: body.h:90
void osl_names_free(osl_names_p names)
Definition: names.c:172
struct osl_extbody * osl_extbody_p
Definition: extbody.h:92
#define OSL_max(x, y)
Definition: macros.h:181
void osl_generic_idump(FILE *file, osl_generic_p generic, int level)
Definition: generic.c:89
int osl_generic_number(osl_generic_p generic)
Definition: generic.c:522
void osl_generic_print(FILE *file, osl_generic_p generic)
Definition: generic.c:196
void osl_statement_dump(FILE *file, osl_statement_p statement)
Definition: statement.c:160
void osl_generic_free(osl_generic_p generic)
Definition: generic.c:489
osl_strings_p iterators
Definition: names.h:83
size_t osl_strings_size(osl_const_strings_const_p strings)
Definition: strings.c:414
#define OSL_TYPE_ACCESS
Definition: macros.h:103
void osl_statement_pprint(FILE *file, osl_statement_p statement, osl_names_p names)
Definition: statement.c:199
int osl_relation_list_integrity_check(osl_relation_list_p list, int type, int expected_nb_output_dims, int expected_nb_input_dims, int expected_nb_parameters)
void osl_relation_get_attributes(osl_relation_p relation, int *nb_parameters, int *nb_iterators, int *nb_scattdims, int *nb_localdims, int *array_id)
Definition: relation.c:2856
#define OSL_URI_EXTBODY
Definition: extbody.h:78
osl_relation_list_p osl_relation_list_pread(FILE *file, int precision)
int osl_util_get_precision(void)
Definition: util.c:517
#define OSL_UNDEFINED
Definition: macros.h:93
void osl_relation_list_idump(FILE *file, osl_relation_list_p l, int level)
Definition: relation_list.c:89
osl_interface_p osl_interface_get_default_registry(void)
Definition: interface.c:386
osl_body_p osl_statement_get_body(osl_statement_p statement)
Definition: statement.c:890
void osl_statement_idump(FILE *file, osl_statement_p statement, int level)
Definition: statement.c:96
size_t osl_relation_list_count(osl_relation_list_p list)
void osl_generic_add(osl_generic_p *list, osl_generic_p generic)
Definition: generic.c:375
struct osl_relation * next
Definition: relation.h:117
osl_relation_p osl_relation_nclone(osl_relation_p relation, int n)
Definition: relation.c:1761
#define OSL_TYPE_SCATTERING
Definition: macros.h:102
#define OSL_malloc(ptr, type, size)
Definition: macros.h:157