This patch is part of an RFC to add an abstract parallel IR interface
that allows us to analyze and optimize parallel codes in different
representations.
The relationship of the parts contained in this initial commit is shown
below. The attribute annotator transformation pass will query the
abstract parallel region and communication info interfaces to determine
if communicated values can be tagged as no-alias, no-capture, readnone,
or readonly. If so, this is done through the abstract ParallelIR/Builder
interface. Both the analyses parts, as well as the builder interface, is
implemented for the OpenMP KMPC runtime library call representation that
is used by clang.
Optimization Analysis/Transformation Implementation --------------------------------------------------------------------------- /---> ParallelRegionInfo (A) ---------|-> KMPCImpl (A) | | AttributeAnnotator --|---> ParallelCommunicationInfo (A) --/ | \---> ParallelIR/Builder (T) -----------> KMPCImpl (T)
In addition to the attribute annotator, we have four more parallel IR
specific optimizations that achieve high speedups for Rodinia OpenMP
benchmarks (see [0]). However, to keep this first commit simple, only
a simplified form of our attribute annotator was included.
[0] http://compilers.cs.uni-saarland.de/people/doerfert/par_opt18.pdf
I wonder if there's any value here in using the term 'Captured' instead of 'Communicated' here. This seems very similar to the concept of captured values in C++, and so using that term might be helpful.
In general, I wonder how much of this can be generalized to handle C++ lambdas.