This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gomp] Support statically scheduled parallel loops


This patch adds support for generating statically scheduled
parallel loops and shared data clauses.

I'd like the FE folks to take a look at the c-parser.c changes.
Essentially, when we start parsing a directive, we get a bunch of
information at the start of the directive that we can only really
use once we are done parsing the body.  So:

	#pragma omp for shared (a), private (i)
	for (i = 0; i < N; i++)
	  a[i] = ...

I need to save the 'shared' and 'private' clauses somewhere so
that I can put them in the corresponding GOMP_* tree after I'm
done parsing the body.

Also, the directives may be nested.  So I created a stack where I
push the clauses and other tidbits I find at the header and pop
them when I'm about to create the GOMP_* tree.

The only type of parallel loop that we can generate code for is
statically scheduled loops.  The lowering process emits code that
partitions the iteration space into equally sized chunks and
computes the lower and upper bound for each thread to iterate
through.

I added a couple of new tests to libgomp as well.

Jan, I get random ICEs when compiling with -fno-unit-at-a-time.
I must be missing something basic in cgraph_add_new_function.
Would you mind taking a quick peek?  Thanks.

Attachment: 20050920-gomp-for-static.diff
Description: Text document

Attachment: 20050920-gomp-for-static.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]