public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
@ 2015-06-12 14:47 vries at gcc dot gnu.org
  2015-06-12 14:55 ` [Bug tree-optimization/66522] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-06-12 14:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

            Bug ID: 66522
           Summary: handle casts in nr of iterations in
                    try_transform_to_exit_first_loop_alt
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

There's a todo in try_transform_to_exit_first_loop_alt:
...
      /* There is a number of test-cases for which we don't get an alt_bound
         here: they're listed here, with the lhs of the last stmt as the nit:
         libgomp.graphite/force-parallel-1.c:
         _21 = (signed long) N_6(D);
         _19 = _21 + -1;
         _7 = (unsigned long) _19;
         libgomp.graphite/force-parallel-2.c:
         _33 = (signed long) N_9(D);
         _16 = _33 + -1;
         _37 = (unsigned long) _16;
         libgomp.graphite/force-parallel-5.c:
         <bb 6>:
         # graphite_IV.5_46 = PHI <0(5), graphite_IV.5_47(11)>
         <bb 7>:
         _33 = (unsigned long) graphite_IV.5_46;
         g++.dg/tree-ssa/pr34355.C:
         _2 = (unsigned int) i_9;
         _3 = 4 - _2;
         gcc.dg/pr53849.c:
         _5 = d.0_11 + -2;
         _18 = (unsigned int) _5;
         We will be able to handle some of these cases, if we can determine
when
         it's safe to look past casts.  */
...

I'm running into this todo for a trivial fortran test-case
gcc/testsuite/gfortran.dg/parloops-exit-first-loop-alt.f95:
...
! { dg-additional-options "-O2" }
! { dg-require-effective-target pthread }
! { dg-additional-options "-ftree-parallelize-loops=2" }
! { dg-additional-options "-fdump-tree-parloops" }

! Variable bound, vector addition.

subroutine foo(nr)
  integer, intent(in)       :: nr
  integer, parameter         :: n = 1000
  integer, dimension (0:n-1) :: a, b, c
  common a, b, c
  integer                    :: ii

  do ii = 0, nr - 1
     c(ii) = a(ii) + b(ii) + 25
  end do
end subroutine foo

! Three times 'plus 25'
! - one in f._loopfn.0
! - one in the parallel
! - one in the low iteration count loop
! Crucially, none for a peeled off last iteration following the parallel.
! { dg-final { scan-tree-dump-times "(?n) \\+ 25;" 3 "parloops" } }
...

The scan-tree-dump-times currently fails, so
try_transform_to_exit_first_loop_alt is failing.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
@ 2015-06-12 14:55 ` vries at gcc dot gnu.org
  2015-06-13 14:25 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-06-12 14:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

--- Comment #1 from vries at gcc dot gnu.org ---
Created attachment 35772
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35772&action=edit
tentative patch


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
  2015-06-12 14:55 ` [Bug tree-optimization/66522] " vries at gcc dot gnu.org
@ 2015-06-13 14:25 ` vries at gcc dot gnu.org
  2015-06-30 11:40 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-06-13 14:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization, patch

--- Comment #2 from vries at gcc dot gnu.org ---
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00965.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
  2015-06-12 14:55 ` [Bug tree-optimization/66522] " vries at gcc dot gnu.org
  2015-06-13 14:25 ` vries at gcc dot gnu.org
@ 2015-06-30 11:40 ` vries at gcc dot gnu.org
  2015-07-09 11:57 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-06-30 11:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

--- Comment #3 from vries at gcc dot gnu.org ---
(In reply to vries from comment #2)
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00965.html

Unproposing patch, as discussed here:
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02086.html

New patch: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02085.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-06-30 11:40 ` vries at gcc dot gnu.org
@ 2015-07-09 11:57 ` vries at gcc dot gnu.org
  2015-07-10  8:28 ` vries at gcc dot gnu.org
  2015-07-10  8:29 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-09 11:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

--- Comment #4 from vries at gcc dot gnu.org ---
(In reply to vries from comment #3)
> New patch: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg02085.html

Pinged: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00729.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-07-09 11:57 ` vries at gcc dot gnu.org
@ 2015-07-10  8:28 ` vries at gcc dot gnu.org
  2015-07-10  8:29 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-10  8:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

--- Comment #5 from vries at gcc dot gnu.org ---
https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00440.html:

Author: vries
Date: Fri Jul 10 08:25:18 2015
New Revision: 225655

URL: https://gcc.gnu.org/viewcvs?rev=225655&root=gcc&view=rev
Log:
Insert new bound in try_transform_to_exit_first_loop_alt

2015-07-10  Tom de Vries  <tom@codesourcery.com>

        * tree-parloops.c (try_transform_to_exit_first_loop_alt): If not found,
        insert nit + 1 bound.

        * testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: New 
        test.
        * testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: New test.

        * gfortran.dg/parloops-exit-first-loop-alt-2.f95: New test.
        * gfortran.dg/parloops-exit-first-loop-alt.f95: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/parloops-exit-first-loop-alt-2.f95
    trunk/gcc/testsuite/gfortran.dg/parloops-exit-first-loop-alt.f95
    trunk/libgomp/testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95
    trunk/libgomp/testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-parloops.c
    trunk/libgomp/ChangeLog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/66522] handle casts in nr of iterations in try_transform_to_exit_first_loop_alt
  2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-07-10  8:28 ` vries at gcc dot gnu.org
@ 2015-07-10  8:29 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2015-07-10  8:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66522

vries at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |vries at gcc dot gnu.org

--- Comment #6 from vries at gcc dot gnu.org ---
patch with test-case committed, resolving marked-fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-07-10  8:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-12 14:47 [Bug tree-optimization/66522] New: handle casts in nr of iterations in try_transform_to_exit_first_loop_alt vries at gcc dot gnu.org
2015-06-12 14:55 ` [Bug tree-optimization/66522] " vries at gcc dot gnu.org
2015-06-13 14:25 ` vries at gcc dot gnu.org
2015-06-30 11:40 ` vries at gcc dot gnu.org
2015-07-09 11:57 ` vries at gcc dot gnu.org
2015-07-10  8:28 ` vries at gcc dot gnu.org
2015-07-10  8:29 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).