CLooG's GIT
Don't trash my code !!!
First commit : 0.14.0 version (with roadmap in doc instead of
test/reports and remove test/challenges/ludec.cloog because it's a
badly written input file).
Also warn about possibly incorrect code when options->l is zero
Replace pretty printer by generation of AST, followed by a scan of the AST.

This allows external users to perform their own pretty printing
or AST generation, without duplicating most of the code in pprint.c.
They simply need to first call

    root = cloog_clast_create(program->loop, equal, infos);

then scan the resulting struct clast_stmt and finally release the
clast_stmt:

    cloog_clast_free(root);

The clast tree structure is described in clast.h;
an example of scanning this structure can be found in pprint.c.
cloog_options_malloc: initialize name field
clast: finish support for blocks
new_clast_guard: fix typo
clast: export allocation and freeing
clast: make var attribute of clast_term const.
cloog_program_dump_cloog: include scattering names in set of iterator names.

Since cloog_program_dump_cloog is supposed to be called after
scattering, the first dimensions of the domains actually
correspond to the scattering dimensions, so they should be included
int the set of iterator names.
cloog_loop_merge: keep loops in original order if possible

cloog_loop_merge collects loops with intersecting domains.
Previously, it was possible for the order of the loops
within such a collection to be different from the original order.
Although this would only happen when the order is of no importance,
it could be confusing for a user to see that the statements are
generated in a different order for no apparent reason.

This patch keeps the loops within a collection
in the order of the list passed to cloog_loop_merge.
clast: export clast_expr_equal
clast.c: insert_equality: reduce coefficients in modulo guards.
remove generated file
cloog_loop_simplify: exploit all available information

In particular, pass all context constraints down to inner loops
and check integrality after adding the context constraints.
cloog_loop_merge: optionally compute simplified convex hulls.

This patch add a "sh" (simple hull) option that can simplify
some constraints at the expense of evaluating the constraints
more often.
Note that this simplification only applies to code generated
without code duplication.

For example,

bash-3.00$ cat union.cloog
c

1
0 2

0

2
1
4 4
1 1 0 0
1 -1 0 10
1 0 1 0
1 0 -1 10

0 0 0

1
4 4
1 1 0 -1
1 -1 0 11
1 0 1 -5
1 0 -1 15

0 0 0

0
0
0
bash-3.00$ ../obj_i686-pc-linux-gnu/cloog -f -1 -l 2 -override union.cloog
[CLooG]WARNING: you are using -override option, be aware that the generated
                code may be incorrect.
/* Generated from union.cloog by CLooG v0.14.0 gmp bits in 0.00s. */
/* CLooG asked for 68 KBytes. */
[CLooG]INFO: 0.00s and 68KB used for code generation.
for (i=0;i<=11;i++) {
  for (j=max(0,5*i-50);j<=min(15,5*i+10);j++) {
    if ((i <= 10) && (j <= 10)) {
      S1 ;
    }
    if ((i >= 1) && (j >= 5)) {
      S2 ;
    }
  }
}
bash-3.00$ ../obj_i686-pc-linux-gnu/cloog -sh 1 -f -1 -l 2 -override union.cloog
[CLooG]WARNING: you are using -override option, be aware that the generated
                code may be incorrect.
/* Generated from union.cloog by CLooG v0.14.0 gmp bits in 0.00s. */
/* CLooG asked for 76 KBytes. */
[CLooG]INFO: 0.00s and 76KB used for code generation.
for (i=0;i<=11;i++) {
  for (j=0;j<=15;j++) {
    if ((i <= 10) && (j <= 10)) {
      S1 ;
    }
    if ((i >= 1) && (j >= 5)) {
      S2 ;
    }
  }
}
Don't increment statement->number when printing.

The rationale behind this incrementing is apparently that the
first statement would be printed as S1 rather than S0.
However, this also means that a user of CLooG as a library will
see the statement numbers she provides incremented for no good reason.

This patch moves the incrementing to cloog_loop_read.
clast.c: insert_guard: create correct equality guards

If the domains contains an equality

    a i_1 + b i_2 = 0

the original code would generate the guard

    if (i_2 == -a * i_1 / b)

However, -a * i_1 may not be an integer multiple of b and
so for any given value of i_2, the test could evaluate to true
for more than one value of i_1.
This happens in particular if the domain is part of
(the convex hull of a union of) a set of domains.
This patch generates the guard

    if (b * i_2 == -a * i_1)

instead, which should be safe.
cloog_matrix_normalize: don't "normalize" the constant term
Move language field from clooginfos to cloogoptions.

This makes pprint independent of clooginfos, so we can internalize
the latter in clast.c.