public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65458] New: parloops transforms omp-generated functions
@ 2015-03-18  7:45 vries at gcc dot gnu.org
  2015-03-18 11:28 ` [Bug tree-optimization/65458] parloops transforms omp-thread functions rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vries at gcc dot gnu.org @ 2015-03-18  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65458
           Summary: parloops transforms omp-generated functions
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org

parloops parallelizes loops by:
- analyzing dependencies
- lowering the loop body
- annotating the loop with omp parallel and loop pragmas
- omp-expanding the loop into a seperate function
- replacing the loop with a call to a runtime function, which will run the
  split-off function in several threads.

Parloops has a mechanism to not process again functions that were created by
parloops (parallelized_function_p).

However, if a source file contains omp pragmas that cause loops to be
transformed and split off into seperate functions, there is nothing stopping
parloops from processing those functions again. The result is a thread function
that itself again creates threads.

Look for instance at:
...
gcc -fopenmp -O2 -std=c99 src/gcc/testsuite/gcc.dg/gomp/pr25990.c -S
-fdump-tree-all-all -ftree-parallelize-loops=2
...

We can see main._omp_fn.1._loopfn.0 in this list:
...
$ grep Function pr25990.c.123t.parloops 
;; Function main._omp_fn.0 (main._omp_fn.0, funcdef_no=1, decl_uid=2010,
cgraph_uid=1, symbol_order=1)
;; Function main._omp_fn.1 (main._omp_fn.1, funcdef_no=2, decl_uid=2047,
cgraph_uid=2, symbol_order=2)
;; Function main (main, funcdef_no=0, decl_uid=1739, cgraph_uid=0,
symbol_order=0) (executed once)
;; Function main._omp_fn.1._loopfn.0 (main._omp_fn.1._loopfn.0, funcdef_no=3,
decl_uid=2397, cgraph_uid=14, symbol_order=14)
;; Function main._loopfn.1 (main._loopfn.1, funcdef_no=4, decl_uid=2512,
cgraph_uid=15, symbol_order=15)
...

I think we should handle functions splitt off by omp processing conservatively
in parloops.


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

end of thread, other threads:[~2015-03-21 22:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18  7:45 [Bug tree-optimization/65458] New: parloops transforms omp-generated functions vries at gcc dot gnu.org
2015-03-18 11:28 ` [Bug tree-optimization/65458] parloops transforms omp-thread functions rguenth at gcc dot gnu.org
2015-03-19  7:27 ` vries at gcc dot gnu.org
2015-03-21 12:55 ` vries at gcc dot gnu.org
2015-03-21 13:02 ` vries at gcc dot gnu.org
2015-03-22  8:53 ` 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).