[all-commits] [llvm/llvm-project] 436ddc: [Flang][OpenMP] Improve implicit declare_target pr...
Sergio Afonso via All-commits
all-commits at lists.llvm.org
Wed Aug 5 03:02:20 PDT 2026
Branch: refs/heads/users/skatrak/omp-func-filter-03-declare-target
Home: https://github.com/llvm/llvm-project
Commit: 436ddceaf6cc388a2c5b02ecb4399df02fceaad7
https://github.com/llvm/llvm-project/commit/436ddceaf6cc388a2c5b02ecb4399df02fceaad7
Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
Date: 2026-08-05 (Wed, 05 Aug 2026)
Changed paths:
M flang/lib/Lower/OpenMP/OpenMP.cpp
M flang/test/Integration/OpenMP/function-filtering-2.f90
M flang/test/Lower/OpenMP/declare-target-deferred-marking-reductions.f90
M flang/test/Lower/OpenMP/declare-target-deferred-marking.f90
M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
M flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
M flang/test/Lower/OpenMP/declare-target-named-main-interface.f90
M mlir/include/mlir/Dialect/OpenMP/Transforms/Passes.td
M mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
A mlir/test/Dialect/OpenMP/mark-declare-target.mlir
Log Message:
-----------
[Flang][OpenMP] Improve implicit declare_target propagation
After starting to run the `MarkDeclareTarget` pass later in the
pipeline, some limitations of its original implementation started to be
hit; specifically, some calls being missed could result in an overly
restrictive marking that would cause the `HostOpFiltering` pass to
remove reachable device code.
This patch aims to address these problems by making the following
changes:
- It makes sure to mark functions in every `RecipeInterface` op pointed
to by OpenMP operations.
- It recursively propagates and combines declare_target information from
target regions and explicitly set declare_target functions to unmarked
functions, but it never modifies explicitly marked functions.
- External and public functions can now only be marked with
`device_type(any)`. Before, marking them as `nohost` or `host` was
possible, but without the ability to see all users we can't give such
guarantees.
- There was a bug in the handling of declare_target on interface
subprograms that improvements to the pass made visible. Instead of
adding the attribute to the MLIR function associated to the interface
subprogram, it wasn't added at all, making it susceptible to being
modified by the pass according to uses. This is fixed.
Fixes #213367.
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