[Bug tree-optimization/90269] loop distribution defeated by clobbers

2019-05-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269

Marc Glisse  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |10.0

--- Comment #5 from Marc Glisse  ---
.

[Bug tree-optimization/90269] loop distribution defeated by clobbers

2019-05-03 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269

--- Comment #4 from Marc Glisse  ---
Author: glisse
Date: Fri May  3 13:41:36 2019
New Revision: 270852

URL: https://gcc.gnu.org/viewcvs?rev=270852=gcc=rev
Log:
Let ldist ignore clobbers

2019-05-03  Marc Glisse  

PR tree-optimization/90269
gcc/
* tree-loop-distribution.c (find_seed_stmts_for_distribution):
Ignore clobbers.

gcc/testsuite/
* g++.dg/tree-ssa/ldist-1.C: New file.

Added:
trunk/gcc/testsuite/g++.dg/tree-ssa/ldist-1.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-loop-distribution.c

[Bug tree-optimization/90269] loop distribution defeated by clobbers

2019-04-28 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269

--- Comment #3 from Marc Glisse  ---
(In reply to Richard Biener from comment #2)
> Otherwise the patch looks sensible, mind to test/post it?

It bootstrapped and regtested fine, I'll send it later.

[Bug tree-optimization/90269] loop distribution defeated by clobbers

2019-04-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-04-28
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
I think gimple_has_side_effects shouldn't return true for clobbers (and/or
maybe we shouldn't set gimple_has_volatile_ops on them).

Otherwise the patch looks sensible, mind to test/post it?

[Bug tree-optimization/90269] loop distribution defeated by clobbers

2019-04-27 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90269

--- Comment #1 from Marc Glisse  ---
--- tree-loop-distribution.c(revision 270624)
+++ tree-loop-distribution.c(working copy)
@@ -3033,20 +3033,23 @@ find_seed_stmts_for_distribution (struct
 the loop.  */
  if (!stmt_has_scalar_dependences_outside_loop (loop, phi))
continue;
  work_list->safe_push (phi);
}
   for (gimple_stmt_iterator gsi = gsi_start_bb (bbs[i]);
   !gsi_end_p (gsi); gsi_next ())
{
  gimple *stmt = gsi_stmt (gsi);

+ if (gimple_clobber_p (stmt))
+   continue;
+
  /* If there is a stmt with side-effects bail out - we
 cannot and should not distribute this loop.  */
  if (gimple_has_side_effects (stmt))
{
  free (bbs);
  return false;
}

  /* Distribute stmts which have defs that are used outside of
 the loop.  */

works for this testcase, but that may be too crude (?).