This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [graphite] Integrate loop distribution
- From: "Sebastian Pop" <sebpop at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Georges-André SILBER" <silber at cri dot ensmp dot fr>
- Date: Thu, 17 May 2007 15:45:21 +0200
- Subject: Re: [graphite] Integrate loop distribution
- References: <cb9d34b20705170623g82d5696xebcffb5d8db1ecee@mail.gmail.com>
Hi,
On 5/17/07, Sebastian Pop <sebpop@gmail.com> wrote:
Hi GAS,
I've just committed the following slight variation of your pass in the
graphite branch. I'm planning to work on the code gen part of the
pass and if possible submit it for inclusion for 4.3. Do you happen
to have the testcases on which you worked? If not I'll include some
other tests in the testsuite.
I've just added the following testcase that is not yet distributed.
Seb
Index: ldist-1.c
===================================================================
--- ldist-1.c (revision 0)
+++ ldist-1.c (revision 0)
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribution -fdump-tree-ldist-all" } */
+
+void foo (int * __restrict__ ia,
+ int * __restrict__ ib,
+ int * __restrict__ oxa,
+ int * __restrict__ oxb,
+ int * __restrict__ oya,
+ int * __restrict__ oyb)
+{
+ int i;
+ long int mya[52];
+ long int myb[52];
+
+ for (i=0; i < 52; i++)
+ {
+ mya[i] = ia[i] * oxa[i] + ib[i] * oxb[i];
+ myb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i];
+ oya[i] = mya[i] >> 10;
+ oyb[i] = myb[i] >> 10;
+ }
+
+ /* This loop should be distributed, and the result should look like
+ this:
+ | for (i=0; i < 52; i++)
+ | oya[i] = ia[i] * oxa[i] + ib[i] * oxb[i] >> 10;
+ |
+ | for (i=0; i < 52; i++)
+ | oyb[i] = -ia[i] * oxb[i] + ib[i] * oxa[i] >> 10;
+ */
+}
+
+/* { dg-final { scan-tree-dump-times "distributed" 1 "ldist" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "ldist" } } */