[Mlir-commits] [flang] [mlir] [MLIR][OpenMP] NFC: Sort clauses alphabetically (2/2) (PR #101194)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Jul 31 02:41:38 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-fir-hlfir
@llvm/pr-subscribers-mlir
Author: Sergio Afonso (skatrak)
<details>
<summary>Changes</summary>
This patch sorts the clause lists for the following OpenMP operations:
- omp.taskloop
- omp.taskgroup
- omp.target_data
- omp.target_enter_data
- omp.target_exit_data
- omp.target_update
- omp.target
This change results in the reordering of operation arguments, so impacted unit tests are updated accordingly.
---
Patch is 33.87 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/101194.diff
8 Files Affected:
- (modified) flang/test/Fir/convert-to-llvm-openmp-and-fir.fir (+1-1)
- (modified) flang/test/Lower/OpenMP/target.f90 (+5-5)
- (modified) flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90 (+3-3)
- (modified) mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td (+18-25)
- (modified) mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp (+30-30)
- (modified) mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir (+1-1)
- (modified) mlir/test/Dialect/OpenMP/invalid.mlir (+9-9)
- (modified) mlir/test/Dialect/OpenMP/ops.mlir (+14-14)
``````````diff
diff --git a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
index eca762d52a724..4b9afd5675ea3 100644
--- a/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
+++ b/flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
@@ -472,7 +472,7 @@ func.func @_QPomp_target() {
// CHECK: %[[UPPER:.*]] = llvm.mlir.constant(511 : index) : i64
// CHECK: %[[BOUNDS:.*]] = omp.map.bounds lower_bound(%[[LOWER]] : i64) upper_bound(%[[UPPER]] : i64) extent(%[[EXTENT]] : i64) stride(%[[STRIDE]] : i64) start_idx(%[[STRIDE]] : i64)
// CHECK: %[[MAP:.*]] = omp.map.info var_ptr(%[[VAL_1]] : !llvm.ptr, !llvm.array<512 x i32>) map_clauses(tofrom) capture(ByRef) bounds(%[[BOUNDS]]) -> !llvm.ptr {name = "a"}
-// CHECK: omp.target thread_limit(%[[VAL_2]] : i32) map_entries(%[[MAP]] -> %[[ARG_0:.*]] : !llvm.ptr) {
+// CHECK: omp.target map_entries(%[[MAP]] -> %[[ARG_0:.*]] : !llvm.ptr) thread_limit(%[[VAL_2]] : i32) {
// CHECK: ^bb0(%[[ARG_0]]: !llvm.ptr):
// CHECK: %[[VAL_3:.*]] = llvm.mlir.constant(10 : i32) : i32
// CHECK: %[[VAL_4:.*]] = llvm.mlir.constant(1 : i64) : i64
diff --git a/flang/test/Lower/OpenMP/target.f90 b/flang/test/Lower/OpenMP/target.f90
index 0500b21a84cb0..9b92293cbf92f 100644
--- a/flang/test/Lower/OpenMP/target.f90
+++ b/flang/test/Lower/OpenMP/target.f90
@@ -66,7 +66,7 @@ subroutine omp_target_enter_nowait
integer :: a(1024)
!CHECK: %[[BOUNDS:.*]] = omp.map.bounds lower_bound({{.*}}) upper_bound({{.*}}) extent({{.*}}) stride({{.*}}) start_idx({{.*}})
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr({{.*}}) map_clauses(to) capture(ByRef) bounds(%[[BOUNDS]]) -> !fir.ref<!fir.array<1024xi32>> {name = "a"}
- !CHECK: omp.target_enter_data nowait map_entries(%[[MAP]] : !fir.ref<!fir.array<1024xi32>>)
+ !CHECK: omp.target_enter_data map_entries(%[[MAP]] : !fir.ref<!fir.array<1024xi32>>) nowait
!$omp target enter data map(to: a) nowait
end subroutine omp_target_enter_nowait
@@ -278,7 +278,7 @@ subroutine omp_target_update_nowait
!CHECK-DAG: %[[A_DECL:.*]]:2 = hlfir.declare %{{.*}}(%{{.*}})
!CHECK-DAG: %[[BOUNDS:.*]] = omp.map.bounds
- !CHECK: omp.target_update nowait map_entries
+ !CHECK: omp.target_update map_entries({{.*}}) nowait
!$omp target update from(a) nowait
end subroutine omp_target_update_nowait
@@ -493,7 +493,7 @@ subroutine omp_target_thread_limit
integer :: a
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr({{.*}}) map_clauses(tofrom) capture(ByRef) -> !fir.ref<i32> {name = "a"}
!CHECK: %[[VAL_1:.*]] = arith.constant 64 : i32
- !CHECK: omp.target thread_limit(%[[VAL_1]] : i32) map_entries(%[[MAP]] -> %{{.*}} : !fir.ref<i32>) {
+ !CHECK: omp.target map_entries(%[[MAP]] -> %{{.*}} : !fir.ref<i32>) thread_limit(%[[VAL_1]] : i32) {
!CHECK: ^bb0(%{{.*}}: !fir.ref<i32>):
!$omp target map(tofrom: a) thread_limit(64)
a = 10
@@ -512,7 +512,7 @@ subroutine omp_target_device_ptr
type(c_ptr) :: a
integer, target :: b
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr({{.*}}) map_clauses(tofrom) capture(ByRef) -> {{.*}} {name = "a"}
- !CHECK: omp.target_data use_device_ptr({{.*}}) map_entries(%[[MAP]]{{.*}}
+ !CHECK: omp.target_data map_entries(%[[MAP]]{{.*}}) use_device_ptr({{.*}})
!$omp target data map(tofrom: a) use_device_ptr(a)
!CHECK: ^bb0(%[[VAL_1:.*]]: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>):
!CHECK: {{.*}} = fir.coordinate_of %[[VAL_1:.*]], {{.*}} : (!fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, !fir.field) -> !fir.ref<i64>
@@ -533,7 +533,7 @@ subroutine omp_target_device_addr
!CHECK: %[[VAL_0_DECL:.*]]:2 = hlfir.declare %0 {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QFomp_target_device_addrEa"} : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> (!fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.ref<!fir.box<!fir.ptr<i32>>>)
!CHECK: %[[MAP_MEMBERS:.*]] = omp.map.info var_ptr({{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, i32) var_ptr_ptr({{.*}} : !fir.llvm_ptr<!fir.ref<i32>>) map_clauses(tofrom) capture(ByRef) -> !fir.llvm_ptr<!fir.ref<i32>> {name = ""}
!CHECK: %[[MAP:.*]] = omp.map.info var_ptr({{.*}} : !fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.box<!fir.ptr<i32>>) map_clauses(tofrom) capture(ByRef) members(%[[MAP_MEMBERS]] : [0] : !fir.llvm_ptr<!fir.ref<i32>>) -> !fir.ref<!fir.box<!fir.ptr<i32>>> {name = "a"}
- !CHECK: omp.target_data use_device_addr(%[[VAL_0_DECL]]#1 : !fir.ref<!fir.box<!fir.ptr<i32>>>) map_entries(%[[MAP_MEMBERS]], %[[MAP]] : {{.*}}) {
+ !CHECK: omp.target_data map_entries(%[[MAP_MEMBERS]], %[[MAP]] : {{.*}}) use_device_addr(%[[VAL_0_DECL]]#1 : !fir.ref<!fir.box<!fir.ptr<i32>>>) {
!$omp target data map(tofrom: a) use_device_addr(a)
!CHECK: ^bb0(%[[VAL_1:.*]]: !fir.ref<!fir.box<!fir.ptr<i32>>>):
!CHECK: %[[VAL_1_DECL:.*]]:2 = hlfir.declare %[[VAL_1]] {fortran_attrs = #fir.var_attrs<pointer>, uniq_name = "_QFomp_target_device_addrEa"} : (!fir.ref<!fir.box<!fir.ptr<i32>>>) -> (!fir.ref<!fir.box<!fir.ptr<i32>>>, !fir.ref<!fir.box<!fir.ptr<i32>>>)
diff --git a/flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90 b/flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90
index 0ad06f73a8ce9..acb5f533b619e 100644
--- a/flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90
+++ b/flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90
@@ -8,7 +8,7 @@
! functionality
!CHECK: func.func @{{.*}}only_use_device_ptr()
-!CHECK: omp.target_data use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>) {
+!CHECK: omp.target_data use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>) use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
!CHECK: ^bb0(%{{.*}}: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, %{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, %{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>):
subroutine only_use_device_ptr
use iso_c_binding
@@ -21,7 +21,7 @@ subroutine only_use_device_ptr
end subroutine
!CHECK: func.func @{{.*}}mix_use_device_ptr_and_addr()
-!CHECK: omp.target_data use_device_ptr({{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) {
+!CHECK: omp.target_data use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) use_device_ptr({{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
!CHECK: ^bb0(%{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, %{{.*}}: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, %{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>):
subroutine mix_use_device_ptr_and_addr
use iso_c_binding
@@ -47,7 +47,7 @@ subroutine only_use_device_addr
end subroutine
!CHECK: func.func @{{.*}}mix_use_device_ptr_and_addr_and_map()
-!CHECK: omp.target_data use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) map_entries(%{{.*}}, %{{.*}} : !fir.ref<i32>, !fir.ref<i32>) {
+!CHECK: omp.target_data map_entries(%{{.*}}, %{{.*}} : !fir.ref<i32>, !fir.ref<i32>) use_device_addr(%{{.*}}, %{{.*}} : !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>, !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>) use_device_ptr(%{{.*}} : !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>) {
!CHECK: ^bb0(%{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xf32>>>>, %{{.*}}: !fir.ref<!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{__address:i64}>>, %{{.*}}: !fir.ref<!fir.box<!fir.ptr<!fir.array<?xi32>>>>):
subroutine mix_use_device_ptr_and_addr_and_map
use iso_c_binding
diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
index 7d07e47582afc..68f92e6952694 100644
--- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
+++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
@@ -590,13 +590,12 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
DeclareOpInterfaceMethods<LoopWrapperInterface>, RecursiveMemoryEffects,
SingleBlock
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_FinalClause, OpenMP_UntiedClause,
- OpenMP_MergeableClause,
- OpenMP_InReductionClauseSkip<extraClassDeclaration = true>,
+ OpenMP_AllocateClause, OpenMP_FinalClause, OpenMP_GrainsizeClause,
+ OpenMP_IfClause, OpenMP_InReductionClauseSkip<extraClassDeclaration = true>,
+ OpenMP_MergeableClause, OpenMP_NogroupClause, OpenMP_NumTasksClause,
+ OpenMP_PriorityClause, OpenMP_PrivateClause,
OpenMP_ReductionClauseSkip<extraClassDeclaration = true>,
- OpenMP_PriorityClause, OpenMP_AllocateClause, OpenMP_GrainsizeClause,
- OpenMP_NumTasksClause, OpenMP_NogroupClause, OpenMP_PrivateClause
+ OpenMP_UntiedClause
], singleRegion = true> {
let summary = "taskloop construct";
let description = [{
@@ -667,8 +666,7 @@ def TaskloopOp : OpenMP_Op<"taskloop", traits = [
def TaskgroupOp : OpenMP_Op<"taskgroup", traits = [
AttrSizedOperandSegments, AutomaticAllocationScope
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_TaskReductionClause, OpenMP_AllocateClause
+ OpenMP_AllocateClause, OpenMP_TaskReductionClause
], singleRegion = true> {
let summary = "taskgroup construct";
let description = [{
@@ -948,9 +946,8 @@ def MapInfoOp : OpenMP_Op<"map.info", [AttrSizedOperandSegments]> {
def TargetDataOp: OpenMP_Op<"target_data", traits = [
AttrSizedOperandSegments
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_DeviceClause, OpenMP_UseDevicePtrClause,
- OpenMP_UseDeviceAddrClause, OpenMP_MapClause
+ OpenMP_DeviceClause, OpenMP_IfClause, OpenMP_MapClause,
+ OpenMP_UseDeviceAddrClause, OpenMP_UseDevicePtrClause
], singleRegion = true> {
let summary = "target data construct";
let description = [{
@@ -981,9 +978,8 @@ def TargetDataOp: OpenMP_Op<"target_data", traits = [
def TargetEnterDataOp: OpenMP_Op<"target_enter_data", traits = [
AttrSizedOperandSegments
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_DeviceClause, OpenMP_DependClause,
- OpenMP_NowaitClause, OpenMP_MapClause
+ OpenMP_DependClause, OpenMP_DeviceClause, OpenMP_IfClause, OpenMP_MapClause,
+ OpenMP_NowaitClause
]> {
let summary = "target enter data construct";
let description = [{
@@ -1010,9 +1006,8 @@ def TargetEnterDataOp: OpenMP_Op<"target_enter_data", traits = [
def TargetExitDataOp: OpenMP_Op<"target_exit_data", traits = [
AttrSizedOperandSegments
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_DeviceClause, OpenMP_DependClause,
- OpenMP_NowaitClause, OpenMP_MapClause
+ OpenMP_DependClause, OpenMP_DeviceClause, OpenMP_IfClause, OpenMP_MapClause,
+ OpenMP_NowaitClause
]> {
let summary = "target exit data construct";
let description = [{
@@ -1039,9 +1034,8 @@ def TargetExitDataOp: OpenMP_Op<"target_exit_data", traits = [
def TargetUpdateOp: OpenMP_Op<"target_update", traits = [
AttrSizedOperandSegments
], clauses = [
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_DeviceClause, OpenMP_DependClause,
- OpenMP_NowaitClause, OpenMP_MapClause
+ OpenMP_DependClause, OpenMP_DeviceClause, OpenMP_IfClause, OpenMP_MapClause,
+ OpenMP_NowaitClause
]> {
let summary = "target update construct";
let description = [{
@@ -1077,11 +1071,10 @@ def TargetOp : OpenMP_Op<"target", traits = [
AttrSizedOperandSegments, IsolatedFromAbove, OutlineableOpenMPOpInterface
], clauses = [
// TODO: Complete clause list (defaultmap, uses_allocators).
- // TODO: Sort clauses alphabetically.
- OpenMP_IfClause, OpenMP_DeviceClause, OpenMP_ThreadLimitClause,
- OpenMP_DependClause, OpenMP_NowaitClause, OpenMP_IsDevicePtrClause,
- OpenMP_HasDeviceAddrClause, OpenMP_MapClause, OpenMP_PrivateClause,
- OpenMP_AllocateClause, OpenMP_InReductionClause
+ OpenMP_AllocateClause, OpenMP_DependClause, OpenMP_DeviceClause,
+ OpenMP_HasDeviceAddrClause, OpenMP_IfClause, OpenMP_InReductionClause,
+ OpenMP_IsDevicePtrClause, OpenMP_MapClause, OpenMP_NowaitClause,
+ OpenMP_PrivateClause, OpenMP_ThreadLimitClause
], singleRegion = true> {
let summary = "target construct";
let description = [{
diff --git a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
index ee6b3306815ee..11780f84697b1 100644
--- a/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
+++ b/mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
@@ -1370,9 +1370,9 @@ static LogicalResult verifyMapClause(Operation *op, OperandRange mapVars) {
void TargetDataOp::build(OpBuilder &builder, OperationState &state,
const TargetDataOperands &clauses) {
- TargetDataOp::build(builder, state, clauses.ifVar, clauses.device,
- clauses.useDevicePtrVars, clauses.useDeviceAddrVars,
- clauses.mapVars);
+ TargetDataOp::build(builder, state, clauses.device, clauses.ifVar,
+ clauses.mapVars, clauses.useDeviceAddrVars,
+ clauses.useDevicePtrVars);
}
LogicalResult TargetDataOp::verify() {
@@ -1393,9 +1393,10 @@ void TargetEnterDataOp::build(
OpBuilder &builder, OperationState &state,
const TargetEnterExitUpdateDataOperands &clauses) {
MLIRContext *ctx = builder.getContext();
- TargetEnterDataOp::build(builder, state, clauses.ifVar, clauses.device,
+ TargetEnterDataOp::build(builder, state,
makeArrayAttr(ctx, clauses.dependKinds),
- clauses.dependVars, clauses.nowait, clauses.mapVars);
+ clauses.dependVars, clauses.device, clauses.ifVar,
+ clauses.mapVars, clauses.nowait);
}
LogicalResult TargetEnterDataOp::verify() {
@@ -1412,9 +1413,10 @@ LogicalResult TargetEnterDataOp::verify() {
void TargetExitDataOp::build(OpBuilder &builder, OperationState &state,
const TargetEnterExitUpdateDataOperands &clauses) {
MLIRContext *ctx = builder.getContext();
- TargetExitDataOp::build(builder, state, clauses.ifVar, clauses.device,
+ TargetExitDataOp::build(builder, state,
makeArrayAttr(ctx, clauses.dependKinds),
- clauses.dependVars, clauses.nowait, clauses.mapVars);
+ clauses.dependVars, clauses.device, clauses.ifVar,
+ clauses.mapVars, clauses.nowait);
}
LogicalResult TargetExitDataOp::verify() {
@@ -1431,9 +1433,9 @@ LogicalResult TargetExitDataOp::verify() {
void TargetUpdateOp::build(OpBuilder &builder, OperationState &state,
const TargetEnterExitUpdateDataOperands &clauses) {
MLIRContext *ctx = builder.getContext();
- TargetUpdateOp::build(builder, state, clauses.ifVar, clauses.device,
- makeArrayAttr(ctx, clauses.dependKinds),
- clauses.dependVars, clauses.nowait, clauses.mapVars);
+ TargetUpdateOp::build(builder, state, makeArrayAttr(ctx, clauses.dependKinds),
+ clauses.dependVars, clauses.device, clauses.ifVar,
+ clauses.mapVars, clauses.nowait);
}
LogicalResult TargetUpdateOp::verify() {
@@ -1452,14 +1454,13 @@ void TargetOp::build(OpBuilder &builder, OperationState &state,
MLIRContext *ctx = builder.getContext();
// TODO Store clauses in op: allocateVars, allocatorVars, inReductionVars,
// inReductionByref, inReductionSyms.
- TargetOp::build(builder, state, clauses.ifVar, clauses.device,
- clauses.threadLimit, makeArrayAttr(ctx, clauses.dependKinds),
- clauses.dependVars, clauses.nowait, clauses.isDevicePtrVars,
- clauses.hasDeviceAddrVars, clauses.mapVars,
- clauses.privateVars, makeArrayAttr(ctx, clauses.privateSyms),
- /*allocate_vars=*/{}, /*allocator_vars=*/{},
+ TargetOp::build(builder, state, /*allocate_vars=*/{}, /*allocator_vars=*/{},
+ makeArrayAttr(ctx, clauses.dependKinds), clauses.dependVars,
+ clauses.device, clauses.hasDeviceAddrVars, clauses.ifVar,
/*in_reduction_vars=*/{}, /*in_reduction_byref=*/nullptr,
- /*in_reduction_syms=*/nullptr);
+ /*in_reduction_syms=*/nullptr, clauses.isDevicePtrVars,
+ clauses.mapVars, clauses.nowait, clauses.privateVars,
+ makeArrayAttr(ctx, clauses.privateSyms), clauses.threadLimit);
}
LogicalResult TargetOp::verify() {
@@ -1961,10 +1962,10 @@ LogicalResult TaskOp::verify() {
void TaskgroupOp::build(OpBuilder &builder, OperationState &state,
const TaskgroupOperands &clauses) {
MLIRContext *ctx = builder.getContext();
- TaskgroupOp::build(builder, state, clauses.taskReductionVars,
+ TaskgroupOp::build(builder, state, clauses.allocateVars,
+ clauses.allocatorVars, clauses.taskReductionVars,
makeDenseBoolArrayAttr(ctx, clauses.taskReductionByref),
- makeArrayAttr(ctx, clauses.taskReductionSyms),
- clauses.allocateVars, clauses.allocatorVars);
+ makeArrayAttr(ctx, clauses.taskReductionSyms));
}
LogicalResult TaskgroupOp::verify() {
@@ -1981,16 +1982,15 @@ void TaskloopOp::build(OpBuilder &builder, OperationState &state,
const TaskloopOperands &clauses) {
MLIRContext *ctx = builder.getContext();
// TODO Store clauses in op: privateVars, privateSyms.
- TaskloopOp::build(builder, state, clauses.ifVar, clauses.final,
- clauses.untied, clauses.mergeable, clauses.inReductionVars,
- makeDenseBoolArrayAttr(ctx, clauses.inReductionByref),
- makeArrayAttr(ctx, clauses.inReductionSyms),
- clauses.reductionVars,
- makeDenseBoolArrayAttr(ctx, clauses.reductionByref),
- makeArrayAttr(ctx, clauses.reductionSyms), clauses.priority,
- clauses.allocateVars, clauses.allocatorVars,
- clauses.grainsize, clauses.numTasks, clauses.nogroup,
- /*private_vars=*/{}, /*private_syms=*/nullptr);
+ TaskloopOp::build(
+ builder, state, clauses.allocateVars, clauses.allocatorVars,
+ clauses.final, clauses.grainsize, clauses.ifVar, clauses.inReductionVars,
+ makeDenseBoolArrayAttr(ctx, clauses.inReductionByref),
+ makeArrayAttr(ctx, clauses.inReductionSyms), clauses.mergeable,
+ clauses.nogroup, clauses.numTasks, clauses.priority, /*private_vars=*/{},
+ /*private_syms=*/nullptr, clauses.reductionVars,
+ makeDenseBoolArrayAttr(ctx, clauses.reductionByref),
+ makeArrayAttr(ctx, clauses.reductionSyms), clauses.untied);
}
SmallVector<Value> TaskloopOp::getAllReductionVars() {
diff --git a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
index 4c9e09970279a..d81487daf34f6 100644
--- a/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
@@ -253,7 +253,7 @@ llvm.func @_QPomp_target_data_region(%a : !llvm.ptr, %i : !llvm.ptr) {
// CHECK: %[[VAL_0:.*]] = llvm.mlir.constant(64 : i32) : i32
// CHECK: %[[MAP1:.*]] = omp.map.info var_ptr(%[[ARG_0]] : !llvm.ptr, !llvm.array<1024 x i32>) map_clauses(tofrom) capture(ByRef) -> !llvm.ptr {name = ""}
// CHECK: %[[MAP2:.*]] = omp.map.info var_ptr(%[[ARG_1]] : !llvm.ptr, i32) ...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/101194
More information about the Mlir-commits
mailing list