[Openmp-dev] LLVM microtask fork for parallel
Alexandre Eichenberger
alexe at us.ibm.com
Thu Jun 12 08:29:00 PDT 2014
Hi guys,
I saw that you changed the "parallel" handling of the microtask to passing
a pointer to an array of shared variables, which I believe will result in
faster performance.
I noticed that the argc in the __kmpc_fork_call is always 2, but it passes
only 1 additional parameter in the elipsis "...". Is that on purpose?
See the example below
int main()
{
int d, e;
float f;
#pragma omp parallel num_threads(4) shared(d, e, f)
{
printf("hi from %d\n", omp_get_thread_num());
}
return 1;
}
and clang gen this
call void ({ i32, i32, i32, i32, i8* }*, i32, void (i32*,
i32*, ...)*, ...)* @__kmpc_fork_call(
{ i32, i32, i32, i32, i8* }* %.__kmpc_ident_t.2., // location
i32 2, // argc
void (i32*, i32*, ...)* bitcast (void (i32*, i32*, i8*)*
@.omp_microtask. to void (i32*, i32*, ...)*), // microtask
%struct.anon* %agg.captured) // first and only param in the ... list
It is not a problem, as we will pass a garbage value to the microtask,
which will not be used... but nevertheless, though you may want to know of
this
Alexandre
More information about the Openmp-dev
mailing list