[qt/clang/llvm-project]: Summary of bulk changes made

KDE Git Services - Bulk Change <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git repository change summary for qt/clang/llvm-project
Pushed by mirror-service into branch 'upstream/users/cchen/flang-metadirective-loop-core'.
Changed from fc66b7abc2f318799acdd6101f694ad28e413a38 to 2cd32afa2c88d444c5375df43bd06b6c8e5e56fb
Acknowledgement was received that this change introduces only existing code that has been pushed to another public open source repository.

This change contains the following new commits:

Git commit f297c090eeda15d4cf848ffe3b9a64ca8b4e22d0 by Chi-Chun, Chen on 21/07/2026 at 20:18..
[flang][OpenMP] Check DEFAULT(NONE) on metadirective loop variants

Flang does not enforce `DEFAULT(NONE)` for variables referenced in a loop
associated with a standalone METADIRECTIVE. Consequently, it accepts invalid
programs when a potentially selectable loop variant specifies DEFAULT(NONE) but
omits a referenced variable from its data-sharing clauses. This change checks the
associated loop for each potentially selectable `DEFAULT(NONE)` variant and
diagnoses missing data-sharing attributes as it does for ordinary OpenMP loop
constructs.

Standalone metadirectives and their associated loops are separate parse-tree
nodes. For example:

```fortran
!$omp metadirective &
!$omp& when(implementation={vendor(llvm)}: &
!$omp& parallel do default(none) shared(n, a)) default(nothing)
do i = 1, n
  a(i) = x
end do
```

Unlike an ordinary `PARALLEL DO`, the loop is not nested under the directive:

```text
METADIRECTIVE
`-- WHEN
    `-- PARALLEL DO DEFAULT(NONE) SHARED(n, a)

DO
`-- a(i) = x
```

Name resolution therefore leaves the variant context before visiting the loop and
does not diagnose the missing data-sharing attribute for `x`.

After associating a metadirective with its loop, validate DEFAULT(NONE) for each
potentially selectable loop variant. Preserve the existing rules for
predetermined and explicit data-sharing attributes, static locals, nested
constructs, specification expressions, and statically inapplicable variants.

Assisted with codex.
https://invent.kde.org/qt/clang/llvm-project/-/commit/f297c090eeda15d4cf848ffe3b9a64ca8b4e22d0

Git commit 640438625d9e46ec6fac78a25821fc552cb0206e by Chi-Chun, Chen on 21/07/2026 at 20:33..
Diagnose nested FIRSTPRIVATE under DEFAULT(NONE)

A variable listed as FIRSTPRIVATE on a nested TASK is also referenced by the
enclosing construct. If that construct has DEFAULT(NONE), the variable must be
listed in one of its data-sharing clauses.

The metadirective loop checker incorrectly treated nested FIRSTPRIVATE like
PRIVATE and skipped the diagnostic. Exempt only nested PRIVATE variables and
add a regression test.

Assisted with codex.
https://invent.kde.org/qt/clang/llvm-project/-/commit/640438625d9e46ec6fac78a25821fc552cb0206e

Git commit 2cd32afa2c88d444c5375df43bd06b6c8e5e56fb by Chi-Chun, Chen on 21/07/2026 at 21:14..
[flang][OpenMP] Lower DO and SIMD variants in metadirectives

Lower DO, SIMD, and DO SIMD replacement directives selected by a
metadirective. Support standalone and begin/end forms with static or runtime
selection.

A standalone metadirective and its associated loop are represented as sibling
PFT evaluations. For example:

```fortran
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
  a(i) = i
end do
```

has the following evaluation shape:

```text
METADIRECTIVE
DO
`-- a(i) = i
```

Temporarily associate the DO evaluation with the metadirective so each
replacement can reuse the existing OpenMP loop-lowering path. Runtime
selection then lowers conceptually as:

```text
if (flag)
  omp.wsloop
    omp.loop_nest
else
  fir.do_loop
```

This change:

- Lowers DO, SIMD, and DO SIMD replacements through the existing loop-lowering
  path.
- Supports static and runtime selection for standalone and begin/end
  metadirectives.
- Lowers the associated DO once in each runtime branch while preserving an
  ordinary Fortran loop for NOTHING or standalone replacements.
- Preserves intervening compiler loop directives and statements following the
  associated loop.
- Restores the evaluation tree when Flang reuses it for alternate ENTRY points.
- Applies COLLAPSE and ORDERED to the required loop depth without leaking
  temporary loop-index attributes between replacements.

Determine loop association from directive names before lowering variant
clauses. This keeps clause lowering lazy, so a statically inapplicable
replacement cannot trigger an unsupported clause.

This initial support is intentionally limited to DO, SIMD, and DO SIMD.
The following cases produce focused diagnostics instead of potentially
incorrect IR:

- Replacements such as PARALLEL DO that create a new data environment.
- Replacements containing DEFAULT or explicit data-sharing clauses.
- Loop variants nested inside an existing OpenMP data environment.
- TARGET, mixed block- and loop-associated replacements, and other
  loop-associated directives.
- Unstructured or non-canonical loops and loop nests that are too shallow for
  COLLAPSE or ORDERED.
- Loop indices that are POINTER, ALLOCATABLE, or ASSOCIATE names.

Add lowering coverage for selection, fallbacks, DO and SIMD composition,
affected loop depth, compiler directives, ENTRY, and unsupported boundaries.

Assisted with codex.
https://invent.kde.org/qt/clang/llvm-project/-/commit/2cd32afa2c88d444c5375df43bd06b6c8e5e56fb
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.