Skip to content

Commit b9ac977

Browse files
committed
[flang][fir] Lower do concurrent loop nests to fir.do_concurrent
Adds support for lowering `do concurrent` nests from PFT to the new `fir.do_concurrent` MLIR op as well as its special terminator `fir.do_concurrent.loop` which models the actual loop nest. To that end, this PR emits the allocations for the iteration variables within the block of the `fir.do_concurrent` op and creates a region for the `fir.do_concurrent.loop` op that accepts arguments equal in number to the number of the input `do concurrent` iteration ranges. For example, given the following input: ```fortran do concurrent(i=1:10, j=11:20) end do ``` the changes in this PR emit the following MLIR: ```mlir fir.do_concurrent { %22 = fir.alloca i32 {bindc_name = "i"} %23:2 = hlfir.declare %22 {uniq_name = "_QFsub1Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) %24 = fir.alloca i32 {bindc_name = "j"} %25:2 = hlfir.declare %24 {uniq_name = "_QFsub1Ej"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) fir.do_concurrent.loop (%arg1, %arg2) = (%18, %20) to (%19, %21) step (%c1, %c1_0) { %26 = fir.convert %arg1 : (index) -> i32 fir.store %26 to %23#0 : !fir.ref<i32> %27 = fir.convert %arg2 : (index) -> i32 fir.store %27 to %25#0 : !fir.ref<i32> } } ```
1 parent 897f9a5 commit b9ac977

File tree

7 files changed

+184
-125
lines changed

7 files changed

+184
-125
lines changed

flang/lib/Lower/Bridge.cpp

Lines changed: 130 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct IncrementLoopInfo {
130130
mlir::Value loopVariable = nullptr;
131131

132132
// Data members for structured loops.
133-
fir::DoLoopOp doLoop = nullptr;
133+
mlir::Operation *loopOp = nullptr;
134134

135135
// Data members for unstructured loops.
136136
bool hasRealControl = false;
@@ -2291,8 +2291,14 @@ class FirConverter : public Fortran::lower::AbstractConverter {
22912291
mlir::LLVM::LoopAnnotationAttr la = mlir::LLVM::LoopAnnotationAttr::get(
22922292
builder->getContext(), {}, /*vectorize=*/va, {}, /*unroll*/ ua,
22932293
/*unroll_and_jam*/ uja, {}, {}, {}, {}, {}, {}, {}, {}, {}, {});
2294-
if (has_attrs)
2295-
info.doLoop.setLoopAnnotationAttr(la);
2294+
if (has_attrs) {
2295+
if (auto loopOp = mlir::dyn_cast<fir::DoLoopOp>(info.loopOp))
2296+
loopOp.setLoopAnnotationAttr(la);
2297+
2298+
if (auto doConcurrentOp =
2299+
mlir::dyn_cast<fir::DoConcurrentLoopOp>(info.loopOp))
2300+
doConcurrentOp.setLoopAnnotationAttr(la);
2301+
}
22962302
}
22972303

22982304
/// Generate FIR to begin a structured or unstructured increment loop nest.
@@ -2301,96 +2307,77 @@ class FirConverter : public Fortran::lower::AbstractConverter {
23012307
llvm::SmallVectorImpl<const Fortran::parser::CompilerDirective *> &dirs) {
23022308
assert(!incrementLoopNestInfo.empty() && "empty loop nest");
23032309
mlir::Location loc = toLocation();
2304-
mlir::Operation *boundsAndStepIP = nullptr;
23052310
mlir::arith::IntegerOverflowFlags iofBackup{};
23062311

2307-
for (IncrementLoopInfo &info : incrementLoopNestInfo) {
2308-
mlir::Value lowerValue;
2309-
mlir::Value upperValue;
2310-
mlir::Value stepValue;
2311-
2312-
{
2313-
mlir::OpBuilder::InsertionGuard guard(*builder);
2312+
llvm::SmallVector<mlir::Value> nestLBs;
2313+
llvm::SmallVector<mlir::Value> nestUBs;
2314+
llvm::SmallVector<mlir::Value> nestSts;
2315+
llvm::SmallVector<mlir::Value> nestReduceOperands;
2316+
llvm::SmallVector<mlir::Attribute> nestReduceAttrs;
2317+
bool genDoConcurrent = false;
23142318

2315-
// Set the IP before the first loop in the nest so that all nest bounds
2316-
// and step values are created outside the nest.
2317-
if (boundsAndStepIP)
2318-
builder->setInsertionPointAfter(boundsAndStepIP);
2319+
for (IncrementLoopInfo &info : incrementLoopNestInfo) {
2320+
genDoConcurrent = info.isStructured() && info.isUnordered;
23192321

2322+
if (!genDoConcurrent)
23202323
info.loopVariable = genLoopVariableAddress(loc, *info.loopVariableSym,
23212324
info.isUnordered);
2322-
if (!getLoweringOptions().getIntegerWrapAround()) {
2323-
iofBackup = builder->getIntegerOverflowFlags();
2324-
builder->setIntegerOverflowFlags(
2325-
mlir::arith::IntegerOverflowFlags::nsw);
2326-
}
2327-
lowerValue = genControlValue(info.lowerExpr, info);
2328-
upperValue = genControlValue(info.upperExpr, info);
2329-
bool isConst = true;
2330-
stepValue = genControlValue(info.stepExpr, info,
2331-
info.isStructured() ? nullptr : &isConst);
2332-
if (!getLoweringOptions().getIntegerWrapAround())
2333-
builder->setIntegerOverflowFlags(iofBackup);
2334-
boundsAndStepIP = stepValue.getDefiningOp();
2335-
2336-
// Use a temp variable for unstructured loops with non-const step.
2337-
if (!isConst) {
2338-
info.stepVariable =
2339-
builder->createTemporary(loc, stepValue.getType());
2340-
boundsAndStepIP =
2341-
builder->create<fir::StoreOp>(loc, stepValue, info.stepVariable);
2325+
2326+
if (!getLoweringOptions().getIntegerWrapAround()) {
2327+
iofBackup = builder->getIntegerOverflowFlags();
2328+
builder->setIntegerOverflowFlags(
2329+
mlir::arith::IntegerOverflowFlags::nsw);
2330+
}
2331+
2332+
nestLBs.push_back(genControlValue(info.lowerExpr, info));
2333+
nestUBs.push_back(genControlValue(info.upperExpr, info));
2334+
bool isConst = true;
2335+
nestSts.push_back(genControlValue(
2336+
info.stepExpr, info, info.isStructured() ? nullptr : &isConst));
2337+
2338+
if (!getLoweringOptions().getIntegerWrapAround())
2339+
builder->setIntegerOverflowFlags(iofBackup);
2340+
2341+
// Use a temp variable for unstructured loops with non-const step.
2342+
if (!isConst) {
2343+
mlir::Value stepValue = nestSts.back();
2344+
info.stepVariable = builder->createTemporary(loc, stepValue.getType());
2345+
builder->create<fir::StoreOp>(loc, stepValue, info.stepVariable);
2346+
}
2347+
2348+
if (genDoConcurrent && nestReduceOperands.empty()) {
2349+
// Create DO CONCURRENT reduce operands and attributes
2350+
for (const auto &reduceSym : info.reduceSymList) {
2351+
const fir::ReduceOperationEnum reduceOperation = reduceSym.first;
2352+
const Fortran::semantics::Symbol *sym = reduceSym.second;
2353+
fir::ExtendedValue exv = getSymbolExtendedValue(*sym, nullptr);
2354+
nestReduceOperands.push_back(fir::getBase(exv));
2355+
auto reduceAttr =
2356+
fir::ReduceAttr::get(builder->getContext(), reduceOperation);
2357+
nestReduceAttrs.push_back(reduceAttr);
23422358
}
23432359
}
2360+
}
23442361

2362+
for (auto [info, lowerValue, upperValue, stepValue] :
2363+
llvm::zip_equal(incrementLoopNestInfo, nestLBs, nestUBs, nestSts)) {
23452364
// Structured loop - generate fir.do_loop.
23462365
if (info.isStructured()) {
2366+
if (info.isUnordered)
2367+
continue;
2368+
2369+
// The loop variable is a doLoop op argument.
23472370
mlir::Type loopVarType = info.getLoopVariableType();
2348-
mlir::Value loopValue;
2349-
if (info.isUnordered) {
2350-
llvm::SmallVector<mlir::Value> reduceOperands;
2351-
llvm::SmallVector<mlir::Attribute> reduceAttrs;
2352-
// Create DO CONCURRENT reduce operands and attributes
2353-
for (const auto &reduceSym : info.reduceSymList) {
2354-
const fir::ReduceOperationEnum reduce_operation = reduceSym.first;
2355-
const Fortran::semantics::Symbol *sym = reduceSym.second;
2356-
fir::ExtendedValue exv = getSymbolExtendedValue(*sym, nullptr);
2357-
reduceOperands.push_back(fir::getBase(exv));
2358-
auto reduce_attr =
2359-
fir::ReduceAttr::get(builder->getContext(), reduce_operation);
2360-
reduceAttrs.push_back(reduce_attr);
2361-
}
2362-
// The loop variable value is explicitly updated.
2363-
info.doLoop = builder->create<fir::DoLoopOp>(
2364-
loc, lowerValue, upperValue, stepValue, /*unordered=*/true,
2365-
/*finalCountValue=*/false, /*iterArgs=*/std::nullopt,
2366-
llvm::ArrayRef<mlir::Value>(reduceOperands), reduceAttrs);
2367-
builder->setInsertionPointToStart(info.doLoop.getBody());
2368-
loopValue = builder->createConvert(loc, loopVarType,
2369-
info.doLoop.getInductionVar());
2370-
} else {
2371-
// The loop variable is a doLoop op argument.
2372-
info.doLoop = builder->create<fir::DoLoopOp>(
2373-
loc, lowerValue, upperValue, stepValue, /*unordered=*/false,
2374-
/*finalCountValue=*/true,
2375-
builder->createConvert(loc, loopVarType, lowerValue));
2376-
builder->setInsertionPointToStart(info.doLoop.getBody());
2377-
loopValue = info.doLoop.getRegionIterArgs()[0];
2378-
}
2371+
auto loopOp = builder->create<fir::DoLoopOp>(
2372+
loc, lowerValue, upperValue, stepValue, /*unordered=*/false,
2373+
/*finalCountValue=*/true,
2374+
builder->createConvert(loc, loopVarType, lowerValue));
2375+
info.loopOp = loopOp;
2376+
builder->setInsertionPointToStart(loopOp.getBody());
2377+
mlir::Value loopValue = loopOp.getRegionIterArgs()[0];
2378+
23792379
// Update the loop variable value in case it has non-index references.
23802380
builder->create<fir::StoreOp>(loc, loopValue, info.loopVariable);
2381-
if (info.maskExpr) {
2382-
Fortran::lower::StatementContext stmtCtx;
2383-
mlir::Value maskCond = createFIRExpr(loc, info.maskExpr, stmtCtx);
2384-
stmtCtx.finalizeAndReset();
2385-
mlir::Value maskCondCast =
2386-
builder->createConvert(loc, builder->getI1Type(), maskCond);
2387-
auto ifOp = builder->create<fir::IfOp>(loc, maskCondCast,
2388-
/*withElseRegion=*/false);
2389-
builder->setInsertionPointToStart(&ifOp.getThenRegion().front());
2390-
}
2391-
if (info.hasLocalitySpecs())
2392-
handleLocalitySpecs(info);
2393-
23942381
addLoopAnnotationAttr(info, dirs);
23952382
continue;
23962383
}
@@ -2454,6 +2441,60 @@ class FirConverter : public Fortran::lower::AbstractConverter {
24542441
builder->restoreInsertionPoint(insertPt);
24552442
}
24562443
}
2444+
2445+
if (genDoConcurrent) {
2446+
auto loopWrapperOp = builder->create<fir::DoConcurrentOp>(loc);
2447+
builder->setInsertionPointToStart(
2448+
builder->createBlock(&loopWrapperOp.getRegion()));
2449+
2450+
for (IncrementLoopInfo &info : llvm::reverse(incrementLoopNestInfo)) {
2451+
info.loopVariable = genLoopVariableAddress(loc, *info.loopVariableSym,
2452+
info.isUnordered);
2453+
}
2454+
2455+
builder->setInsertionPointToEnd(loopWrapperOp.getBody());
2456+
auto loopOp = builder->create<fir::DoConcurrentLoopOp>(
2457+
loc, nestLBs, nestUBs, nestSts, nestReduceOperands,
2458+
nestReduceAttrs.empty()
2459+
? nullptr
2460+
: mlir::ArrayAttr::get(builder->getContext(), nestReduceAttrs),
2461+
nullptr);
2462+
2463+
llvm::SmallVector<mlir::Type> loopBlockArgTypes(
2464+
incrementLoopNestInfo.size(), builder->getIndexType());
2465+
llvm::SmallVector<mlir::Location> loopBlockArgLocs(
2466+
incrementLoopNestInfo.size(), loc);
2467+
mlir::Region &loopRegion = loopOp.getRegion();
2468+
mlir::Block *loopBlock = builder->createBlock(
2469+
&loopRegion, loopRegion.begin(), loopBlockArgTypes, loopBlockArgLocs);
2470+
builder->setInsertionPointToStart(loopBlock);
2471+
2472+
for (auto [info, blockArg] :
2473+
llvm::zip_equal(incrementLoopNestInfo, loopBlock->getArguments())) {
2474+
info.loopOp = loopOp;
2475+
mlir::Value loopValue =
2476+
builder->createConvert(loc, info.getLoopVariableType(), blockArg);
2477+
builder->create<fir::StoreOp>(loc, loopValue, info.loopVariable);
2478+
2479+
if (info.maskExpr) {
2480+
Fortran::lower::StatementContext stmtCtx;
2481+
mlir::Value maskCond = createFIRExpr(loc, info.maskExpr, stmtCtx);
2482+
stmtCtx.finalizeAndReset();
2483+
mlir::Value maskCondCast =
2484+
builder->createConvert(loc, builder->getI1Type(), maskCond);
2485+
auto ifOp = builder->create<fir::IfOp>(loc, maskCondCast,
2486+
/*withElseRegion=*/false);
2487+
builder->setInsertionPointToStart(&ifOp.getThenRegion().front());
2488+
}
2489+
}
2490+
2491+
IncrementLoopInfo &innermostInfo = incrementLoopNestInfo.back();
2492+
2493+
if (innermostInfo.hasLocalitySpecs())
2494+
handleLocalitySpecs(innermostInfo);
2495+
2496+
addLoopAnnotationAttr(innermostInfo, dirs);
2497+
}
24572498
}
24582499

24592500
/// Generate FIR to end a structured or unstructured increment loop nest.
@@ -2470,29 +2511,31 @@ class FirConverter : public Fortran::lower::AbstractConverter {
24702511
it != rend; ++it) {
24712512
IncrementLoopInfo &info = *it;
24722513
if (info.isStructured()) {
2473-
// End fir.do_loop.
2514+
// End fir.do_concurent.loop.
24742515
if (info.isUnordered) {
2475-
builder->setInsertionPointAfter(info.doLoop);
2516+
builder->setInsertionPointAfter(info.loopOp->getParentOp());
24762517
continue;
24772518
}
2519+
2520+
// End fir.do_loop.
24782521
// Decrement tripVariable.
2479-
builder->setInsertionPointToEnd(info.doLoop.getBody());
2522+
auto doLoopOp = mlir::cast<fir::DoLoopOp>(info.loopOp);
2523+
builder->setInsertionPointToEnd(doLoopOp.getBody());
24802524
llvm::SmallVector<mlir::Value, 2> results;
24812525
results.push_back(builder->create<mlir::arith::AddIOp>(
2482-
loc, info.doLoop.getInductionVar(), info.doLoop.getStep(),
2483-
iofAttr));
2526+
loc, doLoopOp.getInductionVar(), doLoopOp.getStep(), iofAttr));
24842527
// Step loopVariable to help optimizations such as vectorization.
24852528
// Induction variable elimination will clean up as necessary.
24862529
mlir::Value step = builder->createConvert(
2487-
loc, info.getLoopVariableType(), info.doLoop.getStep());
2530+
loc, info.getLoopVariableType(), doLoopOp.getStep());
24882531
mlir::Value loopVar =
24892532
builder->create<fir::LoadOp>(loc, info.loopVariable);
24902533
results.push_back(
24912534
builder->create<mlir::arith::AddIOp>(loc, loopVar, step, iofAttr));
24922535
builder->create<fir::ResultOp>(loc, results);
2493-
builder->setInsertionPointAfter(info.doLoop);
2536+
builder->setInsertionPointAfter(doLoopOp);
24942537
// The loop control variable may be used after the loop.
2495-
builder->create<fir::StoreOp>(loc, info.doLoop.getResult(1),
2538+
builder->create<fir::StoreOp>(loc, doLoopOp.getResult(1),
24962539
info.loopVariable);
24972540
continue;
24982541
}

flang/lib/Optimizer/Builder/FIRBuilder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ mlir::Block *fir::FirOpBuilder::getAllocaBlock() {
280280
if (auto cufKernelOp = getRegion().getParentOfType<cuf::KernelOp>())
281281
return &cufKernelOp.getRegion().front();
282282

283+
if (auto doConcurentOp = getRegion().getParentOfType<fir::DoConcurrentOp>())
284+
return doConcurentOp.getBody();
285+
283286
return getEntryBlock();
284287
}
285288

flang/test/Lower/do_concurrent.f90

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ subroutine sub1(n)
1414
implicit none
1515
integer :: n, m, i, j, k
1616
integer, dimension(n) :: a
17+
!CHECK: %[[N_DECL:.*]]:2 = hlfir.declare %{{.*}} dummy_scope %{{.*}} {uniq_name = "_QFsub1En"}
18+
!CHECK: %[[A_DECL:.*]]:2 = hlfir.declare %{{.*}}(%{{.*}}) {uniq_name = "_QFsub1Ea"}
19+
1720
!CHECK: %[[LB1:.*]] = arith.constant 1 : i32
1821
!CHECK: %[[LB1_CVT:.*]] = fir.convert %[[LB1]] : (i32) -> index
1922
!CHECK: %[[UB1:.*]] = fir.load %{{.*}}#0 : !fir.ref<i32>
@@ -29,10 +32,30 @@ subroutine sub1(n)
2932
!CHECK: %[[UB3:.*]] = arith.constant 10 : i32
3033
!CHECK: %[[UB3_CVT:.*]] = fir.convert %[[UB3]] : (i32) -> index
3134

32-
!CHECK: fir.do_loop %{{.*}} = %[[LB1_CVT]] to %[[UB1_CVT]] step %{{.*}} unordered
33-
!CHECK: fir.do_loop %{{.*}} = %[[LB2_CVT]] to %[[UB2_CVT]] step %{{.*}} unordered
34-
!CHECK: fir.do_loop %{{.*}} = %[[LB3_CVT]] to %[[UB3_CVT]] step %{{.*}} unordered
35+
!CHECK: fir.do_concurrent
36+
!CHECK: %[[I:.*]] = fir.alloca i32 {bindc_name = "i"}
37+
!CHECK: %[[I_DECL:.*]]:2 = hlfir.declare %[[I]]
38+
!CHECK: %[[J:.*]] = fir.alloca i32 {bindc_name = "j"}
39+
!CHECK: %[[J_DECL:.*]]:2 = hlfir.declare %[[J]]
40+
!CHECK: %[[K:.*]] = fir.alloca i32 {bindc_name = "k"}
41+
!CHECK: %[[K_DECL:.*]]:2 = hlfir.declare %[[K]]
42+
43+
!CHECK: fir.do_concurrent.loop (%[[I_IV:.*]], %[[J_IV:.*]], %[[K_IV:.*]]) =
44+
!CHECK-SAME: (%[[LB1_CVT]], %[[LB2_CVT]], %[[LB3_CVT]]) to
45+
!CHECK-SAME: (%[[UB1_CVT]], %[[UB2_CVT]], %[[UB3_CVT]]) step
46+
!CHECK-SAME: (%{{.*}}, %{{.*}}, %{{.*}}) {
47+
!CHECK: %[[I_IV_CVT:.*]] = fir.convert %[[I_IV]] : (index) -> i32
48+
!CHECK: fir.store %[[I_IV_CVT]] to %[[I_DECL]]#0 : !fir.ref<i32>
49+
!CHECK: %[[J_IV_CVT:.*]] = fir.convert %[[J_IV]] : (index) -> i32
50+
!CHECK: fir.store %[[J_IV_CVT]] to %[[J_DECL]]#0 : !fir.ref<i32>
51+
!CHECK: %[[K_IV_CVT:.*]] = fir.convert %[[K_IV]] : (index) -> i32
52+
!CHECK: fir.store %[[K_IV_CVT]] to %[[K_DECL]]#0 : !fir.ref<i32>
3553

54+
!CHECK: %[[N_VAL:.*]] = fir.load %[[N_DECL]]#0 : !fir.ref<i32>
55+
!CHECK: %[[I_VAL:.*]] = fir.load %[[I_DECL]]#0 : !fir.ref<i32>
56+
!CHECK: %[[I_VAL_CVT:.*]] = fir.convert %[[I_VAL]] : (i32) -> i64
57+
!CHECK: %[[A_ELEM:.*]] = hlfir.designate %[[A_DECL]]#0 (%[[I_VAL_CVT]])
58+
!CHECK: hlfir.assign %[[N_VAL]] to %[[A_ELEM]] : i32, !fir.ref<i32>
3659
do concurrent(i=1:n, j=1:bar(n*m, n/m), k=5:10)
3760
a(i) = n
3861
end do
@@ -45,22 +68,24 @@ subroutine sub2(n)
4568
integer, dimension(n) :: a
4669
!CHECK: %[[LB1:.*]] = arith.constant 1 : i32
4770
!CHECK: %[[LB1_CVT:.*]] = fir.convert %[[LB1]] : (i32) -> index
48-
!CHECK: %[[UB1:.*]] = fir.load %5#0 : !fir.ref<i32>
71+
!CHECK: %[[UB1:.*]] = fir.load %{{.*}}#0 : !fir.ref<i32>
4972
!CHECK: %[[UB1_CVT:.*]] = fir.convert %[[UB1]] : (i32) -> index
50-
!CHECK: fir.do_loop %{{.*}} = %[[LB1_CVT]] to %[[UB1_CVT]] step %{{.*}} unordered
73+
!CHECK: fir.do_concurrent
74+
!CHECK: fir.do_concurrent.loop (%{{.*}}) = (%[[LB1_CVT]]) to (%[[UB1_CVT]]) step (%{{.*}})
75+
5176
!CHECK: %[[LB2:.*]] = arith.constant 1 : i32
5277
!CHECK: %[[LB2_CVT:.*]] = fir.convert %[[LB2]] : (i32) -> index
5378
!CHECK: %[[UB2:.*]] = fir.call @_QPbar(%{{.*}}, %{{.*}}) proc_attrs<pure> fastmath<contract> : (!fir.ref<i32>, !fir.ref<i32>) -> i32
5479
!CHECK: %[[UB2_CVT:.*]] = fir.convert %[[UB2]] : (i32) -> index
55-
!CHECK: fir.do_loop %{{.*}} = %[[LB2_CVT]] to %[[UB2_CVT]] step %{{.*}} unordered
80+
!CHECK: fir.do_concurrent
81+
!CHECK: fir.do_concurrent.loop (%{{.*}}) = (%[[LB2_CVT]]) to (%[[UB2_CVT]]) step (%{{.*}})
5682
do concurrent(i=1:n)
5783
do concurrent(j=1:bar(n*m, n/m))
5884
a(i) = n
5985
end do
6086
end do
6187
end subroutine
6288

63-
6489
!CHECK-LABEL: unstructured
6590
subroutine unstructured(inner_step)
6691
integer(4) :: i, j, inner_step

flang/test/Lower/do_concurrent_local_default_init.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ subroutine test_default_init()
2929
! CHECK-SAME: %[[VAL_0:.*]]: !fir.ref<!fir.box<!fir.ptr<!fir.array<?x!fir.char<1,?>>>>> {fir.bindc_name = "p"}) {
3030
! CHECK: %[[VAL_6:.*]] = fir.load %[[VAL_0]] : !fir.ref<!fir.box<!fir.ptr<!fir.array<?x!fir.char<1,?>>>>>
3131
! CHECK: %[[VAL_7:.*]] = fir.box_elesize %[[VAL_6]] : (!fir.box<!fir.ptr<!fir.array<?x!fir.char<1,?>>>>) -> index
32-
! CHECK: fir.do_loop
32+
! CHECK: fir.do_concurrent.loop
3333
! CHECK: %[[VAL_16:.*]] = fir.alloca !fir.box<!fir.ptr<!fir.array<?x!fir.char<1,?>>>> {bindc_name = "p", pinned, uniq_name = "_QFtest_ptrEp"}
3434
! CHECK: %[[VAL_17:.*]] = fir.zero_bits !fir.ptr<!fir.array<?x!fir.char<1,?>>>
3535
! CHECK: %[[VAL_18:.*]] = arith.constant 0 : index
@@ -43,7 +43,7 @@ subroutine test_default_init()
4343
! CHECK: }
4444

4545
! CHECK-LABEL: func.func @_QPtest_default_init(
46-
! CHECK: fir.do_loop
46+
! CHECK: fir.do_concurrent.loop
4747
! CHECK: %[[VAL_26:.*]] = fir.alloca !fir.type<_QFtest_default_initTt{i:i32}> {bindc_name = "a", pinned, uniq_name = "_QFtest_default_initEa"}
4848
! CHECK: %[[VAL_27:.*]] = fir.embox %[[VAL_26]] : (!fir.ref<!fir.type<_QFtest_default_initTt{i:i32}>>) -> !fir.box<!fir.type<_QFtest_default_initTt{i:i32}>>
4949
! CHECK: %[[VAL_30:.*]] = fir.convert %[[VAL_27]] : (!fir.box<!fir.type<_QFtest_default_initTt{i:i32}>>) -> !fir.box<none>

0 commit comments

Comments
 (0)