]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p.
authorSebastian Pop <sebastian.pop@amd.com>
Wed, 11 Aug 2010 20:28:31 +0000 (20:28 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 11 Aug 2010 20:28:31 +0000 (20:28 +0000)
2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>

* graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
SSA scalar phi nodes that can be scev_analyzable_p.

* gfortran.dg/graphite/id-20.f: Adjust testcase.

From-SVN: r163148

gcc/ChangeLog
gcc/ChangeLog.graphite
gcc/graphite-sese-to-poly.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/graphite/id-20.f

index 70f82c00df84408b764697ebae07777337a7ffe6..1b6821160a3d65e5111cc8516749f9e64fa8cc87 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
+       SSA scalar phi nodes that can be scev_analyzable_p.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
        * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
index 27cacc03476550c7f980b2a49626dff2d23232a9..1ddd73111022f9b2d50fb66478cea24b2a688a0f 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of
+       SSA scalar phi nodes that can be scev_analyzable_p.
+
+       * gfortran.dg/graphite/id-20.f: Adjust testcase.
+
 2010-07-15  Sebastian Pop  <sebastian.pop@amd.com>
 
        * graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Correctly
index 0420285412844ec9f831975978f65d662d071ed9..7244ba9415c22faad82b9b867ee5452c079b5155 100644 (file)
@@ -165,8 +165,6 @@ static bool
 reduction_phi_p (sese region, gimple_stmt_iterator *psi)
 {
   loop_p loop;
-  tree scev;
-  affine_iv iv;
   gimple phi = gsi_stmt (*psi);
   tree res = gimple_phi_result (phi);
 
@@ -189,11 +187,11 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
       return false;
     }
 
-  /* Main induction variables with constant strides in LOOP are not
-     reductions.  */
-  if (simple_iv (loop, loop, res, &iv, true))
+  if (scev_analyzable_p (res, region))
     {
-      if (integer_zerop (iv.step))
+      tree scev = scalar_evolution_in_region (region, loop, res);
+
+      if (evolution_function_is_invariant_p (scev, loop->num))
        remove_invariant_phi (region, psi);
       else
        gsi_next (psi);
@@ -201,16 +199,6 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
       return false;
     }
 
-  scev = scalar_evolution_in_region (region, loop, res);
-  if (chrec_contains_undetermined (scev))
-    return true;
-
-  if (evolution_function_is_invariant_p (scev, loop->num))
-    {
-      remove_invariant_phi (region, psi);
-      return false;
-    }
-
   /* All the other cases are considered reductions.  */
   return true;
 }
index a20c841b06a97ce60cc0b4485086799c33a14b80..6de617e15e478feedc7990b88facf3554d456ad5 100644 (file)
@@ -1,3 +1,7 @@
+2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * gfortran.dg/graphite/id-20.f: Adjust testcase.
+
 2010-08-02  Sebastian Pop  <sebastian.pop@amd.com>
 
        * gcc.dg/graphite/pr42729.c: New.
index 110ae3ff4759ffa289f4f1b76986a6f751dea452..795cb1b9209f11e03d298d6fc49a905155fcea42 100644 (file)
@@ -1,4 +1,10 @@
-      DO 32 MB=1,NVIRA
-     *                     PVIRA(MA,MB)*(EA(MA+NOA)+EA(MB+NOA))*PT5
-   32 CONTINUE
+! { dg-options "-O3 -ffast-math" }
+
+      DIMENSION FPQR(25,25,25)
+      INTEGER P,Q,R
+            DO 130 R=1,N4MAX,2
+               IF(P.GT.1) THEN
+                  FPQR(P,Q,R)= RM2*FPQR(P,Q,R-2)*REC(P+Q+R-2)
+               END IF
+  130       RM2= RM2+TWO
       END