This is the mail archive of the gcc-patches@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 Gimple code from isl_ast_node_user


> I see. Could you use vec_safe_grow_cleared(iv_map, loop_num) instead?
> This shows probably better that you zero initialize the vector.

If I am not mistaken, vec_safe_grow_cleared has the following declaration:

vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len CXX_MEM_STAT_INFO)

Should we rewrite all the functions, which interact with iv_map?

I've added test cases, which produce the following ISL code:

isl-ast-gen-single-loop-1.c

for (int c1 = 0; c1 <= 49; c1 += 1)
  S_3(c1);

isl-ast-gen-single-loop-2.c
for (int c1 = 0; c1 <= -n.0 + 69; c1 += 1)
  S_5(c1);

isl-ast-gen-single-loop-3.c
for (int c1 = 0; c1 < n.0; c1 += 1)
  S_5(c1);

The second and the third one use arrays. I wanted to make them similar
to the first one, but inability to handle blocks prevented this. For
example,

/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity -fgraphite-code-generator=isl" } */

int n = 25;

int
foo ()
{
  int i, res;

  for (i = n, res = 0; i < 50; i++)
      res += i;

  return res;
}

extern void abort ();

int
main (void)
{
  int res = foo ();

  if (res != 1225)
    abort ();

  return 0;
}

produces the following code:

{
  S_6();
  for (int c1 = 0; c1 <= -i + 49; c1 += 1)
    S_4(c1);
}

Attachment: ChangeLog_entry.txt
Description: Text document

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]