[all-commits] [llvm/llvm-project] 86d8ae: Clarify dynamic metadirective selection lowering

Chi-Chun, Chen via All-commits all-commits at lists.llvm.org
Wed May 27 16:43:05 PDT 2026


  Branch: refs/heads/users/cchen/flang-metadirective-dynamic-user-cond
  Home:   https://github.com/llvm/llvm-project
  Commit: 86d8aedba7ed83c0a62cf3bd994fc5c482a88844
      https://github.com/llvm/llvm-project/commit/86d8aedba7ed83c0a62cf3bd994fc5c482a88844
  Author: Chi Chun, Chen <chichun.chen at hpe.com>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/test/Lower/OpenMP/metadirective-user.f90

  Log Message:
  -----------
  Clarify dynamic metadirective selection lowering

Explain that statically applicable variants are ranked before dynamic
user conditions. When a dynamic condition is selected, it is lowered to a
runtime branch whose else region continues selection among the remaining
candidates.

Add a begin/end variant test that includes clauses, and tighten checks
for the empty `nothing` fallback.


  Commit: b71f9efac9d1ba631f0c1cfe9e7a1c5796a7f881
      https://github.com/llvm/llvm-project/commit/b71f9efac9d1ba631f0c1cfe9e7a1c5796a7f881
  Author: Chi Chun, Chen <chichun.chen at hpe.com>
  Date:   2026-05-27 (Wed, 27 May 2026)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M flang/lib/Lower/OpenMP/Utils.cpp
    M flang/lib/Lower/OpenMP/Utils.h
    M flang/test/Lower/OpenMP/metadirective-user.f90

  Log Message:
  -----------
  Place dynamic condition cleanups before branching

A dynamic user condition can create expression temporaries before the
selected variant is lowered. For example, a metadirective condition
such as:

  when(user={condition(getbool("hello"))}: barrier)

passes a character literal through an associated temporary. That
temporary belongs to evaluating the condition, so it must be cleaned
up before lowering enters the generated fir.if that selects between
variants.

Finalize the statement context after evaluating the condition and
before creating the branch. Keep the condition expression and source
location together as DynamicUserCondition, use that source for
generated operations, and add a regression for the temporary-producing
condition case.


Compare: https://github.com/llvm/llvm-project/compare/ab1c6441a961...b71f9efac9d1

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list