a scalar depending on vdefs in the current region is not invariant
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Oct 2015 21:18:27 +0000 (21:18 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Oct 2015 21:18:27 +0000 (21:18 +0000)
commit13f421d5605ccac3dae6a07ddcf3bbddaf7f2209
treeedc739b54786c480775bcdd4ce45e801f6224ec9
parent84e9670514d751c49ea70db115f9d8ef8d2aa934
a scalar depending on vdefs in the current region is not invariant

When a scalar is defined in function of an array reference in the current scop,
it does variate.  Graphite cannot represent the condition in scop-11.c, as a[*]
variates in the current region, and it is not an affine condition:

  for (j = 0; j <= 20; j++)
    a[j] = b + i;

  if (a[12] == 23)
    b = 3;
  else
    b = 1;

  for (j = 0; j <= 20; j++)
    a[j] = b + i;

* graphite-scop-detection.c (parameter_index_in_region): Update call to
invariant_in_sese_p_rec.
* graphite-sese-to-poly.c (extract_affine): Same.
* sese.c (invariant_in_sese_p_rec): Pass in an extra parameter has_vdefs.
(scalar_evolution_in_region): Return chrec_dont_know when the scalar variable
depends on virtual definitions in the current region.
* sese.h (invariant_in_sese_p_rec): Update declaration.

testsuite/
* gcc.dg/graphite/scop-11.c: Update pattern.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229151 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/graphite-scop-detection.c
gcc/graphite-sese-to-poly.c
gcc/sese.c
gcc/sese.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/scop-11.c