xref: /netbsd-src/external/mit/isl/dist/flow.c (revision 5971e316fdea024efff6be8f03536623db06833e)
1*5971e316Smrg /*
2*5971e316Smrg  * Copyright 2017      Sven Verdoolaege
3*5971e316Smrg  *
4*5971e316Smrg  * Use of this software is governed by the MIT license
5*5971e316Smrg  *
6*5971e316Smrg  * Written by Sven Verdoolaege.
7*5971e316Smrg  */
8*5971e316Smrg 
9*5971e316Smrg /* This program takes an isl_union_access_info object as input and
10*5971e316Smrg  * prints the corresponding dependences.
11*5971e316Smrg  */
12*5971e316Smrg 
13*5971e316Smrg #include <isl/options.h>
14*5971e316Smrg #include <isl/printer.h>
15*5971e316Smrg #include <isl/union_map.h>
16*5971e316Smrg #include <isl/flow.h>
17*5971e316Smrg #include <isl/schedule.h>
18*5971e316Smrg 
main(int argc,char ** argv)19*5971e316Smrg int main(int argc, char **argv)
20*5971e316Smrg {
21*5971e316Smrg 	isl_ctx *ctx;
22*5971e316Smrg 	isl_printer *p;
23*5971e316Smrg 	isl_union_access_info *access;
24*5971e316Smrg 	isl_union_flow *flow;
25*5971e316Smrg 	struct isl_options *options;
26*5971e316Smrg 
27*5971e316Smrg 	options = isl_options_new_with_defaults();
28*5971e316Smrg 	argc = isl_options_parse(options, argc, argv, ISL_ARG_ALL);
29*5971e316Smrg 	ctx = isl_ctx_alloc_with_options(&isl_options_args, options);
30*5971e316Smrg 
31*5971e316Smrg 	access = isl_union_access_info_read_from_file(ctx, stdin);
32*5971e316Smrg 	flow = isl_union_access_info_compute_flow(access);
33*5971e316Smrg 
34*5971e316Smrg 	p = isl_printer_to_file(ctx, stdout);
35*5971e316Smrg 	p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_BLOCK);
36*5971e316Smrg 	p = isl_printer_print_union_flow(p, flow);
37*5971e316Smrg 	isl_printer_free(p);
38*5971e316Smrg 
39*5971e316Smrg 	isl_union_flow_free(flow);
40*5971e316Smrg 
41*5971e316Smrg 	isl_ctx_free(ctx);
42*5971e316Smrg 
43*5971e316Smrg 	return 0;
44*5971e316Smrg }
45