aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorLeandro Lupori <leandro.lupori@linaro.org>2024-06-06 10:32:42 +0200
committerGitHub <noreply@github.com>2024-06-06 10:32:42 +0200
commit6c9bce88a876f48eb8ab4df172bb86375b29a87f (patch)
tree21898e3e557820f26a42547ba0bcceb23d49c8a8 /clang/lib/Interpreter/Interpreter.cpp
parentc2e62c745996cbd4e19ac1ffcafc849960377b57 (diff)
downloadllvm-6c9bce88a876f48eb8ab4df172bb86375b29a87f.zip
llvm-6c9bce88a876f48eb8ab4df172bb86375b29a87f.tar.gz
llvm-6c9bce88a876f48eb8ab4df172bb86375b29a87f.tar.bz2
[flang][OpenMP] Fix privatization when critical is present (#94441)
When a critical construct is present inside another construct where privatizations may occur, such as a parallel construct, some privatizations are skipped if the corresponding symbols are defined inside the critical section only (see the example below). This happens because, while critical constructs have a "body", they don't have a separate scope (which makes sense, since no privatizations can occur in them). Because of this, in semantics phase, it's not possible to insert a new host association symbol, but instead the symbol from the enclosing context is used directly. This makes symbol collection in DataSharingProcessor consider the new symbol to be defined by the critical construct, instead of by the enclosing one, which causes the privatization to be skipped. Example: ``` !$omp parallel default(firstprivate) !$omp critical i = 200 !$omp end critical !$omp end parallel ``` This patch fixes this by identifying constructs where privatizations may not happen and skipping them during the collection of nested symbols. Currently, this seems to happen only with critical constructs, but others can be easily added to the skip list, if needed. Fixes https://github.com/llvm/llvm-project/issues/75767
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
0 files changed, 0 insertions, 0 deletions