This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GSoC] generation of GCC expression trees from isl ast expressions


Hi Tobias,

could you please advise me how to verify the results of gimple code
generation? I've written the first draft of the generation of loops
with empty bodies and tried to verify gimple code using the
representation, which is dumped at the end of the generation of the
dump_file. If we consider the following example, we'll see that cloog
and isl code generator generate similar representation (representation
generated by isl code generator doesn't have body of the loop, as was
expected).

int
main (int n, int *a)
{
  int i;

  for (i = 0; i < 100; i++)
    a[i] = i;

 return 0;
}

gcc/graphite-isl-ast-to-gimple.c

loop_0 (header = 0, latch = 1, niter = )
{
  bb_2 (preds = {bb_0 }, succs = {bb_3 })
  {
    <bb 2>:

  }
  bb_5 (preds = {bb_3 }, succs = {bb_1 })
  {
    <bb 5>:
    # .MEM_10 = PHI <.MEM_3(D)(3)>
    # VUSE <.MEM_10>
    return 0;

  }
  loop_2 (header = 3, latch = 4, niter = )
  {
    bb_3 (preds = {bb_2 bb_4 }, succs = {bb_4 bb_5 })
    {
      <bb 3>:
      # graphite_IV.3_1 = PHI <0(2), graphite_IV.3_14(4)>
      graphite_IV.3_14 = graphite_IV.3_1 + 1;
      if (graphite_IV.3_1 < 99)
        goto <bb 4>;
      else
        goto <bb 5>;

    }
    bb_4 (preds = {bb_3 }, succs = {bb_3 })
    {
      <bb 4>:
      goto <bb 3>;

    }
  }
}

graphite-clast-to-gimple.c

loop_0 (header = 0, latch = 1, niter = )
{
  bb_2 (preds = {bb_0 }, succs = {bb_3 })
  {
    <bb 2>:

  }
  bb_5 (preds = {bb_3 }, succs = {bb_1 })
  {
    <bb 5>:
    # .MEM_18 = PHI <.MEM_11(3)>
    # VUSE <.MEM_18>
    return 0;

  }
  loop_2 (header = 3, latch = 4, niter = )
  {
    bb_3 (preds = {bb_2 bb_4 }, succs = {bb_4 bb_5 })
    {
      <bb 3>:
      # graphite_IV.3_1 = PHI <0(2), graphite_IV.3_14(4)>
      # .MEM_19 = PHI <.MEM_3(D)(2), .MEM_11(4)>
      _2 = (sizetype) graphite_IV.3_1;
      _15 = _2 * 4;
      _16 = a_6(D) + _15;
      _17 = (int) graphite_IV.3_1;
      # .MEM_11 = VDEF <.MEM_19>
      *_16 = _17;
      graphite_IV.3_14 = graphite_IV.3_1 + 1;
      if (graphite_IV.3_1 < 99)
        goto <bb 4>;
      else
        goto <bb 5>;

    }
    bb_4 (preds = {bb_3 }, succs = {bb_3 })
    {
      <bb 4>:
      goto <bb 3>;

    }
  }
}

However, this form doesn't have loop guards which are generated by
graphite_create_new_loop_guard in gcc/graphite-isl-ast-to-gimple.c and
by graphite_create_new_loop_guard in graphite-clast-to-gimple.c.

Below is the code of this generation (It still uses isl_int for
generation of isl_expr_int, because the error related to isl/val_gmp.h
still arises. I've tried to use isl 0.12.2 and 0.13, but gotten the
same error).

--
                                   Cheers, Roman Gareev

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]