Closed ichoyjx closed 4 years ago
Everything builds, tests, and looks good to me. I hesitate to approve since I don't really understand the changes.
Thanks Pete!!
Note that the latest commit added the second Walk
of OmpAttributeVisitor
if there is no error during the first Walk
, this resolves the issue a).
LGTM
This commit implements rule: A loop iteration variable for a sequential loop in a parallel or task generating construct is private in the innermost such construct that encloses the loop.
A Simple example:
The basic idea is when visiting the
DoConstruct
node within an OpenMP construct, if the do-loop is not associated (likei
loop is associated with!$omp do
) AND the do-loop is in the parallel/task generating construct, resolve the loop index to be private to that innermost construct.In the above example,
j
loop is not associated (then it is sequential) and the innermost parallel/task generating construct that encloses thej
loop is theparallel
construct marked with<== Scope 2
, soj
is private to that construct. To do that, I also need to change the prototype of thoseResolveOmp*
functions to allow specifiying thescope
because the new symbol forj
should be created in Scope 2 and all thesymbol
field ofName j
in thatparallel
construct should be fixed, such as c).