llvm / llvm/llvm-project

[flang] Improve variable DSA determination for OpenMP constructs

Open
#191,249 1 comment 0 reactions 1 assignee Claimed by @kparzysz View on GitHub
flang:openmp
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The code in question is the OpenMP part of `flang/lib/Semantics/resolve-directives.cpp`.

The current code has become overly convoluted over the years, and it's increasingly difficult to implement fixes without causing regressions.

The plan:
1. First, simplify the existing code. There are several things that the code does for which cleaner alternatives exist. These are mostly things related to the traversal and the analysis of loops and loop nests.
2. The complicated part is the handling of `parser::Name`. The "Post" function of the AST visitor does all the work, but it does so with limited context. A better alternative is to first collect variable references in the entire construct, then create the private symbols and rewrite the references. This would also make easier to reflect the differences in DSA rules between different versions of the OpenMP spec.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.