[flang-commits] [flang] [flang][acc] Add support for lowering combined constructs (PR #86696)
via flang-commits
flang-commits at lists.llvm.org
Tue Mar 26 10:06:04 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-fir-hlfir
@llvm/pr-subscribers-openacc
Author: Razvan Lupusoru (razvanlupusoru)
<details>
<summary>Changes</summary>
PR#<!-- -->80319 added support to record combined construct semantics via an attribute. Add lowering support for this.
---
Patch is 78.90 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/86696.diff
6 Files Affected:
- (modified) flang/lib/Lower/OpenACC.cpp (+44-30)
- (modified) flang/test/Lower/OpenACC/acc-kernels-loop.f90 (+73-58)
- (modified) flang/test/Lower/OpenACC/acc-loop.f90 (+1-1)
- (modified) flang/test/Lower/OpenACC/acc-parallel-loop.f90 (+75-60)
- (modified) flang/test/Lower/OpenACC/acc-private.f90 (+13-13)
- (modified) flang/test/Lower/OpenACC/acc-serial-loop.f90 (+69-54)
``````````diff
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 7b7e4a875cd8e8..db21c3ad6aabc7 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -1667,15 +1667,17 @@ static void privatizeIv(Fortran::lower::AbstractConverter &converter,
ivPrivate.push_back(privateValue);
}
-static mlir::acc::LoopOp
-createLoopOp(Fortran::lower::AbstractConverter &converter,
- mlir::Location currentLocation,
- Fortran::semantics::SemanticsContext &semanticsContext,
- Fortran::lower::StatementContext &stmtCtx,
- const Fortran::parser::DoConstruct &outerDoConstruct,
- Fortran::lower::pft::Evaluation &eval,
- const Fortran::parser::AccClauseList &accClauseList,
- bool needEarlyReturnHandling = false) {
+static mlir::acc::LoopOp createLoopOp(
+ Fortran::lower::AbstractConverter &converter,
+ mlir::Location currentLocation,
+ Fortran::semantics::SemanticsContext &semanticsContext,
+ Fortran::lower::StatementContext &stmtCtx,
+ const Fortran::parser::DoConstruct &outerDoConstruct,
+ Fortran::lower::pft::Evaluation &eval,
+ const Fortran::parser::AccClauseList &accClauseList,
+ std::optional<mlir::acc::CombinedConstructsType> combinedConstructs =
+ std::nullopt,
+ bool needEarlyReturnHandling = false) {
fir::FirOpBuilder &builder = converter.getFirOpBuilder();
llvm::SmallVector<mlir::Value> tileOperands, privateOperands, ivPrivate,
reductionOperands, cacheOperands, vectorOperands, workerNumOperands,
@@ -2015,6 +2017,11 @@ createLoopOp(Fortran::lower::AbstractConverter &converter,
if (!collapseDeviceTypes.empty())
loopOp.setCollapseDeviceTypeAttr(builder.getArrayAttr(collapseDeviceTypes));
+ if (combinedConstructs) {
+ loopOp.setCombinedAttr(mlir::acc::CombinedConstructsTypeAttr::get(
+ builder.getContext(), *combinedConstructs));
+ }
+
return loopOp;
}
@@ -2060,7 +2067,7 @@ genACC(Fortran::lower::AbstractConverter &converter,
std::get<std::optional<Fortran::parser::DoConstruct>>(loopConstruct.t);
auto loopOp = createLoopOp(converter, currentLocation, semanticsContext,
stmtCtx, *outerDoConstruct, eval, accClauseList,
- needEarlyExitHandling);
+ /*combinedConstructs=*/{}, needEarlyExitHandling);
if (needEarlyExitHandling)
return loopOp.getResult(0);
@@ -2092,14 +2099,14 @@ static void genDataOperandOperationsWithModifier(
}
template <typename Op>
-static Op
-createComputeOp(Fortran::lower::AbstractConverter &converter,
- mlir::Location currentLocation,
- Fortran::lower::pft::Evaluation &eval,
- Fortran::semantics::SemanticsContext &semanticsContext,
- Fortran::lower::StatementContext &stmtCtx,
- const Fortran::parser::AccClauseList &accClauseList,
- bool outerCombined = false) {
+static Op createComputeOp(
+ Fortran::lower::AbstractConverter &converter,
+ mlir::Location currentLocation, Fortran::lower::pft::Evaluation &eval,
+ Fortran::semantics::SemanticsContext &semanticsContext,
+ Fortran::lower::StatementContext &stmtCtx,
+ const Fortran::parser::AccClauseList &accClauseList,
+ std::optional<mlir::acc::CombinedConstructsType> combinedConstructs =
+ std::nullopt) {
// Parallel operation operands
mlir::Value ifCond;
@@ -2292,7 +2299,7 @@ createComputeOp(Fortran::lower::AbstractConverter &converter,
} else if (const auto *privateClause =
std::get_if<Fortran::parser::AccClause::Private>(
&clause.u)) {
- if (!outerCombined)
+ if (!combinedConstructs)
genPrivatizations<mlir::acc::PrivateRecipeOp>(
privateClause->v, converter, semanticsContext, stmtCtx,
privateOperands, privatizations);
@@ -2310,7 +2317,7 @@ createComputeOp(Fortran::lower::AbstractConverter &converter,
// combined - delay it to the loop. However, a reduction clause on a
// combined construct implies a copy clause so issue an implicit copy
// instead.
- if (!outerCombined) {
+ if (!combinedConstructs) {
genReductions(reductionClause->v, converter, semanticsContext, stmtCtx,
reductionOperands, reductionRecipes);
} else {
@@ -2362,11 +2369,11 @@ createComputeOp(Fortran::lower::AbstractConverter &converter,
if constexpr (std::is_same_v<Op, mlir::acc::KernelsOp>)
computeOp = createRegionOp<Op, mlir::acc::TerminatorOp>(
builder, currentLocation, currentLocation, eval, operands,
- operandSegments, outerCombined);
+ operandSegments, /*outerCombined=*/combinedConstructs.has_value());
else
computeOp = createRegionOp<Op, mlir::acc::YieldOp>(
builder, currentLocation, currentLocation, eval, operands,
- operandSegments, outerCombined);
+ operandSegments, /*outerCombined=*/combinedConstructs.has_value());
if (addSelfAttr)
computeOp.setSelfAttrAttr(builder.getUnitAttr());
@@ -2419,6 +2426,10 @@ createComputeOp(Fortran::lower::AbstractConverter &converter,
mlir::ArrayAttr::get(builder.getContext(), firstPrivatizations));
}
+ if (combinedConstructs) {
+ computeOp.setCombinedAttr(builder.getUnitAttr());
+ }
+
auto insPt = builder.saveInsertionPoint();
builder.setInsertionPointAfter(computeOp);
@@ -2734,21 +2745,24 @@ genACC(Fortran::lower::AbstractConverter &converter,
if (combinedDirective.v == llvm::acc::ACCD_kernels_loop) {
createComputeOp<mlir::acc::KernelsOp>(
converter, currentLocation, eval, semanticsContext, stmtCtx,
- accClauseList, /*outerCombined=*/true);
+ accClauseList, mlir::acc::CombinedConstructsType::KernelsLoop);
createLoopOp(converter, currentLocation, semanticsContext, stmtCtx,
- *outerDoConstruct, eval, accClauseList);
+ *outerDoConstruct, eval, accClauseList,
+ mlir::acc::CombinedConstructsType::KernelsLoop);
} else if (combinedDirective.v == llvm::acc::ACCD_parallel_loop) {
createComputeOp<mlir::acc::ParallelOp>(
converter, currentLocation, eval, semanticsContext, stmtCtx,
- accClauseList, /*outerCombined=*/true);
+ accClauseList, mlir::acc::CombinedConstructsType::ParallelLoop);
createLoopOp(converter, currentLocation, semanticsContext, stmtCtx,
- *outerDoConstruct, eval, accClauseList);
+ *outerDoConstruct, eval, accClauseList,
+ mlir::acc::CombinedConstructsType::ParallelLoop);
} else if (combinedDirective.v == llvm::acc::ACCD_serial_loop) {
- createComputeOp<mlir::acc::SerialOp>(converter, currentLocation, eval,
- semanticsContext, stmtCtx,
- accClauseList, /*outerCombined=*/true);
+ createComputeOp<mlir::acc::SerialOp>(
+ converter, currentLocation, eval, semanticsContext, stmtCtx,
+ accClauseList, mlir::acc::CombinedConstructsType::SerialLoop);
createLoopOp(converter, currentLocation, semanticsContext, stmtCtx,
- *outerDoConstruct, eval, accClauseList);
+ *outerDoConstruct, eval, accClauseList,
+ mlir::acc::CombinedConstructsType::SerialLoop);
} else {
llvm::report_fatal_error("Unknown combined construct encountered");
}
diff --git a/flang/test/Lower/OpenACC/acc-kernels-loop.f90 b/flang/test/Lower/OpenACC/acc-kernels-loop.f90
index e85065e54bc362..e5791f0e5b3921 100644
--- a/flang/test/Lower/OpenACC/acc-kernels-loop.f90
+++ b/flang/test/Lower/OpenACC/acc-kernels-loop.f90
@@ -37,13 +37,27 @@ subroutine acc_kernels_loop
! CHECK: %[[IFCONDITION:.*]] = fir.address_of(@{{.*}}ifcondition) : !fir.ref<!fir.logical<4>>
! CHECK: %[[DECLIFCONDITION:.*]]:2 = hlfir.declare %[[IFCONDITION]]
- !$acc kernels loop
+ !$acc kernels
+ !$acc loop
DO i = 1, n
a(i) = b(i)
END DO
+ !$acc end kernels
! CHECK: acc.kernels {
-! CHECK: acc.loop {{.*}} {
+! CHECK: acc.loop private{{.*}} {
+! CHECK: acc.yield
+! CHECK-NEXT: }{{$}}
+! CHECK: acc.terminator
+! CHECK-NEXT: }{{$}}
+
+ !$acc kernels loop
+ DO i = 1, n
+ a(i) = b(i)
+ END DO
+
+! CHECK: acc.kernels combined(loop) {
+! CHECK: acc.loop combined(kernels) private{{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
! CHECK: acc.terminator
@@ -55,7 +69,7 @@ subroutine acc_kernels_loop
END DO
!$acc end kernels loop
-! CHECK: acc.kernels {
+! CHECK: acc.kernels {{.*}} {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -68,7 +82,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[ASYNC1:%.*]] = arith.constant 1 : i32
-! CHECK: acc.kernels async([[ASYNC1]] : i32) {
+! CHECK: acc.kernels {{.*}} async([[ASYNC1]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -81,7 +95,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[ASYNC2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
-! CHECK: acc.kernels async([[ASYNC2]] : i32) {
+! CHECK: acc.kernels {{.*}} async([[ASYNC2]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -93,7 +107,7 @@ subroutine acc_kernels_loop
a(i) = b(i)
END DO
-! CHECK: acc.kernels wait {
+! CHECK: acc.kernels {{.*}} wait {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -106,7 +120,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
-! CHECK: acc.kernels wait({[[WAIT1]] : i32}) {
+! CHECK: acc.kernels {{.*}} wait({[[WAIT1]] : i32}) {
! CHECK: acc.loop
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -120,7 +134,7 @@ subroutine acc_kernels_loop
! CHECK: [[WAIT2:%.*]] = arith.constant 1 : i32
! CHECK: [[WAIT3:%.*]] = arith.constant 2 : i32
-! CHECK: acc.kernels wait({[[WAIT2]] : i32, [[WAIT3]] : i32}) {
+! CHECK: acc.kernels {{.*}} wait({[[WAIT2]] : i32, [[WAIT3]] : i32}) {
! CHECK: acc.loop
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -134,7 +148,7 @@ subroutine acc_kernels_loop
! CHECK: [[WAIT4:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
! CHECK: [[WAIT5:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
-! CHECK: acc.kernels wait({[[WAIT4]] : i32, [[WAIT5]] : i32}) {
+! CHECK: acc.kernels {{.*}} wait({[[WAIT4]] : i32, [[WAIT5]] : i32}) {
! CHECK: acc.loop
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -147,7 +161,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[NUMGANGS1:%.*]] = arith.constant 1 : i32
-! CHECK: acc.kernels num_gangs({[[NUMGANGS1]] : i32}) {
+! CHECK: acc.kernels {{.*}} num_gangs({[[NUMGANGS1]] : i32}) {
! CHECK: acc.loop
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -160,7 +174,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[NUMGANGS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
-! CHECK: acc.kernels num_gangs({[[NUMGANGS2]] : i32}) {
+! CHECK: acc.kernels {{.*}} num_gangs({[[NUMGANGS2]] : i32}) {
! CHECK: acc.loop
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -173,7 +187,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[NUMWORKERS1:%.*]] = arith.constant 10 : i32
-! CHECK: acc.kernels num_workers([[NUMWORKERS1]] : i32) {
+! CHECK: acc.kernels {{.*}} num_workers([[NUMWORKERS1]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -186,7 +200,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[NUMWORKERS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
-! CHECK: acc.kernels num_workers([[NUMWORKERS2]] : i32) {
+! CHECK: acc.kernels {{.*}} num_workers([[NUMWORKERS2]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -199,7 +213,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[VECTORLENGTH1:%.*]] = arith.constant 128 : i32
-! CHECK: acc.kernels vector_length([[VECTORLENGTH1]] : i32) {
+! CHECK: acc.kernels {{.*}} vector_length([[VECTORLENGTH1]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -212,7 +226,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[VECTORLENGTH2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
-! CHECK: acc.kernels vector_length([[VECTORLENGTH2]] : i32) {
+! CHECK: acc.kernels {{.*}} vector_length([[VECTORLENGTH2]] : i32) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -225,7 +239,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[IF1:%.*]] = arith.constant true
-! CHECK: acc.kernels if([[IF1]]) {
+! CHECK: acc.kernels {{.*}} if([[IF1]]) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -239,7 +253,7 @@ subroutine acc_kernels_loop
! CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>>
! CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1
-! CHECK: acc.kernels if([[IF2]]) {
+! CHECK: acc.kernels {{.*}} if([[IF2]]) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -252,7 +266,7 @@ subroutine acc_kernels_loop
END DO
! CHECK: [[SELF1:%.*]] = arith.constant true
-! CHECK: acc.kernels self([[SELF1]]) {
+! CHECK: acc.kernels {{.*}} self([[SELF1]]) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -264,7 +278,7 @@ subroutine acc_kernels_loop
a(i) = b(i)
END DO
-! CHECK: acc.kernels {
+! CHECK: acc.kernels {{.*}}{
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -278,7 +292,7 @@ subroutine acc_kernels_loop
! CHECK: %[[SELF2:.*]] = fir.convert %[[DECLIFCONDITION]]#1 : (!fir.ref<!fir.logical<4>>) -> i1
-! CHECK: acc.kernels self(%[[SELF2]]) {
+! CHECK: acc.kernels {{.*}} self(%[[SELF2]]) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -293,7 +307,7 @@ subroutine acc_kernels_loop
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"}
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"}
-! CHECK: acc.kernels dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -309,7 +323,7 @@ subroutine acc_kernels_loop
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "a"}
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copy>, name = "b"}
-! CHECK: acc.kernels dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -325,7 +339,7 @@ subroutine acc_kernels_loop
! CHECK: %[[COPYIN_A:.*]] = acc.copyin varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
! CHECK: %[[COPYIN_B:.*]] = acc.copyin varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyin_readonly>, name = "b"}
-! CHECK: acc.kernels dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[COPYIN_A]], %[[COPYIN_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -339,7 +353,7 @@ subroutine acc_kernels_loop
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "a"}
! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_copyout>, name = "b"}
-! CHECK: acc.kernels dataOperands(%[[CREATE_A]], %[[CREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[CREATE_A]], %[[CREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -355,7 +369,7 @@ subroutine acc_kernels_loop
! CHECK: %[[CREATE_B:.*]] = acc.create varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
! CHECK: %[[CREATE_A:.*]] = acc.create varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {dataClause = #acc<data_clause acc_create_zero>, name = "a"}
-! CHECK: acc.kernels dataOperands(%[[CREATE_B]], %[[CREATE_A]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[CREATE_B]], %[[CREATE_A]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -371,7 +385,7 @@ subroutine acc_kernels_loop
! CHECK: %[[NOCREATE_A:.*]] = acc.nocreate varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
! CHECK: %[[NOCREATE_B:.*]] = acc.nocreate varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
-! CHECK: acc.kernels dataOperands(%[[NOCREATE_A]], %[[NOCREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[NOCREATE_A]], %[[NOCREATE_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -385,7 +399,7 @@ subroutine acc_kernels_loop
! CHECK: %[[PRESENT_A:.*]] = acc.present varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
! CHECK: %[[PRESENT_B:.*]] = acc.present varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
-! CHECK: acc.kernels dataOperands(%[[PRESENT_A]], %[[PRESENT_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[PRESENT_A]], %[[PRESENT_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
! CHECK: acc.loop {{.*}} {
! CHECK: acc.yield
! CHECK-NEXT: }{{$}}
@@ -399,7 +413,7 @@ subroutine acc_kernels_loop
! CHECK: %[[DEVICEPTR_A:.*]] = acc.deviceptr varPtr(%[[DECLA]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "a"}
! CHECK: %[[DEVICEPTR_B:.*]] = acc.deviceptr varPtr(%[[DECLB]]#0 : !fir.ref<!fir.array<10xf32>>) bounds(%{{.*}}) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
-! CHECK: acc.kernels dataOperands(%[[DEVICEPTR_A]], %[[DEVICEPTR_B]] : !fir.ref<!fir.array<10xf32>>, !fir.ref<!fir.array<10xf32>>) {
+! CHECK: acc.kernels {{.*}} dataOperands(%[[DEVICEPTR_A]], %[[DEVICEPTR_B]] : !fir...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/86696
More information about the flang-commits
mailing list