Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions flang/lib/Lower/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ static std::pair<mlir::Value, mlir::Value> getStatAndErrmsg(
}

if (!statExpr) {
statExpr = builder.create<fir::AbsentOp>(
loc, builder.getRefType(builder.getI32Type()));
statExpr = fir::AbsentOp::create(builder, loc,
builder.getRefType(builder.getI32Type()));
}
if (!errMsgExpr) {
errMsgExpr = builder.create<fir::AbsentOp>(
loc, fir::BoxType::get(fir::CharacterType::get(
builder.getContext(), 1, fir::CharacterType::unknownLen())));
errMsgExpr = fir::AbsentOp::create(
builder, loc,
fir::BoxType::get(fir::CharacterType::get(
builder.getContext(), 1, fir::CharacterType::unknownLen())));
}
return {statExpr, errMsgExpr};
}
Expand Down Expand Up @@ -244,10 +245,11 @@ void Fortran::lower::genSyncImagesStatement(
fir::getBase(converter.genExprBox(loc, *expr, stmtCtx));
},
[&](const Fortran::parser::Star &) {
imageSet = builder.create<fir::AbsentOp>(
loc, fir::BoxType::get(fir::SequenceType::get(
{fir::SequenceType::getUnknownExtent()},
builder.getI32Type())));
imageSet = fir::AbsentOp::create(
builder, loc,
fir::BoxType::get(fir::SequenceType::get(
{fir::SequenceType::getUnknownExtent()},
builder.getI32Type())));
}},
imgSet.u);

Expand Down
14 changes: 8 additions & 6 deletions flang/lib/Optimizer/Builder/Runtime/Coarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ genErrmsgPRIF(fir::FirOpBuilder &builder, mlir::Location loc,
mlir::Value errmsg) {
bool isAllocatableErrmsg = fir::isAllocatableType(errmsg.getType());

mlir::Value absent = builder.create<fir::AbsentOp>(loc, PRIF_ERRMSG_TYPE);
mlir::Value absent = fir::AbsentOp::create(builder, loc, PRIF_ERRMSG_TYPE);
mlir::Value errMsg = isAllocatableErrmsg ? absent : errmsg;
mlir::Value errMsgAlloc = isAllocatableErrmsg ? errmsg : absent;
return {errMsg, errMsgAlloc};
Expand All @@ -43,7 +43,8 @@ mlir::Value fir::runtime::genInitCoarray(fir::FirOpBuilder &builder,
llvm::SmallVector<mlir::Value> args =
fir::runtime::createArguments(builder, loc, ftype, result);
fir::CallOp::create(builder, loc, funcOp, args);
return builder.create<fir::LoadOp>(loc, result);

return fir::LoadOp::create(builder, loc, result);
}

/// Generate Call to runtime prif_num_images
Expand All @@ -57,7 +58,8 @@ mlir::Value fir::runtime::getNumImages(fir::FirOpBuilder &builder,
llvm::SmallVector<mlir::Value> args =
fir::runtime::createArguments(builder, loc, ftype, result);
fir::CallOp::create(builder, loc, funcOp, args);
return builder.create<fir::LoadOp>(loc, result);

return fir::LoadOp::create(builder, loc, result);
}

/// Generate Call to runtime prif_num_images_with_{team|team_number}
Expand All @@ -82,7 +84,7 @@ mlir::Value fir::runtime::getNumImagesWithTeam(fir::FirOpBuilder &builder,
llvm::SmallVector<mlir::Value> args =
fir::runtime::createArguments(builder, loc, ftype, team, result);
fir::CallOp::create(builder, loc, funcOp, args);
return builder.create<fir::LoadOp>(loc, result);
return fir::LoadOp::create(builder, loc, result);
}

/// Generate Call to runtime prif_this_image_no_coarray
Expand All @@ -96,11 +98,11 @@ mlir::Value fir::runtime::getThisImage(fir::FirOpBuilder &builder,

mlir::Value result = builder.createTemporary(loc, builder.getI32Type());
mlir::Value teamArg =
!team ? builder.create<fir::AbsentOp>(loc, boxTy) : team;
!team ? fir::AbsentOp::create(builder, loc, boxTy) : team;
llvm::SmallVector<mlir::Value> args =
fir::runtime::createArguments(builder, loc, ftype, teamArg, result);
fir::CallOp::create(builder, loc, funcOp, args);
return builder.create<fir::LoadOp>(loc, result);
return fir::LoadOp::create(builder, loc, result);
}

/// Generate call to runtime subroutine prif_sync_all
Expand Down