This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Question about omp-low.c
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, "Jason Merrill (jason at redhat dot com)" <jason at redhat dot com>
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Wed, 18 Dec 2013 04:46:40 +0000
- Subject: Question about omp-low.c
- Authentication-results: sourceware.org; auth=none
Hello Jakub et al.,
I have a question regarding the parallel for implementation. I am implementing _Cilk_for based on the routines in omp-low.c and I would like to create a child function but would like to move the items that gimplify_omp_for inserts in for_pre_body in the top-level function. I need to do this because in _Cilk_for, we insert the body of the function into a child function and then we call a builtin CilkPlus function called __cilkrts_cilk_for_64 and pass in the child function's name, data pointer, loop-count and grain.
The loop count computation gets to be an issue in C++ when we use iterator.
For example, if we have something like this:
Vector <int> array;
For (vector<int>::iterator iter = array.begin(); iter != array.end (); iter++)
gimplify_omp_for function gimplifys the condition expression (array.end ()) and then inserts the following in pre_body....
iter = std::vector<int>::begin (&array);
D.28387 = std::vector<int>::end (&array);
try
{
retval.0 = __gnu_cxx::operator-<int*, std::vector<int> > (&D.28387, &iter);
}
finally
{
D.28387 = {CLOBBER};
}
..and moves it to the child function at a later stage (I believe in lower_omp_for). I want to make it *NOT* do that and keep it in the current function, since I want to use the retval.0. Can someone please suggest me how to do that?
Any help is greatly appreciated!
Sincerely,
Balaji V. Iyer.