@@ -406,19 +406,6 @@ fir::ShapeOp genShapeOp(mlir::OpBuilder &builder, fir::SequenceType seqTy,
406
406
return builder.create <fir::ShapeOp>(loc, extents);
407
407
}
408
408
409
- // / Return the nested sequence type if any.
410
- static mlir::Type extractSequenceType (mlir::Type ty) {
411
- if (mlir::isa<fir::SequenceType>(ty))
412
- return ty;
413
- if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(ty))
414
- return extractSequenceType (boxTy.getEleTy ());
415
- if (auto heapTy = mlir::dyn_cast<fir::HeapType>(ty))
416
- return extractSequenceType (heapTy.getEleTy ());
417
- if (auto ptrTy = mlir::dyn_cast<fir::PointerType>(ty))
418
- return extractSequenceType (ptrTy.getEleTy ());
419
- return mlir::Type{};
420
- }
421
-
422
409
template <typename RecipeOp>
423
410
static void genPrivateLikeInitRegion (mlir::OpBuilder &builder, RecipeOp recipe,
424
411
mlir::Type ty, mlir::Location loc) {
@@ -454,7 +441,7 @@ static void genPrivateLikeInitRegion(mlir::OpBuilder &builder, RecipeOp recipe,
454
441
}
455
442
}
456
443
} else if (auto boxTy = mlir::dyn_cast_or_null<fir::BaseBoxType>(ty)) {
457
- mlir::Type innerTy = extractSequenceType (boxTy);
444
+ mlir::Type innerTy = fir:: extractSequenceType (boxTy);
458
445
if (!innerTy)
459
446
TODO (loc, " Unsupported boxed type in OpenACC privatization" );
460
447
fir::FirOpBuilder firBuilder{builder, recipe.getOperation ()};
@@ -688,7 +675,7 @@ mlir::acc::FirstprivateRecipeOp Fortran::lower::createOrGetFirstprivateRecipe(
688
675
} else if (auto boxTy = mlir::dyn_cast_or_null<fir::BaseBoxType>(ty)) {
689
676
fir::FirOpBuilder firBuilder{builder, recipe.getOperation ()};
690
677
llvm::SmallVector<mlir::Value> tripletArgs;
691
- mlir::Type innerTy = extractSequenceType (boxTy);
678
+ mlir::Type innerTy = fir:: extractSequenceType (boxTy);
692
679
fir::SequenceType seqTy =
693
680
mlir::dyn_cast_or_null<fir::SequenceType>(innerTy);
694
681
if (!seqTy)
@@ -1018,7 +1005,7 @@ static mlir::Value genReductionInitRegion(fir::FirOpBuilder &builder,
1018
1005
return declareOp.getBase ();
1019
1006
}
1020
1007
} else if (auto boxTy = mlir::dyn_cast_or_null<fir::BaseBoxType>(ty)) {
1021
- mlir::Type innerTy = extractSequenceType (boxTy);
1008
+ mlir::Type innerTy = fir:: extractSequenceType (boxTy);
1022
1009
if (!mlir::isa<fir::SequenceType>(innerTy))
1023
1010
TODO (loc, " Unsupported boxed type for reduction" );
1024
1011
// Create the private copy from the initial fir.box.
@@ -1230,7 +1217,7 @@ static void genCombiner(fir::FirOpBuilder &builder, mlir::Location loc,
1230
1217
builder.create <fir::StoreOp>(loc, res, addr1);
1231
1218
builder.setInsertionPointAfter (loops[0 ]);
1232
1219
} else if (auto boxTy = mlir::dyn_cast<fir::BaseBoxType>(ty)) {
1233
- mlir::Type innerTy = extractSequenceType (boxTy);
1220
+ mlir::Type innerTy = fir:: extractSequenceType (boxTy);
1234
1221
fir::SequenceType seqTy =
1235
1222
mlir::dyn_cast_or_null<fir::SequenceType>(innerTy);
1236
1223
if (!seqTy)
0 commit comments