[clang] [flang] [mlir] [MLIR][OpenMP] DeclareTargetInterface and DeclareTargetAttr cleanup (PR #217295)
Sergio Afonso via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 24 04:39:23 PDT 2026
https://github.com/skatrak updated https://github.com/llvm/llvm-project/pull/217295
>From 4edb703c673ffeda65e861ae8e968b47cff0cc9e Mon Sep 17 00:00:00 2001
From: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
Date: Tue, 18 Aug 2026 11:49:55 +0100
Subject: [PATCH] [MLIR][OpenMP] DeclareTargetInterface and DeclareTargetAttr
cleanup, NFCI
The changes introduced by this patch are intended to avoid triggering
multiple by name lookups to the "omp.declare_target" attribute every
time any data from the `DeclareTargetInterface` is queried, remove the
need for keeping multiple default values for the same data, clean up
the assembly format and generally improve the usage of the interface.
List of changes:
- `DeclareTargetInterface` only provides `setDeclareTarget` and
`getDeclareTarget` methods to handle the "omp.declare_target"
attribute, maintaining a single canonical way of accessing it.
- `DeclareTargetAttr` provides direct access to the capture clause and
device type enums, rather than wrapping them into an `Attribute`.
These are now mandatory as well. Both changes together make accessing
them more straightforward and simplify the attribute representation.
---
.../CodeGenOpenMP/emit-device-functions.cpp | 2 +-
.../Transforms/omp-mark-declare-target.cir | 8 +-
flang/docs/OpenMP-declare-target.md | 9 +-
flang/lib/Lower/OpenMP/OpenMP.cpp | 13 +--
.../Optimizer/OpenMP/AutomapToTargetData.cpp | 8 +-
.../OpenMP/UnimplementedDeviceCheck.cpp | 7 +-
flang/test/Fir/omp-declare-target-data.fir | 44 +++++-----
...are-target-deferred-marking-reductions.f90 | 4 +-
.../declare-target-deferred-marking.f90 | 8 +-
.../OpenMP/declare-target-funcs.f90 | 4 +-
...arget-implicit-func-and-subr-cap-enter.f90 | 38 ++++----
...lare-target-implicit-func-and-subr-cap.f90 | 42 ++++-----
.../declare-target-implicit-tarop-cap.f90 | 14 +--
.../declare-target-named-main-interface.f90 | 6 +-
.../OpenMP/function-filtering-2.f90 | 8 +-
flang/test/Lower/OpenMP/common-block-map.f90 | 2 +-
.../test/Lower/OpenMP/declare-target-data.f90 | 40 ++++-----
.../OpenMP/declare-target-func-and-subr.f90 | 46 +++++-----
.../OpenMP/declare-target-multiple-entry.f90 | 6 +-
.../OpenMP/declare-target-unnamed-main.f90 | 2 +-
.../OpenMP/omp-declare-target-program-var.f90 | 2 +-
.../Transforms/omp-automap-to-target-data.fir | 6 +-
.../omp-function-filtering-todo.mlir | 2 +-
.../mlir/Dialect/OpenMP/OpenMPAttrDefs.td | 4 +-
.../Dialect/OpenMP/OpenMPOpsInterfaces.td | 75 ++++------------
mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp | 2 +-
.../OpenMP/Transforms/FunctionFiltering.cpp | 8 +-
.../OpenMP/Transforms/HostOpFiltering.cpp | 6 +-
.../OpenMP/Transforms/MarkDeclareTarget.cpp | 16 ++--
mlir/lib/Dialect/OpenMP/Utils/Utils.cpp | 7 +-
.../OpenMP/OpenMPToLLVMIRTranslation.cpp | 44 ++++++----
mlir/test/Dialect/OpenMP/attr.mlir | 60 ++++++-------
mlir/test/Dialect/OpenMP/function-filter.mlir | 22 ++---
.../Dialect/OpenMP/host-op-filtering.mlir | 14 +--
.../Dialect/OpenMP/invalid-interface.mlir | 8 +-
.../Dialect/OpenMP/mark-declare-target.mlir | 88 +++++++++----------
mlir/test/Dialect/OpenMP/stack-to-shared.mlir | 4 +-
...target-atomic-capture-control-options.mlir | 2 +-
...ptarget-atomic-update-control-options.mlir | 2 +-
.../omptarget-constant-alloca-raise.mlir | 2 +-
.../LLVMIR/omptarget-debug-map-link-loc.mlir | 2 +-
...eclare-target-all-device-types-device.mlir | 24 ++---
...target-declare-target-func-visibility.mlir | 8 +-
...mptarget-declare-target-llvm-device-2.mlir | 6 +-
.../omptarget-declare-target-llvm-device.mlir | 2 +-
.../omptarget-declare-target-llvm-host.mlir | 34 +++----
...-declare-target-module-rewrite-device.mlir | 24 ++---
.../omptarget-declare-target-to-device.mlir | 2 +-
.../omptarget-declare-target-to-host.mlir | 2 +-
.../LLVMIR/omptarget-device-shared-mem.mlir | 2 +-
.../LLVMIR/omptarget-multi-reduction.mlir | 2 +-
.../LLVMIR/omptarget-parallel-llvm.mlir | 4 +-
.../LLVMIR/omptarget-parallel-wsloop.mlir | 2 +-
.../Target/LLVMIR/omptarget-private-llvm.mlir | 4 +-
...distribute-reduction-array-descriptor.mlir | 4 +-
.../omptarget-teams-distribute-reduction.mlir | 2 +-
.../Target/LLVMIR/omptarget-teams-llvm.mlir | 2 +-
.../LLVMIR/omptarget-teams-reduction.mlir | 2 +-
.../LLVMIR/omptarget-wsloop-collapsed.mlir | 2 +-
mlir/test/Target/LLVMIR/omptarget-wsloop.mlir | 4 +-
.../LLVMIR/openmp-data-target-device.mlir | 2 +-
mlir/test/Target/LLVMIR/openmp-llvm.mlir | 18 ++--
.../openmp-target-private-shared-mem.mlir | 4 +-
63 files changed, 411 insertions(+), 432 deletions(-)
diff --git a/clang/test/CIR/CodeGenOpenMP/emit-device-functions.cpp b/clang/test/CIR/CodeGenOpenMP/emit-device-functions.cpp
index 53a8e2b7aab71..014529d2104d3 100644
--- a/clang/test/CIR/CodeGenOpenMP/emit-device-functions.cpp
+++ b/clang/test/CIR/CodeGenOpenMP/emit-device-functions.cpp
@@ -33,7 +33,7 @@ void caller() {
#pragma omp end declare target
-// CIR-DAG: cir.func {{.*}} @_Z12regular_funcv() {{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)
+// CIR-DAG: cir.func {{.*}} @_Z12regular_funcv() {{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to
// CIR-DAG: cir.func {{.*}} @_Z6callerv() {{.*}}omp.declare_target
// CIR-DAG: cir.func {{.*}} @_ZN1SC2Ev({{.*}})
// CIR-DAG: cir.func {{.*}} @_ZN1SC1Ev({{.*}})
diff --git a/clang/test/CIR/Transforms/omp-mark-declare-target.cir b/clang/test/CIR/Transforms/omp-mark-declare-target.cir
index a32fccc20f970..daa082683d03a 100644
--- a/clang/test/CIR/Transforms/omp-mark-declare-target.cir
+++ b/clang/test/CIR/Transforms/omp-mark-declare-target.cir
@@ -10,22 +10,22 @@ module {
// A helper function with no declare_target attribute initially.
// After the pass, it should be marked because @caller calls it.
// CHECK-LABEL: cir.func private @helper
- // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)
+ // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to
cir.func private @helper() {
cir.return
}
// Explicitly marked as declare_target; calls @helper.
// CHECK-LABEL: cir.func @caller
- // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>
- cir.func @caller() attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>
+ cir.func @caller() attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
cir.call @helper() : () -> ()
cir.return
}
// Called from within an omp.target region; should be marked as nohost.
// CHECK-LABEL: cir.func private @device_helper
- // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)
+ // CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to
cir.func private @device_helper() {
cir.return
}
diff --git a/flang/docs/OpenMP-declare-target.md b/flang/docs/OpenMP-declare-target.md
index e43a623cc9fb9..1e98068a2961b 100644
--- a/flang/docs/OpenMP-declare-target.md
+++ b/flang/docs/OpenMP-declare-target.md
@@ -79,7 +79,7 @@ would find on the `declare target` directive i.e. device type (`nohost`,
```
fir.global internal @_QFEi {omp.declare_target =
-#omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+#omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
%0 = fir.undefined f32
fir.has_value %0 : f32
}
@@ -93,8 +93,11 @@ operations to access the appropriate interface functions, e.g.:
```C++
auto declareTargetGlobal =
-llvm::dyn_cast<mlir::omp::DeclareTargetInterface>(Op.getOperation());
-declareTargetGlobal.isDeclareTarget();
+ llvm::cast<mlir::omp::DeclareTargetInterface>(op.getOperation());
+auto declareTargetAttr = declareTargetGlobal.getDeclareTarget();
+if (declareTargetAttr) {
+ auto deviceType = declareTargetAttr.getDeviceType();
+}
```
## Declare Target Fortran OpenMP Lowering
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 7503d33c8df38..581d5668de8db 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -1757,10 +1757,12 @@ getImplicitMapTypeAndKind(fir::FirOpBuilder &firOpBuilder,
}
}
- if (declareTargetOp && declareTargetOp.isDeclareTarget()) {
- if (declareTargetOp.getDeclareTargetCaptureClause() ==
+ mlir::omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp ? declareTargetOp.getDeclareTarget() : nullptr;
+ if (declareTargetAttr) {
+ if (declareTargetAttr.getCaptureClause() ==
mlir::omp::DeclareTargetCaptureClause::link &&
- declareTargetOp.getDeclareTargetDeviceType() !=
+ declareTargetAttr.getDeviceType() !=
mlir::omp::DeclareTargetDeviceType::nohost) {
mapFlag |= mlir::omp::ClauseMapFlags::to;
mapFlag |= mlir::omp::ClauseMapFlags::from;
@@ -1840,8 +1842,9 @@ markDeclareTarget(mlir::Operation *op, lower::AbstractConverter &converter,
// likely through implicit capture (usage in another declare target
// function/subroutine). It should be marked as any if it has been assigned
// both host and nohost, else we skip, as there is no change
- if (declareTargetOp.isDeclareTarget()) {
- if (declareTargetOp.getDeclareTargetDeviceType() != deviceType)
+ if (mlir::omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp.getDeclareTarget()) {
+ if (declareTargetAttr.getDeviceType() != deviceType)
declareTargetOp.setDeclareTarget(mlir::omp::DeclareTargetDeviceType::any,
captureClause, automap,
/*implicit=*/false);
diff --git a/flang/lib/Optimizer/OpenMP/AutomapToTargetData.cpp b/flang/lib/Optimizer/OpenMP/AutomapToTargetData.cpp
index bf269b5dd3ff2..0ec0c9193e969 100644
--- a/flang/lib/Optimizer/OpenMP/AutomapToTargetData.cpp
+++ b/flang/lib/Optimizer/OpenMP/AutomapToTargetData.cpp
@@ -97,11 +97,13 @@ class AutomapToTargetDataPass
llvm::DenseSet<fir::GlobalOp> automapGlobals;
module.walk([&](fir::GlobalOp globalOp) {
if (auto iface =
- dyn_cast<omp::DeclareTargetInterface>(globalOp.getOperation()))
- if (iface.isDeclareTarget() && iface.getDeclareTargetAutomap() &&
- iface.getDeclareTargetDeviceType() !=
+ dyn_cast<omp::DeclareTargetInterface>(globalOp.getOperation())) {
+ omp::DeclareTargetAttr declareTargetAttr = iface.getDeclareTarget();
+ if (declareTargetAttr && declareTargetAttr.getAutomap() &&
+ declareTargetAttr.getDeviceType() !=
omp::DeclareTargetDeviceType::host)
automapGlobals.insert(globalOp);
+ }
});
auto addMapInfo = [&](auto globalOp, auto memOp) {
diff --git a/flang/lib/Optimizer/OpenMP/UnimplementedDeviceCheck.cpp b/flang/lib/Optimizer/OpenMP/UnimplementedDeviceCheck.cpp
index c393e2f90f88f..faf7274444104 100644
--- a/flang/lib/Optimizer/OpenMP/UnimplementedDeviceCheck.cpp
+++ b/flang/lib/Optimizer/OpenMP/UnimplementedDeviceCheck.cpp
@@ -37,9 +37,10 @@ static bool allUsesInHostCode(Operation *moduleOp, SymbolOpInterface symOp) {
if (auto declareTargetOp =
symUser->getParentOfType<omp::DeclareTargetInterface>()) {
- if (declareTargetOp.isDeclareTarget() &&
- declareTargetOp.getDeclareTargetDeviceType() !=
- omp::DeclareTargetDeviceType::host)
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp.getDeclareTarget();
+ if (declareTargetAttr && declareTargetAttr.getDeviceType() !=
+ omp::DeclareTargetDeviceType::host)
return false;
}
}
diff --git a/flang/test/Fir/omp-declare-target-data.fir b/flang/test/Fir/omp-declare-target-data.fir
index 171ea8fe4fcc2..539a7acf267f2 100644
--- a/flang/test/Fir/omp-declare-target-data.fir
+++ b/flang/test/Fir/omp-declare-target-data.fir
@@ -2,11 +2,11 @@
module attributes {omp.is_target_device = false} {
- // CHECK: llvm.mlir.global external @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : !llvm.array<3 x i32>
- fir.global @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.array<3xi32>
+ // CHECK: llvm.mlir.global external @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : !llvm.array<3 x i32>
+ fir.global @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.array<3xi32>
- // CHECK: llvm.mlir.global external @_QMtest_0Earray_2d() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : !llvm.array<2 x array<2 x i32>>
- fir.global @_QMtest_0Earray_2d {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.array<2x2xi32> {
+ // CHECK: llvm.mlir.global external @_QMtest_0Earray_2d() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : !llvm.array<2 x array<2 x i32>>
+ fir.global @_QMtest_0Earray_2d {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.array<2x2xi32> {
%0 = fir.undefined !fir.array<2x2xi32>
%c1_i32 = arith.constant 1 : i32
%1 = fir.insert_value %0, %c1_i32, [0 : index, 0 : index] : (!fir.array<2x2xi32>, i32) -> !fir.array<2x2xi32>
@@ -21,57 +21,57 @@ module attributes {omp.is_target_device = false} {
fir.has_value %4 : !fir.array<2x2xi32>
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_link_1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : f32
- fir.global @_QMtest_0Edata_extended_link_1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_link_1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : f32
+ fir.global @_QMtest_0Edata_extended_link_1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%cst = arith.constant 2.000000e+00 : f32
fir.has_value %cst : f32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_link_2() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : f32
- fir.global @_QMtest_0Edata_extended_link_2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_link_2() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : f32
+ fir.global @_QMtest_0Edata_extended_link_2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%cst = arith.constant 3.000000e+00 : f32
fir.has_value %cst : f32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_to_1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}} : f32
- fir.global @_QMtest_0Edata_extended_to_1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_to_1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}} : f32
+ fir.global @_QMtest_0Edata_extended_to_1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
%cst = arith.constant 2.000000e+00 : f32
fir.has_value %cst : f32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_to_2() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}} : f32 {
- fir.global @_QMtest_0Edata_extended_to_2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_extended_to_2() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}} : f32 {
+ fir.global @_QMtest_0Edata_extended_to_2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
%cst = arith.constant 3.000000e+00 : f32
fir.has_value %cst : f32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_int() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : i32
- fir.global @_QMtest_0Edata_int {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_int() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : i32
+ fir.global @_QMtest_0Edata_int {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%c10_i32 = arith.constant 10 : i32
fir.has_value %c10_i32 : i32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_int_clauseless() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}} : i32
- fir.global @_QMtest_0Edata_int_clauseless {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_int_clauseless() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}} : i32
+ fir.global @_QMtest_0Edata_int_clauseless {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%c1_i32 = arith.constant 1 : i32
fir.has_value %c1_i32 : i32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Edata_int_to() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}} : i32
- fir.global @_QMtest_0Edata_int_to {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Edata_int_to() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}} : i32
+ fir.global @_QMtest_0Edata_int_to {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%c5_i32 = arith.constant 5 : i32
fir.has_value %c5_i32 : i32
}
- // CHECK: llvm.mlir.global external @_QMtest_0Ept1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {
- fir.global @_QMtest_0Ept1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.box<!fir.ptr<i32>> {
+ // CHECK: llvm.mlir.global external @_QMtest_0Ept1() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {
+ fir.global @_QMtest_0Ept1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.box<!fir.ptr<i32>> {
%0 = fir.zero_bits !fir.ptr<i32>
%1 = fir.embox %0 : (!fir.ptr<i32>) -> !fir.box<!fir.ptr<i32>>
fir.has_value %1 : !fir.box<!fir.ptr<i32>>
}
- // CHECK: llvm.mlir.global external @_QMtest_0Ept2_tar() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>{{.*}}} : i32
- fir.global @_QMtest_0Ept2_tar {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} target : i32 {
+ // CHECK: llvm.mlir.global external @_QMtest_0Ept2_tar() {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>{{.*}}} : i32
+ fir.global @_QMtest_0Ept2_tar {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} target : i32 {
%c5_i32 = arith.constant 5 : i32
fir.has_value %c5_i32 : i32
}
diff --git a/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90 b/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
index 124ec4b8ffbd7..ede40592426ef 100644
--- a/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
+++ b/flang/test/Integration/OpenMP/declare-target-deferred-marking-reductions.f90
@@ -39,6 +39,6 @@ end function mycombine
end program main
!CHECK: llvm.func @myinit(!llvm.ptr, !llvm.ptr)
-!CHECK-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}
+!CHECK-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}
!CHECK-LABEL: llvm.func @mycombine(!llvm.ptr, !llvm.ptr)
-!CHECK-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}
+!CHECK-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}
diff --git a/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90 b/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
index 8be7efd2619f1..8b2e02797ed2a 100644
--- a/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
+++ b/flang/test/Integration/OpenMP/declare-target-deferred-marking.f90
@@ -59,10 +59,10 @@ end subroutine unused_unemitted_interface
end program main
!HOST-LABEL: llvm.func @host_interface()
-!HOST-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}
+!HOST-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}
!ALL-LABEL: llvm.func @called_from_target_interface(!llvm.ptr, !llvm.ptr)
-!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}
+!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}
!ALL-LABEL: llvm.func @any_interface()
-!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>{{.*}}
+!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>{{.*}}
!ALL-LABEL: llvm.func @device_interface()
-!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}
+!ALL-SAME: {{.*}}, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}
diff --git a/flang/test/Integration/OpenMP/declare-target-funcs.f90 b/flang/test/Integration/OpenMP/declare-target-funcs.f90
index 66010b9b0838f..6a4ac0538c06b 100644
--- a/flang/test/Integration/OpenMP/declare-target-funcs.f90
+++ b/flang/test/Integration/OpenMP/declare-target-funcs.f90
@@ -16,8 +16,8 @@
! CHECK-LABEL: IR Dump Before HostOpFilteringPass: omp-host-op-filter
! CHECK: llvm.func{{.*}}@__mlir_math_ipowi_i32
-! CHECK-SAME: attributes{{.*}}omp.declare_target{{.*}}device_type =
-! CHECK-NOT: (host)
+! CHECK-SAME: attributes{{.*}}omp.declare_target = #omp.declaretarget<
+! CHECK-NOT: device_type = host
module m
contains
diff --git a/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
index 225a8f4bec855..b0a4cd75b9497 100644
--- a/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
@@ -36,7 +36,7 @@ recursive subroutine implicitly_captured_recursive(increment)
contains
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_twice
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_twice() result(k)
integer :: i
i = 10
@@ -44,7 +44,7 @@ function implicitly_captured_twice() result(k)
end function implicitly_captured_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPtarget_function_twice_host()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}}
function target_function_twice_host() result(i)
!$omp declare target enter(target_function_twice_host) device_type(host)
integer :: i
@@ -52,7 +52,7 @@ function target_function_twice_host() result(i)
end function target_function_twice_host
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_twice_device()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
function target_function_twice_device() result(i)
!$omp declare target enter(target_function_twice_device) device_type(nohost)
integer :: i
@@ -62,7 +62,7 @@ end function target_function_twice_device
!! -----
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest() result(k)
integer :: i
i = 10
@@ -70,13 +70,13 @@ function implicitly_captured_nest() result(k)
end function implicitly_captured_nest
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_one() result(k)
k = implicitly_captured_nest()
end function implicitly_captured_one
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_two()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two() result(k)
integer :: i
i = 10
@@ -84,7 +84,7 @@ function implicitly_captured_two() result(k)
end function implicitly_captured_two
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_test()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
function target_function_test() result(j)
!$omp declare target enter(target_function_test) device_type(nohost)
integer :: i, j
@@ -95,7 +95,7 @@ end function target_function_test
!! -----
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice() result(k)
integer :: i
i = 10
@@ -103,13 +103,13 @@ function implicitly_captured_nest_twice() result(k)
end function implicitly_captured_nest_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_one_twice() result(k)
k = implicitly_captured_nest_twice()
end function implicitly_captured_one_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_two_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two_twice() result(k)
integer :: i
i = 10
@@ -117,7 +117,7 @@ function implicitly_captured_two_twice() result(k)
end function implicitly_captured_two_twice
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_test_device()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
function target_function_test_device() result(j)
!$omp declare target enter(target_function_test_device) device_type(nohost)
integer :: i, j
@@ -126,7 +126,7 @@ function target_function_test_device() result(j)
end function target_function_test_device
! CHECK-LABEL: llvm.func{{.*}} @_QFPtarget_function_test_host()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}}
function target_function_test_host() result(j)
!$omp declare target enter(target_function_test_host) device_type(host)
integer :: i, j
@@ -150,7 +150,7 @@ recursive function implicitly_captured_with_dev_type_recursive(increment) result
end function implicitly_captured_with_dev_type_recursive
! DEVICE-LABEL: llvm.func @_QPtarget_function_with_dev_type_recurse()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
function target_function_with_dev_type_recurse() result(i)
!$omp declare target enter(target_function_with_dev_type_recurse) device_type(nohost)
integer :: i
@@ -162,28 +162,28 @@ end function target_function_with_dev_type_recurse
module test_module
contains
! CHECK-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_nest_twice()
-! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice() result(i)
integer :: i
i = 10
end function implicitly_captured_nest_twice
! CHECK-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_one_twice()
-! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}}
+! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}}
function implicitly_captured_one_twice() result(k)
!$omp declare target enter(implicitly_captured_one_twice) device_type(host)
k = implicitly_captured_nest_twice()
end function implicitly_captured_one_twice
! DEVICE-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_two_twice()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two_twice() result(y)
integer :: y
y = 5
end function implicitly_captured_two_twice
! DEVICE-LABEL: llvm.func @_QMtest_modulePtarget_function_test_device()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
function target_function_test_device() result(j)
!$omp declare target enter(target_function_test_device) device_type(nohost)
integer :: i, j
@@ -195,7 +195,7 @@ end module test_module
!! -----
! DEVICE-LABEL: llvm.func @_QPimplicitly_captured_recursive
-! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
recursive subroutine implicitly_captured_recursive(increment)
integer :: increment
if (increment == 10) then
@@ -206,7 +206,7 @@ recursive subroutine implicitly_captured_recursive(increment)
end subroutine
! DEVICE-LABEL: llvm.func @_QPcaller_recursive
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
subroutine caller_recursive
!$omp declare target enter(caller_recursive) device_type(nohost)
call implicitly_captured_recursive(0)
diff --git a/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
index 36954739a916d..c5382123e534b 100644
--- a/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-func-and-subr-cap.f90
@@ -37,7 +37,7 @@ recursive subroutine implicitly_captured_recursive(increment)
contains
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured(
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured(toggle) result(k)
integer :: i, j, k
logical :: toggle
@@ -51,7 +51,7 @@ function implicitly_captured(toggle) result(k)
end function implicitly_captured
! CHECK-LABEL: llvm.func{{.*}} @_QFPtarget_function(
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}}
function target_function(toggle) result(i)
!$omp declare target
integer :: i
@@ -62,7 +62,7 @@ end function target_function
!! -----
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_twice() result(k)
integer :: i
i = 10
@@ -70,7 +70,7 @@ function implicitly_captured_twice() result(k)
end function implicitly_captured_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPtarget_function_twice_host()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}}
function target_function_twice_host() result(i)
!$omp declare target to(target_function_twice_host) device_type(host)
integer :: i
@@ -78,7 +78,7 @@ function target_function_twice_host() result(i)
end function target_function_twice_host
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_twice_device()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
function target_function_twice_device() result(i)
!$omp declare target to(target_function_twice_device) device_type(nohost)
integer :: i
@@ -88,7 +88,7 @@ end function target_function_twice_device
!! -----
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest() result(k)
integer :: i
i = 10
@@ -96,13 +96,13 @@ function implicitly_captured_nest() result(k)
end function implicitly_captured_nest
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_one() result(k)
k = implicitly_captured_nest()
end function implicitly_captured_one
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_two()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two() result(k)
integer :: i
i = 10
@@ -110,7 +110,7 @@ function implicitly_captured_two() result(k)
end function implicitly_captured_two
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_test()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
function target_function_test() result(j)
!$omp declare target to(target_function_test) device_type(nohost)
integer :: i, j
@@ -121,7 +121,7 @@ end function target_function_test
!! -----
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice() result(k)
integer :: i
i = 10
@@ -129,13 +129,13 @@ function implicitly_captured_nest_twice() result(k)
end function implicitly_captured_nest_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_one_twice() result(k)
k = implicitly_captured_nest_twice()
end function implicitly_captured_one_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_two_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two_twice() result(k)
integer :: i
i = 10
@@ -143,7 +143,7 @@ function implicitly_captured_two_twice() result(k)
end function implicitly_captured_two_twice
! DEVICE-LABEL: llvm.func{{.*}} @_QFPtarget_function_test_device()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
function target_function_test_device() result(j)
!$omp declare target to(target_function_test_device) device_type(nohost)
integer :: i, j
@@ -152,7 +152,7 @@ function target_function_test_device() result(j)
end function target_function_test_device
! CHECK-LABEL: llvm.func{{.*}} @_QFPtarget_function_test_host()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}}
function target_function_test_host() result(j)
!$omp declare target to(target_function_test_host) device_type(host)
integer :: i, j
@@ -176,7 +176,7 @@ recursive function implicitly_captured_with_dev_type_recursive(increment) result
end function implicitly_captured_with_dev_type_recursive
! DEVICE-LABEL: llvm.func @_QPtarget_function_with_dev_type_recurse()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
function target_function_with_dev_type_recurse() result(i)
!$omp declare target to(target_function_with_dev_type_recurse) device_type(nohost)
integer :: i
@@ -188,28 +188,28 @@ end function target_function_with_dev_type_recurse
module test_module
contains
! CHECK-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_nest_twice()
-! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice() result(i)
integer :: i
i = 10
end function implicitly_captured_nest_twice
! CHECK-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_one_twice()
-! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}}
+! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}}
function implicitly_captured_one_twice() result(k)
!$omp declare target to(implicitly_captured_one_twice) device_type(host)
k = implicitly_captured_nest_twice()
end function implicitly_captured_one_twice
! DEVICE-LABEL: llvm.func @_QMtest_modulePimplicitly_captured_two_twice()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two_twice() result(y)
integer :: y
y = 5
end function implicitly_captured_two_twice
! DEVICE-LABEL: llvm.func @_QMtest_modulePtarget_function_test_device()
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
function target_function_test_device() result(j)
!$omp declare target to(target_function_test_device) device_type(nohost)
integer :: i, j
@@ -221,7 +221,7 @@ end module test_module
!! -----
! DEVICE-LABEL: llvm.func @_QPimplicitly_captured_recursive
-! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>{{.*}}}
recursive subroutine implicitly_captured_recursive(increment)
integer :: increment
if (increment == 10) then
@@ -232,7 +232,7 @@ recursive subroutine implicitly_captured_recursive(increment)
end subroutine
! DEVICE-LABEL: llvm.func @_QPcaller_recursive
-! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
subroutine caller_recursive
!$omp declare target to(caller_recursive) device_type(nohost)
call implicitly_captured_recursive(0)
diff --git a/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90 b/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
index 0d527df426a2d..6bfde64c3218c 100644
--- a/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
+++ b/flang/test/Integration/OpenMP/declare-target-implicit-tarop-cap.f90
@@ -23,7 +23,7 @@ program main
contains
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicit_capture()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicit_capture() result(i)
implicit none
integer :: i
@@ -40,35 +40,35 @@ subroutine subr_target()
!! -----
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice() result(i)
integer :: i
i = 10
end function implicitly_captured_nest_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one_twice()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}}
function implicitly_captured_one_twice() result(k)
!$omp declare target to(implicitly_captured_one_twice) device_type(host)
k = implicitly_captured_nest_twice()
end function implicitly_captured_one_twice
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_nest_twice_enter()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_nest_twice_enter() result(i)
integer :: i
i = 10
end function implicitly_captured_nest_twice_enter
! CHECK-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_one_twice_enter()
- ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}}
+ ! CHECK-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}}
function implicitly_captured_one_twice_enter() result(k)
!$omp declare target enter(implicitly_captured_one_twice_enter) device_type(host)
k = implicitly_captured_nest_twice_enter()
end function implicitly_captured_one_twice_enter
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_two_twice()
- ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
function implicitly_captured_two_twice() result(y)
integer :: y
y = 5
@@ -86,7 +86,7 @@ end function target_function_test_device
!! -----
! DEVICE-LABEL: llvm.func{{.*}} @_QFPimplicitly_captured_recursive(
- ! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
recursive function implicitly_captured_recursive(increment) result(k)
integer :: increment, k
if (increment == 10) then
diff --git a/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90 b/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
index 5303260e5e45e..1fa1ad12ec87c 100644
--- a/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
+++ b/flang/test/Integration/OpenMP/declare-target-named-main-interface.f90
@@ -14,9 +14,9 @@
! program (_QQmain) as a declare-target function while still correctly
! marking the declared subroutine (sub_a) as device_type(any).
-! CHECK-NOT: llvm.func @_QQmain{{.*}}device_type = (any)
-! CHECK-NOT: llvm.func @_QQmain{{.*}}device_type = (nohost)
-! CHECK: llvm.func @_QPsub_a{{.*}}device_type = (any), {{.*}}sym_visibility = "private"
+! CHECK-NOT: llvm.func @_QQmain{{.*}}device_type = any
+! CHECK-NOT: llvm.func @_QQmain{{.*}}device_type = nohost
+! CHECK: llvm.func @_QPsub_a{{.*}}#omp.declaretarget<device_type = any, capture_clause = to>, {{.*}}sym_visibility = "private"
program named_main
interface
diff --git a/flang/test/Integration/OpenMP/function-filtering-2.f90 b/flang/test/Integration/OpenMP/function-filtering-2.f90
index a5bb5d2165fe7..cc6fa0b938e1e 100644
--- a/flang/test/Integration/OpenMP/function-filtering-2.f90
+++ b/flang/test/Integration/OpenMP/function-filtering-2.f90
@@ -24,13 +24,13 @@ program main
!$omp end target
contains
- ! MLIR-ALL: llvm.func{{.*}} @{{.*}}implicit_invocation() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! MLIR-ALL: llvm.func{{.*}} @{{.*}}implicit_invocation() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
! MLIR-ALL: llvm.return
! LLVM-ALL: define {{.*}} @{{.*}}implicit_invocation{{.*}}(
subroutine implicit_invocation()
end subroutine implicit_invocation
- ! MLIR-ALL: llvm.func{{.*}} @{{.*}}declaretarget() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}}
+ ! MLIR-ALL: llvm.func{{.*}} @{{.*}}declaretarget() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}}
! MLIR-ALL: llvm.return
! LLVM-ALL: define {{.*}} @{{.*}}declaretarget{{.*}}(
subroutine declaretarget()
@@ -38,7 +38,7 @@ subroutine declaretarget()
call implicit_invocation()
end subroutine declaretarget
- ! MLIR-ALL: llvm.func{{.*}} @{{.*}}declaretarget_enter() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}}
+ ! MLIR-ALL: llvm.func{{.*}} @{{.*}}declaretarget_enter() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}}
! MLIR-ALL: llvm.return
! LLVM-ALL: define {{.*}} @{{.*}}declaretarget_enter{{.*}}(
subroutine declaretarget_enter()
@@ -46,7 +46,7 @@ subroutine declaretarget_enter()
call implicit_invocation()
end subroutine declaretarget_enter
- ! MLIR-ALL: llvm.func{{.*}} @{{.*}}no_declaretarget() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>{{.*}}}
+ ! MLIR-ALL: llvm.func{{.*}} @{{.*}}no_declaretarget() attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>{{.*}}}
! MLIR-ALL: llvm.return
! LLVM-ALL: define {{.*}} @{{.*}}no_declaretarget{{.*}}(
subroutine no_declaretarget()
diff --git a/flang/test/Lower/OpenMP/common-block-map.f90 b/flang/test/Lower/OpenMP/common-block-map.f90
index 42547bf7b8f4d..db6202015f8b4 100644
--- a/flang/test/Lower/OpenMP/common-block-map.f90
+++ b/flang/test/Lower/OpenMP/common-block-map.f90
@@ -1,7 +1,7 @@
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
!CHECK: fir.global common @var_common_(dense<0> : vector<8xi8>) {{.*}} : !fir.array<8xi8>
-!CHECK: fir.global common @var_common_link_(dense<0> : vector<8xi8>) {{{.*}} omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.array<8xi8>
+!CHECK: fir.global common @var_common_link_(dense<0> : vector<8xi8>) {{{.*}} omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.array<8xi8>
!CHECK-LABEL: func.func @_QPmap_full_block
!CHECK: %[[CB_ADDR:.*]] = fir.address_of(@var_common_) : !fir.ref<!fir.array<8xi8>>
diff --git a/flang/test/Lower/OpenMP/declare-target-data.f90 b/flang/test/Lower/OpenMP/declare-target-data.f90
index d4f1fb273e068..6bfcbb09427d2 100644
--- a/flang/test/Lower/OpenMP/declare-target-data.f90
+++ b/flang/test/Lower/OpenMP/declare-target-data.f90
@@ -4,61 +4,61 @@
module test_0
implicit none
-!CHECK-DAG: fir.global @_QMtest_0Edata_int {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32
+!CHECK-DAG: fir.global @_QMtest_0Edata_int {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32
INTEGER :: data_int = 10
!$omp declare target link(data_int)
-!CHECK-DAG: fir.global @_QMtest_0Earray_1d({{.*}}) {alignment = 64 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.array<3xi32>
+!CHECK-DAG: fir.global @_QMtest_0Earray_1d({{.*}}) {alignment = 64 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.array<3xi32>
INTEGER :: array_1d(3) = (/1,2,3/)
!$omp declare target link(array_1d)
-!CHECK-DAG: fir.global @_QMtest_0Earray_2d({{.*}}) {alignment = 64 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.array<2x2xi32>
+!CHECK-DAG: fir.global @_QMtest_0Earray_2d({{.*}}) {alignment = 64 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.array<2x2xi32>
INTEGER :: array_2d(2,2) = reshape((/1,2,3,4/), (/2,2/))
!$omp declare target link(array_2d)
-!CHECK-DAG: fir.global @_QMtest_0Ept1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.box<!fir.ptr<i32>>
+!CHECK-DAG: fir.global @_QMtest_0Ept1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.box<!fir.ptr<i32>>
INTEGER, POINTER :: pt1
!$omp declare target link(pt1)
-!CHECK-DAG: fir.global @_QMtest_0Ept2_tar {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} target : i32
+!CHECK-DAG: fir.global @_QMtest_0Ept2_tar {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} target : i32
INTEGER, TARGET :: pt2_tar = 5
!$omp declare target link(pt2_tar)
-!CHECK-DAG: fir.global @_QMtest_0Ept2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !fir.box<!fir.ptr<i32>>
+!CHECK-DAG: fir.global @_QMtest_0Ept2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !fir.box<!fir.ptr<i32>>
INTEGER, POINTER :: pt2 => pt2_tar
!$omp declare target link(pt2)
-!CHECK-DAG: fir.global @_QMtest_0Edata_int_to {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32
+!CHECK-DAG: fir.global @_QMtest_0Edata_int_to {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32
INTEGER :: data_int_to = 5
!$omp declare target to(data_int_to)
-!CHECK-DAG: fir.global @_QMtest_0Edata_int_enter {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32
+!CHECK-DAG: fir.global @_QMtest_0Edata_int_enter {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32
INTEGER :: data_int_enter = 5
!$omp declare target enter(data_int_enter)
-!CHECK-DAG: fir.global @_QMtest_0Edata_int_clauseless {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32
+!CHECK-DAG: fir.global @_QMtest_0Edata_int_clauseless {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32
INTEGER :: data_int_clauseless = 1
!$omp declare target(data_int_clauseless)
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_to_1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_to_2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_to_1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_to_2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32
REAL :: data_extended_to_1 = 2
REAL :: data_extended_to_2 = 3
!$omp declare target to(data_extended_to_1, data_extended_to_2)
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_enter_1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_enter_2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_enter_1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_enter_2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32
REAL :: data_extended_enter_1 = 2
REAL :: data_extended_enter_2 = 3
!$omp declare target enter(data_extended_enter_1, data_extended_enter_2)
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_link_1 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32
-!CHECK-DAG: fir.global @_QMtest_0Edata_extended_link_2 {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_link_1 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32
+!CHECK-DAG: fir.global @_QMtest_0Edata_extended_link_2 {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32
REAL :: data_extended_link_1 = 2
REAL :: data_extended_link_2 = 3
!$omp declare target link(data_extended_link_1, data_extended_link_2)
-!CHECK-DAG: fir.global @_QMtest_0Eautomap_data {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = true>} target : !fir.box<!fir.heap<i32>>
+!CHECK-DAG: fir.global @_QMtest_0Eautomap_data {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter, automap = true>} target : !fir.box<!fir.heap<i32>>
INTEGER, ALLOCATABLE, TARGET :: automap_data
!$omp declare target enter(automap : automap_data)
@@ -66,25 +66,25 @@ module test_0
end module test_0
PROGRAM commons
- !CHECK-DAG: fir.global @numbers_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : tuple<f32, f32> {
+ !CHECK-DAG: fir.global @numbers_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : tuple<f32, f32> {
REAL :: one = 1
REAL :: two = 2
COMMON /numbers/ one, two
!$omp declare target(/numbers/)
- !CHECK-DAG: fir.global @numbers_link_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : tuple<f32, f32> {
+ !CHECK-DAG: fir.global @numbers_link_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : tuple<f32, f32> {
REAL :: one_link = 1
REAL :: two_link = 2
COMMON /numbers_link/ one_link, two_link
!$omp declare target link(/numbers_link/)
- !CHECK-DAG: fir.global @numbers_to_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : tuple<f32, f32> {
+ !CHECK-DAG: fir.global @numbers_to_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : tuple<f32, f32> {
REAL :: one_to = 1
REAL :: two_to = 2
COMMON /numbers_to/ one_to, two_to
!$omp declare target to(/numbers_to/)
- !CHECK-DAG: fir.global @numbers_enter_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : tuple<f32, f32> {
+ !CHECK-DAG: fir.global @numbers_enter_ {alignment = 4 : i64, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : tuple<f32, f32> {
REAL :: one_enter = 1
REAL :: two_enter = 2
COMMON /numbers_enter/ one_enter, two_enter
diff --git a/flang/test/Lower/OpenMP/declare-target-func-and-subr.f90 b/flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
index 8db8c620042c5..083af7809b96e 100644
--- a/flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
+++ b/flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
@@ -6,7 +6,7 @@
! zero clause declare target
! DEVICE-LABEL: func.func @_QPfunc_t_device()
-! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}
FUNCTION FUNC_T_DEVICE() RESULT(I)
!$omp declare target to(FUNC_T_DEVICE) device_type(nohost)
INTEGER :: I
@@ -14,7 +14,7 @@ FUNCTION FUNC_T_DEVICE() RESULT(I)
END FUNCTION FUNC_T_DEVICE
! DEVICE-LABEL: func.func @_QPfunc_enter_device()
-! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}
FUNCTION FUNC_ENTER_DEVICE() RESULT(I)
!$omp declare target enter(FUNC_ENTER_DEVICE) device_type(nohost)
INTEGER :: I
@@ -22,7 +22,7 @@ FUNCTION FUNC_ENTER_DEVICE() RESULT(I)
END FUNCTION FUNC_ENTER_DEVICE
! HOST-LABEL: func.func @_QPfunc_t_host()
-! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}
+! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}
FUNCTION FUNC_T_HOST() RESULT(I)
!$omp declare target to(FUNC_T_HOST) device_type(host)
INTEGER :: I
@@ -30,7 +30,7 @@ FUNCTION FUNC_T_HOST() RESULT(I)
END FUNCTION FUNC_T_HOST
! HOST-LABEL: func.func @_QPfunc_enter_host()
-! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}
+! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}
FUNCTION FUNC_ENTER_HOST() RESULT(I)
!$omp declare target enter(FUNC_ENTER_HOST) device_type(host)
INTEGER :: I
@@ -38,7 +38,7 @@ FUNCTION FUNC_ENTER_HOST() RESULT(I)
END FUNCTION FUNC_ENTER_HOST
! ALL-LABEL: func.func @_QPfunc_t_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
FUNCTION FUNC_T_ANY() RESULT(I)
!$omp declare target to(FUNC_T_ANY) device_type(any)
INTEGER :: I
@@ -46,7 +46,7 @@ FUNCTION FUNC_T_ANY() RESULT(I)
END FUNCTION FUNC_T_ANY
! ALL-LABEL: func.func @_QPfunc_enter_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>{{.*}}
FUNCTION FUNC_ENTER_ANY() RESULT(I)
!$omp declare target enter(FUNC_ENTER_ANY) device_type(any)
INTEGER :: I
@@ -54,7 +54,7 @@ FUNCTION FUNC_ENTER_ANY() RESULT(I)
END FUNCTION FUNC_ENTER_ANY
! ALL-LABEL: func.func @_QPfunc_default_t_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
FUNCTION FUNC_DEFAULT_T_ANY() RESULT(I)
!$omp declare target to(FUNC_DEFAULT_T_ANY)
INTEGER :: I
@@ -62,7 +62,7 @@ FUNCTION FUNC_DEFAULT_T_ANY() RESULT(I)
END FUNCTION FUNC_DEFAULT_T_ANY
! ALL-LABEL: func.func @_QPfunc_default_enter_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>{{.*}}
FUNCTION FUNC_DEFAULT_ENTER_ANY() RESULT(I)
!$omp declare target enter(FUNC_DEFAULT_ENTER_ANY)
INTEGER :: I
@@ -70,7 +70,7 @@ FUNCTION FUNC_DEFAULT_ENTER_ANY() RESULT(I)
END FUNCTION FUNC_DEFAULT_ENTER_ANY
! ALL-LABEL: func.func @_QPfunc_default_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
FUNCTION FUNC_DEFAULT_ANY() RESULT(I)
!$omp declare target
INTEGER :: I
@@ -78,7 +78,7 @@ FUNCTION FUNC_DEFAULT_ANY() RESULT(I)
END FUNCTION FUNC_DEFAULT_ANY
! ALL-LABEL: func.func @_QPfunc_default_extendedlist()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
FUNCTION FUNC_DEFAULT_EXTENDEDLIST() RESULT(I)
!$omp declare target(FUNC_DEFAULT_EXTENDEDLIST)
INTEGER :: I
@@ -86,7 +86,7 @@ FUNCTION FUNC_DEFAULT_EXTENDEDLIST() RESULT(I)
END FUNCTION FUNC_DEFAULT_EXTENDEDLIST
! ALL-LABEL: func.func @_QPfunc_name_as_result()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
FUNCTION FUNC_NAME_AS_RESULT()
!$omp declare target(FUNC_NAME_AS_RESULT)
FUNC_NAME_AS_RESULT = 1.0
@@ -99,61 +99,61 @@ END FUNCTION FUNC_NAME_AS_RESULT
! zero clause declare target
! DEVICE-LABEL: func.func @_QPsubr_t_device()
-! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}
SUBROUTINE SUBR_T_DEVICE()
!$omp declare target to(SUBR_T_DEVICE) device_type(nohost)
END
! DEVICE-LABEL: func.func @_QPsubr_enter_device()
-! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}
SUBROUTINE SUBR_ENTER_DEVICE()
!$omp declare target enter(SUBR_ENTER_DEVICE) device_type(nohost)
END
! HOST-LABEL: func.func @_QPsubr_t_host()
-! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>{{.*}}
+! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>{{.*}}
SUBROUTINE SUBR_T_HOST()
!$omp declare target to(SUBR_T_HOST) device_type(host)
END
! HOST-LABEL: func.func @_QPsubr_enter_host()
-! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>{{.*}}
+! HOST-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>{{.*}}
SUBROUTINE SUBR_ENTER_HOST()
!$omp declare target enter(SUBR_ENTER_HOST) device_type(host)
END
! ALL-LABEL: func.func @_QPsubr_t_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
SUBROUTINE SUBR_T_ANY()
!$omp declare target to(SUBR_T_ANY) device_type(any)
END
! ALL-LABEL: func.func @_QPsubr_enter_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>{{.*}}
SUBROUTINE SUBR_ENTER_ANY()
!$omp declare target enter(SUBR_ENTER_ANY) device_type(any)
END
! ALL-LABEL: func.func @_QPsubr_default_t_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
SUBROUTINE SUBR_DEFAULT_T_ANY()
!$omp declare target to(SUBR_DEFAULT_T_ANY)
END
! ALL-LABEL: func.func @_QPsubr_default_enter_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>{{.*}}
SUBROUTINE SUBR_DEFAULT_ENTER_ANY()
!$omp declare target enter(SUBR_DEFAULT_ENTER_ANY)
END
! ALL-LABEL: func.func @_QPsubr_default_any()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
SUBROUTINE SUBR_DEFAULT_ANY()
!$omp declare target
END
! ALL-LABEL: func.func @_QPsubr_default_extendedlist()
-! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}
+! ALL-SAME: {{.*}}attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}
SUBROUTINE SUBR_DEFAULT_EXTENDEDLIST()
!$omp declare target(SUBR_DEFAULT_EXTENDEDLIST)
END
@@ -161,7 +161,7 @@ SUBROUTINE SUBR_DEFAULT_EXTENDEDLIST()
!! -----
! DEVICE-LABEL: func.func @_QPrecursive_declare_target
-! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>{{.*}}
RECURSIVE FUNCTION RECURSIVE_DECLARE_TARGET(INCREMENT) RESULT(K)
!$omp declare target to(RECURSIVE_DECLARE_TARGET) device_type(nohost)
INTEGER :: INCREMENT, K
@@ -173,7 +173,7 @@ RECURSIVE FUNCTION RECURSIVE_DECLARE_TARGET(INCREMENT) RESULT(K)
END FUNCTION RECURSIVE_DECLARE_TARGET
! DEVICE-LABEL: func.func @_QPrecursive_declare_target_enter
-! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>{{.*}}
+! DEVICE-SAME: {{.*}}attributes {{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>{{.*}}
RECURSIVE FUNCTION RECURSIVE_DECLARE_TARGET_ENTER(INCREMENT) RESULT(K)
!$omp declare target enter(RECURSIVE_DECLARE_TARGET_ENTER) device_type(nohost)
INTEGER :: INCREMENT, K
diff --git a/flang/test/Lower/OpenMP/declare-target-multiple-entry.f90 b/flang/test/Lower/OpenMP/declare-target-multiple-entry.f90
index ba6b6693b087e..2c46e567d1b76 100644
--- a/flang/test/Lower/OpenMP/declare-target-multiple-entry.f90
+++ b/flang/test/Lower/OpenMP/declare-target-multiple-entry.f90
@@ -4,9 +4,9 @@
! Test that a bare '!$omp declare target' inside a multiple entry subprogram
! marks all entries as declare-target functions.
-! CHECK: func.func @_QPfirst_entry{{.*}}device_type = (any)
-! CHECK: func.func @_QPsecond_entry{{.*}}device_type = (any)
-! CHECK: func.func @_QPthird_entry{{.*}}device_type = (any)
+! CHECK: func.func @_QPfirst_entry{{.*}}omp.declare_target
+! CHECK: func.func @_QPsecond_entry{{.*}}omp.declare_target
+! CHECK: func.func @_QPthird_entry{{.*}}omp.declare_target
subroutine first_entry()
implicit none
diff --git a/flang/test/Lower/OpenMP/declare-target-unnamed-main.f90 b/flang/test/Lower/OpenMP/declare-target-unnamed-main.f90
index b7d6d2fa232ad..05b4efe80a81c 100644
--- a/flang/test/Lower/OpenMP/declare-target-unnamed-main.f90
+++ b/flang/test/Lower/OpenMP/declare-target-unnamed-main.f90
@@ -7,7 +7,7 @@
! appropriately mark the function as declare target, even when
! unused within the target region.
-!CHECK: func.func @_QPfoo(%{{.*}}: !fir.ref<f32>{{.*}}) -> f32 attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>{{.*}}}
+!CHECK: func.func @_QPfoo(%{{.*}}: !fir.ref<f32>{{.*}}) -> f32 attributes {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>{{.*}}}
interface
real function foo (x)
diff --git a/flang/test/Lower/OpenMP/omp-declare-target-program-var.f90 b/flang/test/Lower/OpenMP/omp-declare-target-program-var.f90
index d18f42ae3ceb0..43e2b1b0cc3b0 100644
--- a/flang/test/Lower/OpenMP/omp-declare-target-program-var.f90
+++ b/flang/test/Lower/OpenMP/omp-declare-target-program-var.f90
@@ -5,7 +5,7 @@ PROGRAM main
! HOST-DAG: %[[I_REF:.*]] = fir.alloca f32 {bindc_name = "i", uniq_name = "_QFEi"}
! HOST-DAG: %[[I_DECL:.*]]:2 = hlfir.declare %[[I_REF]] {uniq_name = "_QFEi"} : (!fir.ref<f32>) -> (!fir.ref<f32>, !fir.ref<f32>)
REAL :: I
- ! ALL-DAG: fir.global internal @_QFEi {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+ ! ALL-DAG: fir.global internal @_QFEi {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
! ALL-DAG: %[[UNDEF:.*]] = fir.zero_bits f32
! ALL-DAG: fir.has_value %[[UNDEF]] : f32
! ALL-DAG: }
diff --git a/flang/test/Transforms/omp-automap-to-target-data.fir b/flang/test/Transforms/omp-automap-to-target-data.fir
index 0939293a8f798..b6d98aa71b6f7 100644
--- a/flang/test/Transforms/omp-automap-to-target-data.fir
+++ b/flang/test/Transforms/omp-automap-to-target-data.fir
@@ -3,9 +3,9 @@
module {
fir.global
- @_QMtestEarr{omp.declare_target = #omp.declaretarget<device_type = (any),
- capture_clause = (enter), automap = true>} target
- : !fir.box<!fir.heap<!fir.array<?xi32>>>
+ @_QMtestEarr {omp.declare_target = #omp.declaretarget<capture_clause = enter,
+ device_type = any, automap = true>} target
+ : !fir.box<!fir.heap<!fir.array<?xi32>>>
func.func @automap() {
%c0 = arith.constant 0 : index
diff --git a/flang/test/Transforms/omp-function-filtering-todo.mlir b/flang/test/Transforms/omp-function-filtering-todo.mlir
index 64efad742002a..ee2c245e304e7 100644
--- a/flang/test/Transforms/omp-function-filtering-todo.mlir
+++ b/flang/test/Transforms/omp-function-filtering-todo.mlir
@@ -56,7 +56,7 @@ module attributes {omp.is_gpu = true, omp.is_target_device = true} {
omp.yield(%arg0 : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>)
}
- func.func @f2(%ia : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>} {
+ func.func @f2(%ia : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter, automap = false>} {
%c1_i32 = arith.constant 1 : i32
omp.wsloop reduction(byref @red2 %ia -> %arg0 : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>) {
omp.loop_nest (%arg1) : i32 = (%c1_i32) to (%c1_i32) inclusive step (%c1_i32) {
diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPAttrDefs.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPAttrDefs.td
index 55895add86dc4..a7c865dc3b11c 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPAttrDefs.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPAttrDefs.td
@@ -43,8 +43,8 @@ def AtomicControlAttr : OpenMP_Attr<"AtomicControl", "atomic_control"> {
def DeclareTargetAttr : OpenMP_Attr<"DeclareTarget", "declaretarget"> {
let parameters =
- (ins OptionalParameter<"DeclareTargetDeviceTypeAttr">:$device_type,
- OptionalParameter<"DeclareTargetCaptureClauseAttr">:$capture_clause,
+ (ins "mlir::omp::DeclareTargetDeviceType":$device_type,
+ "mlir::omp::DeclareTargetCaptureClause":$capture_clause,
DefaultValuedParameter<"bool", "false">:$automap,
DefaultValuedParameter<"bool", "false">:$implicit);
diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
index 66730ae52d8ee..88c032fe8c334 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOpsInterfaces.td
@@ -379,73 +379,28 @@ def DeclareTargetInterface : OpInterface<"DeclareTargetInterface"> {
"bool":$automap, "bool":$implicit), [{}], [{
$_op->setAttr("omp.declare_target",
mlir::omp::DeclareTargetAttr::get(
- $_op->getContext(),
- mlir::omp::DeclareTargetDeviceTypeAttr::get(
- $_op->getContext(), deviceType),
- mlir::omp::DeclareTargetCaptureClauseAttr::get(
- $_op->getContext(), captureClause),
- automap, implicit));
+ $_op->getContext(), deviceType, captureClause, automap,
+ implicit));
}]>,
- InterfaceMethod<
- /*description=*/[{
- Checks if the declare target attribute has been applied and exists on the
- current operation. Returns true if it exists on it, otherwise returns
- false.
- }],
- /*retTy=*/"bool",
- /*methodName=*/"isDeclareTarget",
- (ins), [{}], [{
- return $_op->hasAttr("omp.declare_target");
- }]>,
- InterfaceMethod<
- /*description=*/[{
- Returns the DeclareTargetDeviceType segment of the DeclareTarget attribute if it
- exists on the current operation. Otherwise it returns null.
- }],
- /*retTy=*/"mlir::omp::DeclareTargetDeviceType",
- /*methodName=*/"getDeclareTargetDeviceType",
- (ins), [{}], [{
- if (mlir::Attribute dTar = $_op->getAttr("omp.declare_target"))
- if (auto dAttr = llvm::dyn_cast_or_null<mlir::omp::DeclareTargetAttr>(dTar))
- return dAttr.getDeviceType().getValue();
- return {};
- }]>,
- InterfaceMethod<
- /*description=*/[{
- Returns the DeclareTargetCaptureClause segment of the DeclareTarget attribute if it
- exists on the current operation. Otherwise it returns null.
- }],
- /*retTy=*/"mlir::omp::DeclareTargetCaptureClause",
- /*methodName=*/"getDeclareTargetCaptureClause",
- (ins), [{}], [{
- if (mlir::Attribute dTar = $_op->getAttr("omp.declare_target"))
- if (auto dAttr = llvm::dyn_cast_or_null<mlir::omp::DeclareTargetAttr>(dTar))
- return dAttr.getCaptureClause().getValue();
- return {};
- }]>,
- InterfaceMethod<
+ InterfaceMethod<
/*description=*/[{
- Return true if the DeclareTarget attribute has the AUTOMAP modifier.
+ Set the declare target attribute on the current operation.
}],
- /*retTy=*/"bool",
- /*methodName=*/"getDeclareTargetAutomap",
- (ins), [{}], [{
- if (mlir::Attribute dTar = $_op->getAttr("omp.declare_target"))
- if (auto dAttr = llvm::dyn_cast_or_null<mlir::omp::DeclareTargetAttr>(dTar))
- return dAttr.getAutomap();
- return false;
+ /*retTy=*/"void",
+ /*methodName=*/"setDeclareTarget",
+ (ins "mlir::omp::DeclareTargetAttr":$attr), [{}], [{
+ $_op->setAttr("omp.declare_target", attr);
}]>,
- InterfaceMethod<
+ InterfaceMethod<
/*description=*/[{
- Return true if the DeclareTarget attribute has been implicitly added.
+ Returns the declare target attribute if has been applied to the current
+ operation. Otherwise, it returns null.
}],
- /*retTy=*/"bool",
- /*methodName=*/"isImplicitDeclareTarget",
+ /*retTy=*/"mlir::omp::DeclareTargetAttr",
+ /*methodName=*/"getDeclareTarget",
(ins), [{}], [{
- if (mlir::Attribute dTar = $_op->getAttr("omp.declare_target"))
- if (auto dAttr = llvm::dyn_cast_or_null<mlir::omp::DeclareTargetAttr>(dTar))
- return dAttr.getImplicit();
- return false;
+ return llvm::cast_if_present<mlir::omp::DeclareTargetAttr>(
+ $_op->getAttr("omp.declare_target"));
}]>
];
}
diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index f06c665c7013b..35aeb932b9732 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -363,7 +363,7 @@ static LogicalResult verifyDeclareTargetAttr(Operation *op, Attribute attr) {
<< "omp.declare_target 'automap' is not valid on functions";
// TODO: Disallow the `local` clause (OpenMP 6.0).
- if (declareTargetAttr.getCaptureClause().getValue() ==
+ if (declareTargetAttr.getCaptureClause() ==
mlir::omp::DeclareTargetCaptureClause::link)
return op->emitOpError()
<< "omp.declare_target 'link' is not valid on functions";
diff --git a/mlir/lib/Dialect/OpenMP/Transforms/FunctionFiltering.cpp b/mlir/lib/Dialect/OpenMP/Transforms/FunctionFiltering.cpp
index 3b236dd69f425..626d54aa9de53 100644
--- a/mlir/lib/Dialect/OpenMP/Transforms/FunctionFiltering.cpp
+++ b/mlir/lib/Dialect/OpenMP/Transforms/FunctionFiltering.cpp
@@ -55,8 +55,10 @@ class FunctionFilteringPass
omp::DeclareTargetDeviceType::host;
auto declareTargetOp =
dyn_cast<omp::DeclareTargetInterface>(funcOp.getOperation());
- if (declareTargetOp && declareTargetOp.isDeclareTarget())
- declareType = declareTargetOp.getDeclareTargetDeviceType();
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp ? declareTargetOp.getDeclareTarget() : nullptr;
+ if (declareTargetAttr)
+ declareType = declareTargetAttr.getDeviceType();
// Only filter host functions from device modules because the host needs
// to provide fallback implementations of device code.
@@ -98,7 +100,7 @@ class FunctionFilteringPass
// marked as such to perform the second stage removal them from the device
// module, where functions that contain target regions are deleted from
// the generated LLVM IR.
- if (declareTargetOp && !declareTargetOp.isDeclareTarget())
+ if (declareTargetOp && !declareTargetAttr)
declareTargetOp.setDeclareTarget(omp::DeclareTargetDeviceType::host,
omp::DeclareTargetCaptureClause::to,
/*automap=*/false, /*implicit=*/true);
diff --git a/mlir/lib/Dialect/OpenMP/Transforms/HostOpFiltering.cpp b/mlir/lib/Dialect/OpenMP/Transforms/HostOpFiltering.cpp
index 9c61b2717af57..f7be1fdadfdb3 100644
--- a/mlir/lib/Dialect/OpenMP/Transforms/HostOpFiltering.cpp
+++ b/mlir/lib/Dialect/OpenMP/Transforms/HostOpFiltering.cpp
@@ -78,8 +78,10 @@ static void collectRewrite(Value value, llvm::SetVector<Value> &rewrites) {
static std::optional<omp::DeclareTargetDeviceType>
getDeclareTargetDevice(Operation &op) {
auto declareTargetOp = dyn_cast<omp::DeclareTargetInterface>(op);
- if (declareTargetOp && declareTargetOp.isDeclareTarget())
- return declareTargetOp.getDeclareTargetDeviceType();
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp ? declareTargetOp.getDeclareTarget() : nullptr;
+ if (declareTargetAttr)
+ return declareTargetAttr.getDeviceType();
return std::nullopt;
}
diff --git a/mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp b/mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
index d988752da84b9..e1395ebe4eb15 100644
--- a/mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
+++ b/mlir/lib/Dialect/OpenMP/Transforms/MarkDeclareTarget.cpp
@@ -218,15 +218,17 @@ class MarkDeclareTargetPass
for (auto funcOp : getOperation().getOps<FunctionOpInterface>()) {
auto declareTargetOp =
llvm::dyn_cast<omp::DeclareTargetInterface>(funcOp.getOperation());
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp ? declareTargetOp.getDeclareTarget() : nullptr;
- if (!declareTargetOp || !declareTargetOp.isDeclareTarget())
+ if (!declareTargetAttr)
continue;
// Add to the worklist all called functions with the declare_target
// information of this one, so it gets propagated.
for (auto &callee : calls[funcOp.getName()])
worklist.push_back(
- {callee.getKey(), declareTargetOp.getDeclareTargetDeviceType()});
+ {callee.getKey(), declareTargetAttr.getDeviceType()});
}
// Add to the worklist all functions reached from target regions.
@@ -248,15 +250,17 @@ class MarkDeclareTargetPass
// declare_target information to functions for which the user hasn't
// specified an explicit behavior.
auto declareTargetOp = dyn_cast<omp::DeclareTargetInterface>(*funcOp);
- if (!declareTargetOp || (declareTargetOp.isDeclareTarget() &&
- !declareTargetOp.isImplicitDeclareTarget()))
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetOp ? declareTargetOp.getDeclareTarget() : nullptr;
+ if (!declareTargetOp ||
+ (declareTargetAttr && !declareTargetAttr.getImplicit()))
continue;
omp::DeclareTargetDeviceType changedDeviceType;
- if (declareTargetOp.isDeclareTarget()) {
+ if (declareTargetAttr) {
// Implicit declare_target update.
omp::DeclareTargetDeviceType currentDeviceType =
- declareTargetOp.getDeclareTargetDeviceType();
+ declareTargetAttr.getDeviceType();
// Skip the update (and adding callees to the worklist) if the added
// info doesn't change anything.
diff --git a/mlir/lib/Dialect/OpenMP/Utils/Utils.cpp b/mlir/lib/Dialect/OpenMP/Utils/Utils.cpp
index 481efdba89e1e..52974c741bc75 100644
--- a/mlir/lib/Dialect/OpenMP/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/OpenMP/Utils/Utils.cpp
@@ -132,9 +132,10 @@ bool mlir::omp::opInSharedDeviceContext(Operation &op) {
return false;
} else {
auto declTargetIface = op.getParentOfType<omp::DeclareTargetInterface>();
- if (!declTargetIface || !declTargetIface.isDeclareTarget() ||
- declTargetIface.getDeclareTargetDeviceType() ==
- omp::DeclareTargetDeviceType::host)
+ omp::DeclareTargetAttr declTargetAttr =
+ declTargetIface ? declTargetIface.getDeclareTarget() : nullptr;
+ if (!declTargetAttr ||
+ declTargetAttr.getDeviceType() == omp::DeclareTargetDeviceType::host)
return false;
}
return true;
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index 47a8493708d0f..754daa406ba70 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -6945,22 +6945,28 @@ getDeclareTargetRefPtrSuffix(LLVM::GlobalOp globalOp,
static bool isDeclareTargetLink(Value value) {
if (auto declareTargetGlobal =
dyn_cast_if_present<omp::DeclareTargetInterface>(
- getGlobalOpFromValue(value)))
- if (declareTargetGlobal.getDeclareTargetCaptureClause() ==
- omp::DeclareTargetCaptureClause::link)
+ getGlobalOpFromValue(value))) {
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetGlobal.getDeclareTarget();
+ if (declareTargetAttr && declareTargetAttr.getCaptureClause() ==
+ omp::DeclareTargetCaptureClause::link)
return true;
+ }
return false;
}
static bool isDeclareTargetTo(Value value) {
if (auto declareTargetGlobal =
dyn_cast_if_present<omp::DeclareTargetInterface>(
- getGlobalOpFromValue(value)))
- if (declareTargetGlobal.getDeclareTargetCaptureClause() ==
- omp::DeclareTargetCaptureClause::to ||
- declareTargetGlobal.getDeclareTargetCaptureClause() ==
- omp::DeclareTargetCaptureClause::enter)
+ getGlobalOpFromValue(value))) {
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetGlobal.getDeclareTarget();
+ if (declareTargetAttr && (declareTargetAttr.getCaptureClause() ==
+ omp::DeclareTargetCaptureClause::to ||
+ declareTargetAttr.getCaptureClause() ==
+ omp::DeclareTargetCaptureClause::enter))
return true;
+ }
return false;
}
@@ -9725,8 +9731,7 @@ convertDeclareTargetAttr(Operation *op, mlir::omp::DeclareTargetAttr attribute,
if (!offloadMod.getIsTargetDevice())
return success();
- omp::DeclareTargetDeviceType declareType =
- attribute.getDeviceType().getValue();
+ omp::DeclareTargetDeviceType declareType = attribute.getDeviceType();
if (declareType == omp::DeclareTargetDeviceType::host) {
llvm::Function *llvmFunc =
@@ -9769,10 +9774,9 @@ convertDeclareTargetAttr(Operation *op, mlir::omp::DeclareTargetAttr attribute,
auto loc = op->getLoc()->findInstanceOf<FileLineColLoc>();
llvm::StringRef mangledName = gOp.getSymName();
mlir::omp::DeclareTargetCaptureClause captureClause =
- attribute.getCaptureClause().getValue();
+ attribute.getCaptureClause();
auto captureClauseKind = convertToCaptureClauseKind(captureClause);
- auto deviceClause =
- convertToDeviceClauseKind(attribute.getDeviceType().getValue());
+ auto deviceClause = convertToDeviceClauseKind(attribute.getDeviceType());
llvm::StringRef entryMangledName = mangledName;
llvm::Constant *entryAddr = llvm::cast<llvm::Constant>(gVal);
std::function<llvm::GlobalValue::LinkageTypes()> variableLinkage;
@@ -9781,8 +9785,8 @@ convertDeclareTargetAttr(Operation *op, mlir::omp::DeclareTargetAttr attribute,
bool isToOrEnter =
captureClause == omp::DeclareTargetCaptureClause::to ||
captureClause == omp::DeclareTargetCaptureClause::enter;
- bool isHostOnly = attribute.getDeviceType().getValue() ==
- omp::DeclareTargetDeviceType::host;
+ bool isHostOnly =
+ attribute.getDeviceType() == omp::DeclareTargetDeviceType::host;
// A to/enter declare-target variable needs a device-resident,
// name-resolvable copy and a host offloading entry. A local-linkage
@@ -10070,11 +10074,13 @@ static bool isHostDeviceOp(Operation *op) {
if (auto parentFn = op->getParentOfType<LLVM::LLVMFuncOp>()) {
if (auto declareTargetIface =
llvm::dyn_cast<mlir::omp::DeclareTargetInterface>(
- parentFn.getOperation()))
- if (declareTargetIface.isDeclareTarget() &&
- declareTargetIface.getDeclareTargetDeviceType() !=
- mlir::omp::DeclareTargetDeviceType::host)
+ parentFn.getOperation())) {
+ omp::DeclareTargetAttr declareTargetAttr =
+ declareTargetIface.getDeclareTarget();
+ if (declareTargetAttr && declareTargetAttr.getDeviceType() !=
+ mlir::omp::DeclareTargetDeviceType::host)
return false;
+ }
return true;
}
diff --git a/mlir/test/Dialect/OpenMP/attr.mlir b/mlir/test/Dialect/OpenMP/attr.mlir
index 8c6f25f3bcaab..a17112df4a3f5 100644
--- a/mlir/test/Dialect/OpenMP/attr.mlir
+++ b/mlir/test/Dialect/OpenMP/attr.mlir
@@ -66,100 +66,100 @@ module attributes {omp.version = #omp.version<version = 51>} {}
// ----
// CHECK-LABEL: func @omp_decl_tar_host_to
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
-func.func @omp_decl_tar_host_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
+func.func @omp_decl_tar_host_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
return
}
// CHECK-LABEL: func @omp_decl_tar_host_enter
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>} {
-func.func @omp_decl_tar_host_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>} {
+func.func @omp_decl_tar_host_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>} {
return
}
// CHECK-LABEL: func @omp_decl_tar_nohost_to
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} {
-func.func @omp_decl_tar_nohost_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} {
+func.func @omp_decl_tar_nohost_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} {
return
}
// CHECK-LABEL: func @omp_decl_tar_nohost_enter
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>} {
-func.func @omp_decl_tar_nohost_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>} {
+func.func @omp_decl_tar_nohost_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>} {
return
}
// CHECK-LABEL: func @omp_decl_tar_any_to
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
-func.func @omp_decl_tar_any_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
+func.func @omp_decl_tar_any_to() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
return
}
// CHECK-LABEL: func @omp_decl_tar_any_enter
-// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
-func.func @omp_decl_tar_any_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+// CHECK-SAME: {{.*}} attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
+func.func @omp_decl_tar_any_enter() -> () attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
return
}
// CHECK-LABEL: global external @omp_decl_tar_data_host_to
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>}
-llvm.mlir.global external @omp_decl_tar_data_host_to() {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>}
+llvm.mlir.global external @omp_decl_tar_data_host_to() {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_host_link
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (link)>}
-llvm.mlir.global external @omp_decl_tar_data_host_link() {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (link)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = link>}
+llvm.mlir.global external @omp_decl_tar_data_host_link() {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_host_enter
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>}
-llvm.mlir.global external @omp_decl_tar_data_host_enter() {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>}
+llvm.mlir.global external @omp_decl_tar_data_host_enter() {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_nohost_to
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>}
-llvm.mlir.global external @omp_decl_tar_data_nohost_to() {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>}
+llvm.mlir.global external @omp_decl_tar_data_nohost_to() {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_nohost_link
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (link)>}
-llvm.mlir.global external @omp_decl_tar_data_nohost_link() {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (link)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = link>}
+llvm.mlir.global external @omp_decl_tar_data_nohost_link() {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_nohost_enter
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>}
-llvm.mlir.global external @omp_decl_tar_data_nohost_enter() {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>}
+llvm.mlir.global external @omp_decl_tar_data_nohost_enter() {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_any_to
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>}
-llvm.mlir.global external @omp_decl_tar_data_any_to() {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>}
+llvm.mlir.global external @omp_decl_tar_data_any_to() {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_any_link
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>}
-llvm.mlir.global external @omp_decl_tar_data_any_link() {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>}
+llvm.mlir.global external @omp_decl_tar_data_any_link() {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-LABEL: global external @omp_decl_tar_data_any_enter
-// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>}
-llvm.mlir.global external @omp_decl_tar_data_any_enter() {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+// CHECK-SAME: {{.*}} {{{.*}}omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>}
+llvm.mlir.global external @omp_decl_tar_data_any_enter() {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
diff --git a/mlir/test/Dialect/OpenMP/function-filter.mlir b/mlir/test/Dialect/OpenMP/function-filter.mlir
index eec48d24ef963..0e5d370be2043 100644
--- a/mlir/test/Dialect/OpenMP/function-filter.mlir
+++ b/mlir/test/Dialect/OpenMP/function-filter.mlir
@@ -20,21 +20,21 @@ module attributes {omp.is_target_device = true} {
llvm.func @any() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (any), capture_clause = (to)>
+ #omp.declaretarget<device_type = any, capture_clause = to>
} {
llvm.return
}
llvm.func @nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
llvm.return
}
llvm.func @host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
llvm.return
}
@@ -44,7 +44,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @nohost_target() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
omp.target kernel_type(generic) {
omp.terminator
@@ -54,7 +54,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @host_target() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
omp.target kernel_type(generic) {
omp.terminator
@@ -71,7 +71,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @host_target_call() -> i32
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
omp.target kernel_type(generic) {
omp.terminator
@@ -101,21 +101,21 @@ module attributes {omp.is_target_device = false} {
llvm.func @any() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (any), capture_clause = (to)>
+ #omp.declaretarget<device_type = any, capture_clause = to>
} {
llvm.return
}
llvm.func @nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
llvm.return
}
llvm.func @host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
llvm.return
}
@@ -125,7 +125,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @nohost_target() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
omp.target kernel_type(generic) {
omp.terminator
@@ -135,7 +135,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @host_target() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
omp.target kernel_type(generic) {
omp.terminator
diff --git a/mlir/test/Dialect/OpenMP/host-op-filtering.mlir b/mlir/test/Dialect/OpenMP/host-op-filtering.mlir
index 8ef6df39094cd..b8ee91b94ac2f 100644
--- a/mlir/test/Dialect/OpenMP/host-op-filtering.mlir
+++ b/mlir/test/Dialect/OpenMP/host-op-filtering.mlir
@@ -462,7 +462,7 @@ module attributes {omp.is_target_device = true} {
llvm.return
}
- llvm.func @foo() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>, sym_visibility = "private"}
+ llvm.func @foo() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>, sym_visibility = "private"}
omp.private {type = firstprivate} @privatizer : i32 copy {
^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
%0 = llvm.load %arg0 : !llvm.ptr -> i32
@@ -489,16 +489,16 @@ module attributes {omp.is_target_device = true} {
// CHECK: llvm.mlir.global external @declare_target_enter_any
// CHECK: llvm.mlir.global external @declare_target_enter_host
// CHECK: llvm.mlir.global external @declare_target_enter_nohost
- llvm.mlir.global external @declare_target_enter_any() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter), automap = false>} : i32
- llvm.mlir.global external @declare_target_enter_host() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter), automap = false>} : i32
- llvm.mlir.global external @declare_target_enter_nohost() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter), automap = false>} : i32
+ llvm.mlir.global external @declare_target_enter_any() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter, automap = false>} : i32
+ llvm.mlir.global external @declare_target_enter_host() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter, automap = false>} : i32
+ llvm.mlir.global external @declare_target_enter_nohost() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter, automap = false>} : i32
// CHECK: llvm.mlir.global external @declare_target_link_any
// CHECK: llvm.mlir.global external @declare_target_link_host
// CHECK: llvm.mlir.global external @declare_target_link_nohost
- llvm.mlir.global external @declare_target_link_any() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link), automap = false>} : i32
- llvm.mlir.global external @declare_target_link_host() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (link), automap = false>} : i32
- llvm.mlir.global external @declare_target_link_nohost() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (link), automap = false>} : i32
+ llvm.mlir.global external @declare_target_link_any() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link, automap = false>} : i32
+ llvm.mlir.global external @declare_target_link_host() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = link, automap = false>} : i32
+ llvm.mlir.global external @declare_target_link_nohost() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = link, automap = false>} : i32
llvm.func @LangRTPlaceholderFunc(!llvm.ptr {llvm.nocapture}, !llvm.ptr {llvm.nocapture}, !llvm.ptr, i8 {llvm.signext}, i32) attributes {sym_visibility = "private"}
}
diff --git a/mlir/test/Dialect/OpenMP/invalid-interface.mlir b/mlir/test/Dialect/OpenMP/invalid-interface.mlir
index 787b6a7ec00ce..567cf5b8c9707 100644
--- a/mlir/test/Dialect/OpenMP/invalid-interface.mlir
+++ b/mlir/test/Dialect/OpenMP/invalid-interface.mlir
@@ -108,7 +108,7 @@ func.func @composable_conditional_combined(%x : i32) {
// -----
// expected-error @below {{omp.declare_target can only be applied to DeclareTargetInterface ops}}
-%0 = arith.constant { omp.declare_target = #omp.declaretarget<capture_clause = (enter)> } 2 : i32
+%0 = arith.constant { omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter> } 2 : i32
// -----
@@ -118,17 +118,17 @@ func.func private @declare_target_attr_type() attributes { omp.declare_target =
// -----
// expected-error @below {{omp.declare_target 'automap' is not valid on functions}}
-func.func private @declare_target_automap() attributes { omp.declare_target = #omp.declaretarget<automap = true>}
+func.func private @declare_target_automap() attributes { omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter, automap = true>}
// -----
// expected-error @below {{omp.declare_target 'link' is not valid on functions}}
-func.func private @declare_target_link() attributes { omp.declare_target = #omp.declaretarget<capture_clause = (link)>}
+func.func private @declare_target_link() attributes { omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>}
// -----
// expected-error @below {{omp.declare_target 'implicit' is only valid on functions}}
-llvm.mlir.global @declare_target_implicit() {omp.declare_target = #omp.declaretarget<implicit = true>} : i32 {
+llvm.mlir.global @declare_target_implicit() {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter, implicit = true>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
diff --git a/mlir/test/Dialect/OpenMP/mark-declare-target.mlir b/mlir/test/Dialect/OpenMP/mark-declare-target.mlir
index a50e4678aa37d..2509354a9c862 100644
--- a/mlir/test/Dialect/OpenMP/mark-declare-target.mlir
+++ b/mlir/test/Dialect/OpenMP/mark-declare-target.mlir
@@ -17,23 +17,23 @@ omp.private {type = firstprivate} @priv : !llvm.struct<(ptr)> init {
}
// CHECK: llvm.func {{.*}}@priv_callee_nested()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee_nested() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@priv_callee_init()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee_init() attributes {sym_visibility = "private"} {
llvm.call @priv_callee_nested() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@priv_callee_copy()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee_copy() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@priv_callee_dealloc()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee_dealloc() attributes {sym_visibility = "private"} {
llvm.return
}
@@ -74,31 +74,31 @@ cleanup {
}
// CHECK: llvm.func {{.*}}@red_callee_nested()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>
llvm.func @red_callee_nested() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@red_callee_init()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>
llvm.func @red_callee_init() attributes {sym_visibility = "private"} {
llvm.call @red_callee_nested() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@red_callee_combiner()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>
llvm.func @red_callee_combiner() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@red_callee_cleanup()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>
llvm.func @red_callee_cleanup() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@main(
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>
llvm.func @main(%arg0 : !llvm.ptr) attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to)>} {
+ device_type = host, capture_clause = to>} {
omp.parallel reduction(@red %arg0 -> %arg1 : !llvm.ptr) {
omp.terminator
}
@@ -138,24 +138,24 @@ cleanup {
}
// CHECK: llvm.func {{.*}}@red_callee_nested2()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @red_callee_nested2() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@red_callee_nested()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @red_callee_nested() attributes {sym_visibility = "private"} {
llvm.call @red_callee_nested2() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@red_callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @red_callee() attributes {sym_visibility = "private"} {
llvm.call @red_callee_nested() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@priv_callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee() attributes {sym_visibility = "private"} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr
@@ -165,7 +165,7 @@ llvm.func @priv_callee() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@main_callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @main_callee() attributes {sym_visibility = "private"} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr
@@ -175,10 +175,10 @@ llvm.func @main_callee() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@main()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>
llvm.func @main() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (nohost), capture_clause = (to)>} {
+ device_type = nohost, capture_clause = to>} {
llvm.call @main_callee() : () -> ()
llvm.return
}
@@ -208,18 +208,18 @@ llvm.func @main() {
// If they aren't compatible, this is a user error.
// CHECK: llvm.func {{.*}}@callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>
llvm.func @callee() attributes {
sym_visibility = "private",
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to)>} {
+ device_type = host, capture_clause = to>} {
llvm.return
}
// CHECK: llvm.func {{.*}}@main()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>
llvm.func @main() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (nohost), capture_clause = (to)>} {
+ device_type = nohost, capture_clause = to>} {
llvm.call @callee() : () -> ()
llvm.return
}
@@ -230,29 +230,29 @@ llvm.func @main() attributes {
// device_type(any) and it propagates to nested callees.
// CHECK: llvm.func {{.*}}@callee_nested()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @callee_nested() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @callee() attributes {sym_visibility = "private"} {
llvm.call @callee_nested() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@fn_host()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>
llvm.func @fn_host() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to)>} {
+ device_type = host, capture_clause = to>} {
llvm.call @callee() : () -> ()
llvm.return
}
// CHECK: llvm.func {{.*}}@fn_nohost()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>
llvm.func @fn_nohost() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (nohost), capture_clause = (to)>} {
+ device_type = nohost, capture_clause = to>} {
llvm.call @callee() : () -> ()
llvm.return
}
@@ -262,34 +262,34 @@ llvm.func @fn_nohost() attributes {
// Always use implicit device_type(any) for external and public functions.
// CHECK: llvm.func {{.*}}@external_host()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @external_host()
// CHECK: llvm.func {{.*}}@external_nohost()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @external_nohost()
// CHECK: llvm.func {{.*}}@external_both()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @external_both()
// CHECK: llvm.func {{.*}}@public_host()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @public_host() {
llvm.return
}
// CHECK: llvm.func {{.*}}@public_nohost()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @public_nohost() {
llvm.return
}
// CHECK: llvm.func {{.*}}@public_both()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @public_both() {
llvm.return
}
// CHECK: llvm.func {{.*}}@fn_host()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>
llvm.func @fn_host() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to)>} {
+ device_type = host, capture_clause = to>} {
llvm.call @external_host() : () -> ()
llvm.call @external_both() : () -> ()
llvm.call @public_host() : () -> ()
@@ -297,10 +297,10 @@ llvm.func @fn_host() attributes {
llvm.return
}
// CHECK: llvm.func {{.*}}@fn_nohost()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>
llvm.func @fn_nohost() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (nohost), capture_clause = (to)>} {
+ device_type = nohost, capture_clause = to>} {
llvm.call @external_nohost() : () -> ()
llvm.call @external_both() : () -> ()
llvm.call @public_nohost() : () -> ()
@@ -340,19 +340,19 @@ cleanup {
}
// CHECK: llvm.func {{.*}}@red_callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to, implicit = true>
llvm.func @red_callee() attributes {sym_visibility = "private"} {
llvm.return
}
// CHECK: llvm.func {{.*}}@priv_callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to, implicit = true>
llvm.func @priv_callee() attributes {sym_visibility = "private"} {
llvm.return
}
llvm.func @main(%arg0 : !llvm.ptr) attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to)>} {
+ device_type = host, capture_clause = to>} {
%0 = omp.map.info var_ptr(%arg0 : !llvm.ptr, i32) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr
omp.target kernel_type(generic) in_reduction(@red %arg0 : !llvm.ptr)
map_entries(%0 -> %arg1 : !llvm.ptr)
@@ -368,18 +368,18 @@ llvm.func @main(%arg0 : !llvm.ptr) attributes {
// pass.
// CHECK: llvm.func {{.*}}@callee()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to), implicit = true>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to, implicit = true>
llvm.func @callee() attributes {
sym_visibility = "private",
omp.declare_target = #omp.declaretarget<
- device_type = (host), capture_clause = (to), implicit = true>} {
+ device_type = host, capture_clause = to, implicit = true>} {
llvm.return
}
// CHECK: llvm.func {{.*}}@main()
-// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+// CHECK-SAME: omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>
llvm.func @main() attributes {
omp.declare_target = #omp.declaretarget<
- device_type = (nohost), capture_clause = (to)>} {
+ device_type = nohost, capture_clause = to>} {
llvm.call @callee() : () -> ()
llvm.return
}
diff --git a/mlir/test/Dialect/OpenMP/stack-to-shared.mlir b/mlir/test/Dialect/OpenMP/stack-to-shared.mlir
index 972d3fe39e7bc..2f71674e6257f 100644
--- a/mlir/test/Dialect/OpenMP/stack-to-shared.mlir
+++ b/mlir/test/Dialect/OpenMP/stack-to-shared.mlir
@@ -25,11 +25,11 @@ omp.private {type = firstprivate} @firstprivatizer_f32 : !llvm.ptr copy {
omp.yield(%arg0 : !llvm.ptr)
}
-llvm.func @foo(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>}
+llvm.func @foo(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>}
// CHECK-LABEL: llvm.func @device_func(
// CHECK-SAME: %[[N:.*]]: i64, %[[COND:.*]]: i1)
-llvm.func @device_func(%arg0: i64, %cond: i1) attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} {
+llvm.func @device_func(%arg0: i64, %cond: i1) attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} {
// CHECK: %[[ALLOC0:.*]] = omp.alloc_shared_mem %[[N]] x i64 : (i64) -> !llvm.ptr
%0 = llvm.alloca %arg0 x i64 : (i64) -> !llvm.ptr
// CHECK: %[[ALLOC1:.*]] = omp.alloc_shared_mem %[[N]] x f32 : (i64) align(128) -> !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-atomic-capture-control-options.mlir b/mlir/test/Target/LLVMIR/omptarget-atomic-capture-control-options.mlir
index 01a46dacb4346..1145a9800deeb 100644
--- a/mlir/test/Target/LLVMIR/omptarget-atomic-capture-control-options.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-atomic-capture-control-options.mlir
@@ -3,7 +3,7 @@
// CHECK: atomicrmw add ptr %loadgep_, i32 1 monotonic, align 4, !amdgpu.no.remote.memory !{{.*}}
module attributes {dlti.dl_spec = #dlti.dl_spec<!llvm.ptr = dense<64> : vector<4xi64>, !llvm.ptr<1> = dense<64> : vector<4xi64>, !llvm.ptr<2> = dense<32> : vector<4xi64>, !llvm.ptr<3> = dense<32> : vector<4xi64>, !llvm.ptr<4> = dense<64> : vector<4xi64>, !llvm.ptr<5> = dense<32> : vector<4xi64>, !llvm.ptr<6> = dense<32> : vector<4xi64>, !llvm.ptr<7> = dense<[160, 256, 256, 32]> : vector<4xi64>, !llvm.ptr<8> = dense<[128, 128, 128, 48]> : vector<4xi64>, !llvm.ptr<9> = dense<[192, 256, 256, 32]> : vector<4xi64>, i64 = dense<64> : vector<2xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.legal_int_widths" = array<i32: 32, 64>, "dlti.stack_alignment" = 32 : i64, "dlti.alloca_memory_space" = 5 : ui64, "dlti.global_memory_space" = 1 : ui64>, fir.atomic_fine_grained_memory, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", fir.target_cpu = "generic-hsa", llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9", llvm.target_triple = "amdgcn-amd-amdhsa", omp.flags = #omp.flags<openmp_device_version = 31>, omp.is_gpu = true, omp.is_target_device = true, omp.requires = #omp<clause_requires none>, omp.target_triples = [], omp.version = #omp.version<version = 31>} {
- llvm.func @_QQmain() attributes {fir.bindc_name = "TEST", omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "generic-hsa"} {
+ llvm.func @_QQmain() attributes {fir.bindc_name = "TEST", omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "generic-hsa"} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "threads"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-atomic-update-control-options.mlir b/mlir/test/Target/LLVMIR/omptarget-atomic-update-control-options.mlir
index 45fbb2e1fbe89..bf6c36cf768a1 100644
--- a/mlir/test/Target/LLVMIR/omptarget-atomic-update-control-options.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-atomic-update-control-options.mlir
@@ -3,7 +3,7 @@
// CHECK: atomicrmw add ptr %loadgep_, i32 1 monotonic, align 4, !amdgpu.ignore.denormal.mode !{{.*}}, !amdgpu.no.fine.grained.memory !{{.*}}, !amdgpu.no.remote.memory !{{.*}}
module attributes {dlti.dl_spec = #dlti.dl_spec<!llvm.ptr = dense<64> : vector<4xi64>, !llvm.ptr<1> = dense<64> : vector<4xi64>, !llvm.ptr<2> = dense<32> : vector<4xi64>, !llvm.ptr<3> = dense<32> : vector<4xi64>, !llvm.ptr<4> = dense<64> : vector<4xi64>, !llvm.ptr<5> = dense<32> : vector<4xi64>, !llvm.ptr<6> = dense<32> : vector<4xi64>, !llvm.ptr<7> = dense<[160, 256, 256, 32]> : vector<4xi64>, !llvm.ptr<8> = dense<[128, 128, 128, 48]> : vector<4xi64>, !llvm.ptr<9> = dense<[192, 256, 256, 32]> : vector<4xi64>, i64 = dense<64> : vector<2xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.legal_int_widths" = array<i32: 32, 64>, "dlti.stack_alignment" = 32 : i64, "dlti.alloca_memory_space" = 5 : ui64, "dlti.global_memory_space" = 1 : ui64>, fir.atomic_ignore_denormal_mode, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", fir.target_cpu = "generic-hsa", llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9", llvm.target_triple = "amdgcn-amd-amdhsa", omp.flags = #omp.flags<openmp_device_version = 31>, omp.is_gpu = true, omp.is_target_device = true, omp.requires = #omp<clause_requires none>, omp.target_triples = [], omp.version = #omp.version<version = 31>} {
- llvm.func @_QQmain() attributes {fir.bindc_name = "TEST", omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "generic-hsa"} {
+ llvm.func @_QQmain() attributes {fir.bindc_name = "TEST", omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "generic-hsa"} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "threads"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir b/mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir
index dae2d2daa7091..1b53ec3e058a8 100644
--- a/mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir
@@ -11,7 +11,7 @@
// scenarios.
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
- llvm.func @_QQmain() attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @_QQmain() attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%1 = llvm.mlir.constant(1 : i64) : i64
%2 = llvm.alloca %1 x !llvm.struct<(ptr)> : (i64) -> !llvm.ptr
%3 = omp.map.info var_ptr(%2 : !llvm.ptr, !llvm.struct<(ptr)>) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-debug-map-link-loc.mlir b/mlir/test/Target/LLVMIR/omptarget-debug-map-link-loc.mlir
index d8181b0c3fb17..eb0bb04d10e30 100644
--- a/mlir/test/Target/LLVMIR/omptarget-debug-map-link-loc.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-debug-map-link-loc.mlir
@@ -1,7 +1,7 @@
// RUN: mlir-translate -mlir-to-llvmir %s
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
- llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32 loc(#loc1)
llvm.return %0 : i32 loc(#loc1)
} loc(#loc1)
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-all-device-types-device.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-all-device-types-device.mlir
index 3e0bb2404783b..73ca99ef94837 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-all-device-types-device.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-all-device-types-device.mlir
@@ -9,14 +9,14 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// CHECK-DAG: @ial = internal global float 0.000000e+00
// CHECK-DAG: @ial_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global internal @ial() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ llvm.mlir.global internal @ial() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @eal = internal global float 0.000000e+00
// CHECK-DAG: @eal_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @eal() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ llvm.mlir.global external @eal() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
@@ -25,14 +25,14 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// CHECK-DAG: @ihl = internal global float 0.000000e+00
// CHECK-DAG: @ihl_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global internal @ihl() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (link)>} : f32 {
+ llvm.mlir.global internal @ihl() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @ehl = internal global float 0.000000e+00
// CHECK-DAG: @ehl_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @ehl() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (link)>} : f32 {
+ llvm.mlir.global external @ehl() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
@@ -41,14 +41,14 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// CHECK-DAG: @inl = internal global float 0.000000e+00
// CHECK-DAG: @inl_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global internal @inl() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (link)>} : f32 {
+ llvm.mlir.global internal @inl() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @enl = internal global float 0.000000e+00
// CHECK-DAG: @enl_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @enl() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (link)>} : f32 {
+ llvm.mlir.global external @enl() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = link>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
@@ -56,13 +56,13 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// --- enter any ---
// CHECK-DAG: @iae = global float 0.000000e+00
- llvm.mlir.global internal @iae() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global internal @iae() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @eae = dso_local global float 0.000000e+00
- llvm.mlir.global external @eae() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global external @eae() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
@@ -70,13 +70,13 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// --- enter host ---
// CHECK-DAG: @ihe = external dso_local global float
- llvm.mlir.global internal @ihe() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global internal @ihe() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @ehe = external dso_local global float
- llvm.mlir.global external @ehe() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global external @ehe() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
@@ -84,13 +84,13 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true,
// --- enter nohost ---
// CHECK-DAG: @ine = global float 0.000000e+00
- llvm.mlir.global internal @ine() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global internal @ine() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
// CHECK-DAG: @ene = dso_local global float 0.000000e+00
- llvm.mlir.global external @ene() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global external @ene() {addr_space = 0 : i32, dso_local, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = enter>} : f32 {
%0 = llvm.mlir.zero : f32
llvm.return %0 : f32
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-func-visibility.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-func-visibility.mlir
index f5f3c9f419f0b..fdbe2cf13d98d 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-func-visibility.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-func-visibility.mlir
@@ -9,19 +9,19 @@
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
// CHECK: define hidden void @device_any()
- llvm.func @device_any() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func @device_any() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
llvm.return
}
// CHECK: define hidden void @device_nohost()
- llvm.func @device_nohost() attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} {
+ llvm.func @device_nohost() attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} {
llvm.return
}
// A function with an explicitly requested (non-default) visibility is left
// untouched.
// CHECK: define protected void @device_protected()
- llvm.func protected @device_protected() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func protected @device_protected() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
llvm.return
}
@@ -34,5 +34,5 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// A declaration (no definition) is left untouched: there is nothing to
// internalize, and hiding it could over-constrain the symbol's visibility.
// CHECK: declare void @device_decl()
- llvm.func @device_decl() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>}
+ llvm.func @device_decl() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>}
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device-2.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device-2.mlir
index e53c0430a731c..3b6243c160d47 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device-2.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device-2.mlir
@@ -6,19 +6,19 @@
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true, omp.requires = #omp<clause_requires unified_shared_memory>} {
// CHECK-DAG: @_QMtest_0Evar_to_usm_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Evar_to_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_to_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-DAG: @_QMtest_0Evar_enter_usm_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Evar_enter_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_enter_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(2 : i32) : i32
llvm.return %0 : i32
}
// CHECK-DAG: @_QMtest_0Evar_link_usm_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Evar_link_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_link_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(3 : i32) : i32
llvm.return %0 : i32
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir
index 3473965ab57c5..e0540a530ed71 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir
@@ -10,7 +10,7 @@
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
// CHECK-DAG: @_QMtest_0Esp = internal global i32
// CHECK-DAG: @_QMtest_0Esp_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(0 : i32) : i32
llvm.return %0 : i32
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir
index 0d795eefa1f9d..65688299e5e8f 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir
@@ -9,14 +9,14 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [36 x i8] c"_QMtest_0Earray_1d_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Earray_1d_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Earray_1d_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Earray_1d_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !llvm.array<3 x i32>
+ llvm.mlir.global external @_QMtest_0Earray_1d(dense<[1, 2, 3]> : tensor<3xi32>) {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !llvm.array<3 x i32>
// CHECK-DAG: @_QMtest_0Earray_2d = global [2 x [2 x i32]] {{.*}}
// CHECK-DAG: @_QMtest_0Earray_2d_decl_tgt_ref_ptr = weak global ptr @_QMtest_0Earray_2d
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [36 x i8] c"_QMtest_0Earray_2d_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Earray_2d_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Earray_2d_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Earray_2d_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Earray_2d() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !llvm.array<2 x array<2 x i32>> {
+ llvm.mlir.global external @_QMtest_0Earray_2d() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !llvm.array<2 x array<2 x i32>> {
%0 = llvm.mlir.undef : !llvm.array<2 x array<2 x i32>>
%1 = llvm.mlir.constant(1 : i32) : i32
%2 = llvm.insertvalue %1, %0[0, 0] : !llvm.array<2 x array<2 x i32>>
@@ -36,7 +36,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [48 x i8] c"_QMtest_0Edata_extended_link_1_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_link_1_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Edata_extended_link_1_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_link_1_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_link_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_link_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%0 = llvm.mlir.constant(2.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -46,7 +46,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [48 x i8] c"_QMtest_0Edata_extended_link_2_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_link_2_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Edata_extended_link_2_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_link_2_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_link_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_link_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : f32 {
%0 = llvm.mlir.constant(3.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -55,7 +55,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [29 x i8] c"_QMtest_0Edata_extended_to_1\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_to_1 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_extended_to_1, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_to_1", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_to_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_to_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
%0 = llvm.mlir.constant(2.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -64,7 +64,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [32 x i8] c"_QMtest_0Edata_extended_enter_1\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_enter_1 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_extended_enter_1, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_enter_1", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_enter_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_enter_1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32 {
%0 = llvm.mlir.constant(2.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -73,7 +73,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [29 x i8] c"_QMtest_0Edata_extended_to_2\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_to_2 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_extended_to_2, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_to_2", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_to_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_to_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : f32 {
%0 = llvm.mlir.constant(3.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -82,7 +82,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [32 x i8] c"_QMtest_0Edata_extended_enter_2\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_extended_enter_2 = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_extended_enter_2, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_extended_enter_2", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_extended_enter_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : f32 {
+ llvm.mlir.global external @_QMtest_0Edata_extended_enter_2() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : f32 {
%0 = llvm.mlir.constant(3.000000e+00 : f32) : f32
llvm.return %0 : f32
}
@@ -92,7 +92,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [36 x i8] c"_QMtest_0Edata_int_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_int_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Edata_int_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_int_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_int() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Edata_int() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(10 : i32) : i32
llvm.return %0 : i32
}
@@ -101,7 +101,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [33 x i8] c"_QMtest_0Edata_int_clauseless_to\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_int_clauseless_to = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_int_clauseless_to, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_int_clauseless_to", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_int_clauseless_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Edata_int_clauseless_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
@@ -110,7 +110,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [36 x i8] c"_QMtest_0Edata_int_clauseless_enter\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_int_clauseless_enter = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_int_clauseless_enter, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_int_clauseless_enter", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_int_clauseless_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Edata_int_clauseless_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
@@ -119,7 +119,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [22 x i8] c"_QMtest_0Edata_int_to\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_int_to = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_int_to, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_int_to", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_int_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Edata_int_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(5 : i32) : i32
llvm.return %0 : i32
}
@@ -128,7 +128,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [25 x i8] c"_QMtest_0Edata_int_enter\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Edata_int_enter = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QMtest_0Edata_int_enter, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Edata_int_enter", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Edata_int_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Edata_int_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(5 : i32) : i32
llvm.return %0 : i32
}
@@ -137,7 +137,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [19 x i8] c"_QFEinternal_enter\00"
// CHECK-DAG: @.offloading.entry._QFEinternal_enter = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QFEinternal_enter, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QFEinternal_enter", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global internal @_QFEinternal_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global internal @_QFEinternal_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(7 : i32) : i32
llvm.return %0 : i32
}
@@ -147,7 +147,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry._QFEhidden_enter_decl_tgt_entry = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 0, ptr @_QFEhidden_enter_decl_tgt_entry, ptr @.offloading.entry_name{{.*}}, i64 4, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: @_QFEhidden_enter_decl_tgt_entry = weak alias i32, ptr @_QFEhidden_enter
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QFEhidden_enter_decl_tgt_entry", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external hidden @_QFEhidden_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external hidden @_QFEhidden_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(8 : i32) : i32
llvm.return %0 : i32
}
@@ -157,7 +157,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [31 x i8] c"_QMtest_0Ept1_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Ept1_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Ept1_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Ept1_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Ept1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {
+ llvm.mlir.global external @_QMtest_0Ept1() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : !llvm.struct<(ptr, i64, i32, i8, i8, i8, i8)> {
%0 = llvm.mlir.zero : !llvm.ptr
%1 = llvm.mlir.constant(9 : i32) : i32
%2 = llvm.mlir.zero : !llvm.ptr
@@ -188,7 +188,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_targe
// CHECK-DAG: @.offloading.entry_name{{.*}} = internal unnamed_addr constant [35 x i8] c"_QMtest_0Ept2_tar_decl_tgt_ref_ptr\00"
// CHECK-DAG: @.offloading.entry._QMtest_0Ept2_tar_decl_tgt_ref_ptr = weak constant %struct.__tgt_offload_entry { i64 0, i16 1, i16 1, i32 1, ptr @_QMtest_0Ept2_tar_decl_tgt_ref_ptr, ptr @.offloading.entry_name{{.*}}, i64 8, i64 0, ptr null }, section "llvm_offload_entries"
// CHECK-DAG: !{{.*}} = !{i32 {{.*}}, !"_QMtest_0Ept2_tar_decl_tgt_ref_ptr", i32 {{.*}}, i32 {{.*}}}
- llvm.mlir.global external @_QMtest_0Ept2_tar() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Ept2_tar() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(5 : i32) : i32
llvm.return %0 : i32
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-module-rewrite-device.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-module-rewrite-device.mlir
index 837e89d5357ea..0980f19f3a9c6 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-module-rewrite-device.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-module-rewrite-device.mlir
@@ -10,7 +10,7 @@
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
// CHECK-DAG: @_QMtest_0Esp_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(0 : i32) : i32
llvm.return %0 : i32
}
@@ -18,7 +18,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK-LABEL: define {{.*}} @_QMtest_0Puse_global
// CHECK: %[[REF:.*]] = load ptr, ptr @_QMtest_0Esp_decl_tgt_ref_ptr, align 8
// CHECK: store i32 2, ptr %[[REF]], align 4
- llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+ llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
%0 = llvm.mlir.addressof @_QMtest_0Esp : !llvm.ptr
%1 = llvm.mlir.constant(2 : i32) : i32
llvm.store %1, %0 : i32, !llvm.ptr
@@ -52,7 +52,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
// CHECK-DAG: @_QMtest_0Esp_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Esp() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(0 : i32) : i32
llvm.return %0 : i32
}
@@ -70,7 +70,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK: [[MERGE]]:
// CHECK: %[[PHI:.*]] = phi ptr [ %[[PHI_B]], %[[BB_B]] ], [ %[[PHI_A]], %[[BB_A]] ]
// CHECK: store i32 2, ptr %[[PHI]], align 4
- llvm.func @_QMtest_0Puse_global(%cond : i1) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+ llvm.func @_QMtest_0Puse_global(%cond : i1) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
%0 = llvm.mlir.addressof @_QMtest_0Esp : !llvm.ptr
llvm.cond_br %cond, ^bb1(%0 : !llvm.ptr), ^bb2(%0 : !llvm.ptr)
^bb1(%arg1 : !llvm.ptr):
@@ -93,7 +93,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true} {
// CHECK-DAG: @_QMtest_0Esp_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Esp() {addr_space = 2 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (link)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Esp() {addr_space = 2 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = link>} : i32 {
%0 = llvm.mlir.constant(0 : i32) : i32
llvm.return %0 : i32
}
@@ -122,7 +122,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK: [[M2]]:
// CHECK: %[[PHI2:.*]] = phi ptr [ %[[PD]], %[[D]] ], [ %[[PC]], %[[C]] ]
// CHECK: store i32 3, ptr %[[PHI2]], align 4
- llvm.func @_QMtest_0Puse_global_nested(%cond1 : i1, %cond2 : i1) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+ llvm.func @_QMtest_0Puse_global_nested(%cond1 : i1, %cond2 : i1) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
%g = llvm.mlir.addressof @_QMtest_0Esp : !llvm.ptr<2>
%gc = llvm.addrspacecast %g : !llvm.ptr<2> to !llvm.ptr
llvm.cond_br %cond1, ^bb1(%gc : !llvm.ptr), ^bb2(%gc : !llvm.ptr)
@@ -160,13 +160,13 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK-NOT: @_QMtest_0Evar_to_decl_tgt_ref_ptr
// CHECK-NOT: @_QMtest_0Evar_enter_decl_tgt_ref_ptr
// CHECK-DAG: @_QMtest_0Evar_to = global i32
- llvm.mlir.global external @_QMtest_0Evar_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_to() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-DAG: @_QMtest_0Evar_enter = global i32
- llvm.mlir.global external @_QMtest_0Evar_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_enter() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(2 : i32) : i32
llvm.return %0 : i32
}
@@ -176,7 +176,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK-NOT: load ptr, ptr @_QMtest_0Evar_enter_decl_tgt_ref_ptr
// CHECK-DAG: store i32 100, ptr @_QMtest_0Evar_to, align 4
// CHECK-DAG: store i32 200, ptr @_QMtest_0Evar_enter, align 4
- llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+ llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
%0 = llvm.mlir.addressof @_QMtest_0Evar_to : !llvm.ptr
%1 = llvm.mlir.addressof @_QMtest_0Evar_enter : !llvm.ptr
%c100 = llvm.mlir.constant(100 : i32) : i32
@@ -221,13 +221,13 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_device = true, omp.requires = #omp<clause_requires unified_shared_memory>} {
// CHECK-DAG: @_QMtest_0Evar_to_usm_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Evar_to_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_to_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : i32 {
%0 = llvm.mlir.constant(1 : i32) : i32
llvm.return %0 : i32
}
// CHECK-DAG: @_QMtest_0Evar_enter_usm_decl_tgt_ref_ptr = weak global ptr null, align 8
- llvm.mlir.global external @_QMtest_0Evar_enter_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} : i32 {
+ llvm.mlir.global external @_QMtest_0Evar_enter_usm() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} : i32 {
%0 = llvm.mlir.constant(2 : i32) : i32
llvm.return %0 : i32
}
@@ -237,7 +237,7 @@ module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_target_devic
// CHECK-DAG: store i32 100, ptr %[[TO_REF]], align 4
// CHECK-DAG: %[[ENTER_REF:.*]] = load ptr, ptr @_QMtest_0Evar_enter_usm_decl_tgt_ref_ptr, align 8
// CHECK-DAG: store i32 200, ptr %[[ENTER_REF]], align 4
- llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (enter)>} {
+ llvm.func @_QMtest_0Puse_global() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = enter>} {
%0 = llvm.mlir.addressof @_QMtest_0Evar_to_usm : !llvm.ptr
%1 = llvm.mlir.addressof @_QMtest_0Evar_enter_usm : !llvm.ptr
%c100 = llvm.mlir.constant(100 : i32) : i32
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-to-device.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-to-device.mlir
index fd4c024d5cdae..dfae4fd52567f 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-to-device.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-to-device.mlir
@@ -7,7 +7,7 @@
module attributes {llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true} {
// CHECK-DAG: @_QMtest_0Ezii = global [11 x float] zeroinitializer
- llvm.mlir.global external @_QMtest_0Ezii() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : !llvm.array<11 x f32> {
+ llvm.mlir.global external @_QMtest_0Ezii() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : !llvm.array<11 x f32> {
%0 = llvm.mlir.zero : !llvm.array<11 x f32>
llvm.return %0 : !llvm.array<11 x f32>
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-declare-target-to-host.mlir b/mlir/test/Target/LLVMIR/omptarget-declare-target-to-host.mlir
index 16dcc5fad589a..ee022cfe0fb99 100644
--- a/mlir/test/Target/LLVMIR/omptarget-declare-target-to-host.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-declare-target-to-host.mlir
@@ -5,7 +5,7 @@ module attributes {llvm.target_triple = "x86_64-unknown-linux-gnu", omp.is_gpu =
// CHECK-DAG: @.offload_sizes = private unnamed_addr constant [2 x i64] [i64 48, i64 0]
// CHECK-DAG: @.offload_maptypes = private unnamed_addr constant [2 x i64] [i64 3, i64 288]
// CHECK-DAG: @.offloading.entry._QMtest_0Ezii = weak constant %struct.__tgt_offload_entry {{.*}} ptr @_QMtest_0Ezii, {{.*}}, i64 44,{{.*}}
- llvm.mlir.global external @_QMtest_0Ezii() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : !llvm.array<11 x f32> {
+ llvm.mlir.global external @_QMtest_0Ezii() {addr_space = 0 : i32, omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} : !llvm.array<11 x f32> {
%0 = llvm.mlir.zero : !llvm.array<11 x f32>
llvm.return %0 : !llvm.array<11 x f32>
}
diff --git a/mlir/test/Target/LLVMIR/omptarget-device-shared-mem.mlir b/mlir/test/Target/LLVMIR/omptarget-device-shared-mem.mlir
index 6fccc0127b347..3838ab7312cc6 100644
--- a/mlir/test/Target/LLVMIR/omptarget-device-shared-mem.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-device-shared-mem.mlir
@@ -3,7 +3,7 @@
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true} {
// CHECK-LABEL: define hidden void @device_shared_mem(
// CHECK-SAME: i32 %[[N0:.*]], i64 %[[N1:.*]])
- llvm.func @device_shared_mem(%n0: i32, %n1: i64) attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>} {
+ llvm.func @device_shared_mem(%n0: i32, %n1: i64) attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>} {
// CHECK: %[[CAST_N0:.*]] = zext i32 %[[N0]] to i64
// CHECK-NEXT: %[[ALLOC0_SZ:.*]] = mul i64 8, %[[CAST_N0]]
// CHECK-NEXT: %[[ALLOC0:.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 %[[ALLOC0_SZ]])
diff --git a/mlir/test/Target/LLVMIR/omptarget-multi-reduction.mlir b/mlir/test/Target/LLVMIR/omptarget-multi-reduction.mlir
index 10b8d8479399e..4d6eecf5caa35 100644
--- a/mlir/test/Target/LLVMIR/omptarget-multi-reduction.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-multi-reduction.mlir
@@ -23,7 +23,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
%0 = llvm.fadd %arg0, %arg1 {fastmathFlags = #llvm.fastmath<contract>} : f64
omp.yield(%0 : f64)
}
- llvm.func @_QQmain() attributes {fir.bindc_name = "reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+vmem-to-lds-load-insts", "+wavefrontsize32"]>} {
+ llvm.func @_QQmain() attributes {fir.bindc_name = "reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+vmem-to-lds-load-insts", "+wavefrontsize32"]>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "k"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
index b45016b612656..499e0c64c7457 100644
--- a/mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
@@ -4,7 +4,7 @@
// for omp target parallel construct
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true} {
- llvm.func @_QQmain_omp_outline_1(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @_QQmain_omp_outline_1(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = omp.map.info var_ptr(%arg0 : !llvm.ptr, i32) map_clauses(from) capture(ByRef) name("d") -> !llvm.ptr
omp.target kernel_type(generic) map_entries(%0 -> %arg2 : !llvm.ptr) {
omp.parallel {
@@ -17,7 +17,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
llvm.return
}
- llvm.func @_test_num_threads(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @_test_num_threads(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = omp.map.info var_ptr(%arg0 : !llvm.ptr, i32) map_clauses(from) capture(ByRef) name("d") -> !llvm.ptr
omp.target kernel_type(generic) map_entries(%0 -> %arg2 : !llvm.ptr) {
%1 = llvm.mlir.constant(156 : i32) : i32
diff --git a/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir b/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
index 838223b337fd1..eca9117c096c8 100644
--- a/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-parallel-wsloop.mlir
@@ -4,7 +4,7 @@
// for nested omp do loop inside omp target region
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true } {
- llvm.func @target_parallel_wsloop(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>,
+ llvm.func @target_parallel_wsloop(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>,
target_cpu = "gfx90a",
target_features = #llvm.target_features<["+gfx9-insts", "+wavefrontsize64"]>}
{
diff --git a/mlir/test/Target/LLVMIR/omptarget-private-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-private-llvm.mlir
index a27f23618abdd..891df1b650146 100644
--- a/mlir/test/Target/LLVMIR/omptarget-private-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-private-llvm.mlir
@@ -5,10 +5,10 @@
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true} {
omp.private {type = private} @_QMmodFfailingEi_private_i32 : i32
- llvm.func @_QMotherProutine(%arg0: !llvm.ptr {fir.bindc_name = "i", llvm.nocapture}) attributes {frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>, target_cpu = "gfx90a", target_features = #llvm.target_features<["+16-bit-insts", "+atomic-buffer-global-pk-add-f16-insts", "+atomic-fadd-rtn-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot3-insts", "+dot4-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx8-insts", "+gfx9-insts", "+gfx90a-insts", "+gws", "+image-insts", "+mai-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize64"]>} {
+ llvm.func @_QMotherProutine(%arg0: !llvm.ptr {fir.bindc_name = "i", llvm.nocapture}) attributes {frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>, target_cpu = "gfx90a", target_features = #llvm.target_features<["+16-bit-insts", "+atomic-buffer-global-pk-add-f16-insts", "+atomic-fadd-rtn-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot3-insts", "+dot4-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx8-insts", "+gfx9-insts", "+gfx90a-insts", "+gws", "+image-insts", "+mai-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize64"]>} {
llvm.return
}
- llvm.func @_QMmodPfailing(%arg0: !llvm.ptr {fir.bindc_name = "d", llvm.nocapture}) attributes {frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "gfx90a", target_features = #llvm.target_features<["+16-bit-insts", "+atomic-buffer-global-pk-add-f16-insts", "+atomic-fadd-rtn-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot3-insts", "+dot4-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx8-insts", "+gfx9-insts", "+gfx90a-insts", "+gws", "+image-insts", "+mai-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize64"]>} {
+ llvm.func @_QMmodPfailing(%arg0: !llvm.ptr {fir.bindc_name = "d", llvm.nocapture}) attributes {frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "gfx90a", target_features = #llvm.target_features<["+16-bit-insts", "+atomic-buffer-global-pk-add-f16-insts", "+atomic-fadd-rtn-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot3-insts", "+dot4-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx8-insts", "+gfx9-insts", "+gfx90a-insts", "+gws", "+image-insts", "+mai-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize64"]>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "i"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction-array-descriptor.mlir b/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction-array-descriptor.mlir
index 44e824e3a0dd1..696b522234f39 100644
--- a/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction-array-descriptor.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction-array-descriptor.mlir
@@ -21,7 +21,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<"dlti.alloca_memory_space" = 5 :
omp.yield(%0 : !llvm.ptr)
}
- llvm.func @test_array_reduction_() attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @test_array_reduction_() attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x !llvm.array<4 x i32> : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
@@ -91,7 +91,7 @@ module attributes {llvm.target_triple = "nvptx64-nvidia-cuda", omp.is_gpu = true
omp.yield(%0 : !llvm.ptr)
}
- llvm.func @test_array_reduction_() attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @test_array_reduction_() attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x !llvm.array<4 x i32> : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction.mlir b/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction.mlir
index 31bfbeaedecba..e59cba663a69d 100644
--- a/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-teams-distribute-reduction.mlir
@@ -14,7 +14,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
%0 = llvm.add %arg0, %arg1 : i32
omp.yield(%0 : i32)
}
- llvm.func @simple_target_teams_only_reduction_() attributes {fir.internal_name = "_QPsimple_target_teams_only_reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize32"]>} {
+ llvm.func @simple_target_teams_only_reduction_() attributes {fir.internal_name = "_QPsimple_target_teams_only_reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize32"]>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "sum"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-teams-llvm.mlir b/mlir/test/Target/LLVMIR/omptarget-teams-llvm.mlir
index c5f89eb2c3274..c3db2e9c31658 100644
--- a/mlir/test/Target/LLVMIR/omptarget-teams-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-teams-llvm.mlir
@@ -5,7 +5,7 @@
module attributes {omp.is_target_device = true} {
llvm.func @foo(i32)
- llvm.func @omp_target_teams_shared_simple(%arg0 : i32) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func @omp_target_teams_shared_simple(%arg0 : i32) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
omp.teams {
llvm.call @foo(%arg0) : (i32) -> ()
omp.terminator
diff --git a/mlir/test/Target/LLVMIR/omptarget-teams-reduction.mlir b/mlir/test/Target/LLVMIR/omptarget-teams-reduction.mlir
index 9110e831cb949..ab56c93d32da9 100644
--- a/mlir/test/Target/LLVMIR/omptarget-teams-reduction.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-teams-reduction.mlir
@@ -13,7 +13,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
%0 = llvm.add %arg0, %arg1 : i32
omp.yield(%0 : i32)
}
- llvm.func @simple_target_teams_only_reduction_() attributes {fir.internal_name = "_QPsimple_target_teams_only_reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize32"]>} {
+ llvm.func @simple_target_teams_only_reduction_() attributes {fir.internal_name = "_QPsimple_target_teams_only_reduction", frame_pointer = #llvm.framePointerKind<all>, omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>, target_cpu = "gfx1030", target_features = #llvm.target_features<["+16-bit-insts", "+ci-insts", "+dl-insts", "+dot1-insts", "+dot10-insts", "+dot2-insts", "+dot5-insts", "+dot6-insts", "+dot7-insts", "+dpp", "+gfx10-3-insts", "+gfx10-insts", "+gfx8-insts", "+gfx9-insts", "+gws", "+image-insts", "+s-memrealtime", "+s-memtime-inst", "+wavefrontsize32"]>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 {bindc_name = "sum"} : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir b/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
index f120dde8131d6..fdf3e4ff9764b 100644
--- a/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-wsloop-collapsed.mlir
@@ -4,7 +4,7 @@
// for nested omp do loop with collapse clause inside omp target region
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true } {
- llvm.func @target_collapsed_wsloop(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func @target_collapsed_wsloop(%arg0: !llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
%loop_ub = llvm.mlir.constant(99 : i32) : i32
%loop_lb = llvm.mlir.constant(0 : i32) : i32
%loop_step = llvm.mlir.constant(1 : index) : i32
diff --git a/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir b/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
index 04458af9654c3..acbb3ec916113 100644
--- a/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
+++ b/mlir/test/Target/LLVMIR/omptarget-wsloop.mlir
@@ -4,7 +4,7 @@
// for nested omp do loop inside omp target region
module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memory_space", 5 : ui32>>, llvm.data_layout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8", llvm.target_triple = "amdgcn-amd-amdhsa", omp.is_gpu = true, omp.is_target_device = true } {
- llvm.func @target_wsloop(%arg0: !llvm.ptr ) attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func @target_wsloop(%arg0: !llvm.ptr ) attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
%loop_ub = llvm.mlir.constant(9 : i32) : i32
%loop_lb = llvm.mlir.constant(0 : i32) : i32
%loop_step = llvm.mlir.constant(1 : i32) : i32
@@ -18,7 +18,7 @@ module attributes {dlti.dl_spec = #dlti.dl_spec<#dlti.dl_entry<"dlti.alloca_memo
llvm.return
}
- llvm.func @target_empty_wsloop() attributes {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ llvm.func @target_empty_wsloop() attributes {omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
%loop_ub = llvm.mlir.constant(9 : i32) : i32
%loop_lb = llvm.mlir.constant(0 : i32) : i32
%loop_step = llvm.mlir.constant(1 : i32) : i32
diff --git a/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir b/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
index 24aceef5d3b95..8acf5334f04bb 100644
--- a/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-data-target-device.mlir
@@ -5,7 +5,7 @@
// CHECK: {{.*}} = add i32 {{.*}}, 1
module attributes {omp.target_triples = ["amdgcn-amd-amdhsa"]} {
llvm.mlir.global weak_odr hidden local_unnamed_addr constant @__oclc_ABI_version(400 : i32) {addr_space = 4 : i32} : i32
- llvm.func @_QQmain() attributes {fir.bindc_name = "main", omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @_QQmain() attributes {fir.bindc_name = "main", omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = llvm.mlir.constant(99 : index) : i64
%1 = llvm.mlir.constant(0 : index) : i64
%2 = llvm.mlir.constant(1 : index) : i64
diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
index 1435f15983218..5a53fed7d2373 100644
--- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
@@ -3898,7 +3898,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @filter_nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
llvm.return
}
@@ -3907,7 +3907,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @filter_host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
llvm.return
}
@@ -3920,7 +3920,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @filter_nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>
+ #omp.declaretarget<device_type = nohost, capture_clause = enter>
} {
llvm.return
}
@@ -3929,7 +3929,7 @@ module attributes {omp.is_target_device = false} {
llvm.func @filter_host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (enter)>
+ #omp.declaretarget<device_type = host, capture_clause = enter>
} {
llvm.return
}
@@ -3942,7 +3942,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @filter_nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (to)>
+ #omp.declaretarget<device_type = nohost, capture_clause = to>
} {
llvm.return
}
@@ -3951,7 +3951,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @filter_host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (to)>
+ #omp.declaretarget<device_type = host, capture_clause = to>
} {
llvm.return
}
@@ -3964,7 +3964,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @filter_nohost() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (nohost), capture_clause = (enter)>
+ #omp.declaretarget<device_type = nohost, capture_clause = enter>
} {
llvm.return
}
@@ -3973,7 +3973,7 @@ module attributes {omp.is_target_device = true} {
llvm.func @filter_host() -> ()
attributes {
omp.declare_target =
- #omp.declaretarget<device_type = (host), capture_clause = (enter)>
+ #omp.declaretarget<device_type = host, capture_clause = enter>
} {
llvm.return
}
@@ -4251,7 +4251,7 @@ llvm.mlir.global internal @any() : i32
llvm.mlir.global internal @host() : i32
llvm.mlir.global internal @nohost() : i32
llvm.func @omp_groupprivate_device() attributes {
- omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} {
+ omp.declare_target = #omp.declaretarget<device_type = any, capture_clause = to>} {
%0 = llvm.mlir.constant(1 : i32) : i32
%2 = omp.groupprivate @any device_type(any) : !llvm.ptr
llvm.store %0, %2 : i32, !llvm.ptr
diff --git a/mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir b/mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir
index 4df2a504779bc..775ae98ae0b51 100644
--- a/mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir
@@ -13,10 +13,10 @@ module attributes {omp.is_target_device = true, llvm.target_triple = "amdgcn-amd
}
// CHECK-LABEL: declare void @device_func(ptr)
- llvm.func @device_func(!llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = (nohost), capture_clause = (to)>}
+ llvm.func @device_func(!llvm.ptr) attributes {omp.declare_target = #omp.declaretarget<device_type = nohost, capture_clause = to>}
// CHECK-NOT: define {{.*}} void @target_map_single_shared_mem_private
- llvm.func @target_map_single_shared_mem_private() attributes {omp.declare_target = #omp.declaretarget<device_type = (host), capture_clause = (to)>} {
+ llvm.func @target_map_single_shared_mem_private() attributes {omp.declare_target = #omp.declaretarget<device_type = host, capture_clause = to>} {
%0 = llvm.mlir.constant(1 : i64) : i64
%1 = llvm.alloca %0 x i32 : (i64) -> !llvm.ptr<5>
%2 = llvm.addrspacecast %1 : !llvm.ptr<5> to !llvm.ptr
More information about the cfe-commits
mailing list