firOpBuilder, currentLocation, operands, operandSegments);
if (addAsyncAttr)
- enterDataOp.asyncAttr(firOpBuilder.getUnitAttr());
+ enterDataOp.setAsyncAttr(firOpBuilder.getUnitAttr());
if (addWaitAttr)
- enterDataOp.waitAttr(firOpBuilder.getUnitAttr());
+ enterDataOp.setWaitAttr(firOpBuilder.getUnitAttr());
}
static void
firOpBuilder, currentLocation, operands, operandSegments);
if (addAsyncAttr)
- exitDataOp.asyncAttr(firOpBuilder.getUnitAttr());
+ exitDataOp.setAsyncAttr(firOpBuilder.getUnitAttr());
if (addWaitAttr)
- exitDataOp.waitAttr(firOpBuilder.getUnitAttr());
+ exitDataOp.setWaitAttr(firOpBuilder.getUnitAttr());
if (addFinalizeAttr)
- exitDataOp.finalizeAttr(firOpBuilder.getUnitAttr());
+ exitDataOp.setFinalizeAttr(firOpBuilder.getUnitAttr());
}
template <typename Op>
firOpBuilder, currentLocation, operands, operandSegments);
if (addAsyncAttr)
- updateOp.asyncAttr(firOpBuilder.getUnitAttr());
+ updateOp.setAsyncAttr(firOpBuilder.getUnitAttr());
if (addWaitAttr)
- updateOp.waitAttr(firOpBuilder.getUnitAttr());
+ updateOp.setWaitAttr(firOpBuilder.getUnitAttr());
if (addIfPresentAttr)
- updateOp.ifPresentAttr(firOpBuilder.getUnitAttr());
+ updateOp.setIfPresentAttr(firOpBuilder.getUnitAttr());
}
static void
firOpBuilder, currentLocation, operands, operandSegments);
if (addAsyncAttr)
- waitOp.asyncAttr(firOpBuilder.getUnitAttr());
+ waitOp.setAsyncAttr(firOpBuilder.getUnitAttr());
}
void Fortran::lower::genOpenACCConstruct(
// TODO: Add lastprivate support for sections construct, simd construct
if (std::is_same_v<Op, omp::WsLoopOp>) {
omp::WsLoopOp *wsLoopOp = dyn_cast<omp::WsLoopOp>(&op);
- mlir::Operation *lastOper = wsLoopOp->region().back().getTerminator();
+ mlir::Operation *lastOper =
+ wsLoopOp->getRegion().back().getTerminator();
firOpBuilder.setInsertionPoint(lastOper);
// Our goal here is to introduce the following control flow
cmpOp = firOpBuilder.create<mlir::arith::CmpIOp>(
wsLoopOp->getLoc(), mlir::arith::CmpIPredicate::eq,
wsLoopOp->getRegion().front().getArguments()[0],
- wsLoopOp->upperBound()[0]);
+ wsLoopOp->getUpperBound()[0]);
}
mlir::scf::IfOp ifOp = firOpBuilder.create<mlir::scf::IfOp>(
wsLoopOp->getLoc(), cmpOp, /*else*/ false);
assert(mlir::isa<mlir::omp::ThreadprivateOp>(op) &&
"The threadprivate operation not created");
mlir::Value symValue =
- mlir::dyn_cast<mlir::omp::ThreadprivateOp>(op).sym_addr();
+ mlir::dyn_cast<mlir::omp::ThreadprivateOp>(op).getSymAddr();
return firOpBuilder.create<mlir::omp::ThreadprivateOp>(
currentLocation, symValue.getType(), symValue);
};
modBuilder.create<omp::ReductionDeclareOp>(loc, reductionOpName, type);
else
return decl;
- builder.createBlock(&decl.initializerRegion(), decl.initializerRegion().end(),
- {type}, {loc});
- builder.setInsertionPointToEnd(&decl.initializerRegion().back());
+ builder.createBlock(&decl.getInitializerRegion(),
+ decl.getInitializerRegion().end(), {type}, {loc});
+ builder.setInsertionPointToEnd(&decl.getInitializerRegion().back());
Value init = getReductionInitValue(loc, type, reductionOpName, builder);
builder.create<omp::YieldOp>(loc, init);
- builder.createBlock(&decl.reductionRegion(), decl.reductionRegion().end(),
- {type, type}, {loc, loc});
- builder.setInsertionPointToEnd(&decl.reductionRegion().back());
- mlir::Value op1 = decl.reductionRegion().front().getArgument(0);
- mlir::Value op2 = decl.reductionRegion().front().getArgument(1);
+ builder.createBlock(&decl.getReductionRegion(),
+ decl.getReductionRegion().end(), {type, type},
+ {loc, loc});
+ builder.setInsertionPointToEnd(&decl.getReductionRegion().back());
+ mlir::Value op1 = decl.getReductionRegion().front().getArgument(0);
+ mlir::Value op2 = decl.getReductionRegion().front().getArgument(1);
Value reductionOp;
switch (intrinsicOp) {
"Reduction of some types is not supported");
}
reductionDeclSymbols.push_back(SymbolRefAttr::get(
- firOpBuilder.getContext(), decl.sym_name()));
+ firOpBuilder.getContext(), decl.getSymName()));
}
}
}
const auto *expr = Fortran::semantics::GetExpr(orderedClause->v);
const std::optional<std::int64_t> orderedClauseValue =
Fortran::evaluate::ToInt64(*expr);
- wsLoopOp.ordered_valAttr(
+ wsLoopOp.setOrderedValAttr(
firOpBuilder.getI64IntegerAttr(*orderedClauseValue));
} else {
- wsLoopOp.ordered_valAttr(firOpBuilder.getI64IntegerAttr(0));
+ wsLoopOp.setOrderedValAttr(firOpBuilder.getI64IntegerAttr(0));
}
} else if (const auto &scheduleClause =
std::get_if<Fortran::parser::OmpClause::Schedule>(
scheduleType.t);
switch (scheduleKind) {
case Fortran::parser::OmpScheduleClause::ScheduleType::Static:
- wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get(
+ wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get(
context, omp::ClauseScheduleKind::Static));
break;
case Fortran::parser::OmpScheduleClause::ScheduleType::Dynamic:
- wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get(
+ wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get(
context, omp::ClauseScheduleKind::Dynamic));
break;
case Fortran::parser::OmpScheduleClause::ScheduleType::Guided:
- wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get(
+ wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get(
context, omp::ClauseScheduleKind::Guided));
break;
case Fortran::parser::OmpScheduleClause::ScheduleType::Auto:
- wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get(
+ wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get(
context, omp::ClauseScheduleKind::Auto));
break;
case Fortran::parser::OmpScheduleClause::ScheduleType::Runtime:
- wsLoopOp.schedule_valAttr(omp::ClauseScheduleKindAttr::get(
+ wsLoopOp.setScheduleValAttr(omp::ClauseScheduleKindAttr::get(
context, omp::ClauseScheduleKind::Runtime));
break;
}
mlir::omp::ScheduleModifier scheduleModifier =
getScheduleModifier(scheduleClause->v);
if (scheduleModifier != mlir::omp::ScheduleModifier::none)
- wsLoopOp.schedule_modifierAttr(
+ wsLoopOp.setScheduleModifierAttr(
omp::ScheduleModifierAttr::get(context, scheduleModifier));
if (getSIMDModifier(scheduleClause->v) !=
mlir::omp::ScheduleModifier::none)
- wsLoopOp.simd_modifierAttr(firOpBuilder.getUnitAttr());
+ wsLoopOp.setSimdModifierAttr(firOpBuilder.getUnitAttr());
}
}
// In FORTRAN `nowait` clause occur at the end of `omp do` directive.
std::get<Fortran::parser::OmpClauseList>((*endClauseList).t);
for (const Fortran::parser::OmpClause &clause : clauseList.v)
if (std::get_if<Fortran::parser::OmpClause::Nowait>(&clause.u))
- wsLoopOp.nowaitAttr(firOpBuilder.getUnitAttr());
+ wsLoopOp.setNowaitAttr(firOpBuilder.getUnitAttr());
}
createBodyOfOp<omp::WsLoopOp>(wsLoopOp, converter, currentLocation, eval,
currentLocation, name, hint);
return firOpBuilder.create<mlir::omp::CriticalOp>(
currentLocation, mlir::FlatSymbolRefAttr::get(
- firOpBuilder.getContext(), global.sym_name()));
+ firOpBuilder.getContext(), global.getSymName()));
}
}();
createBodyOfOp<omp::CriticalOp>(criticalOp, converter, currentLocation, eval);
llvm::TypeSwitch<Operation *, void>(loadOp)
.Case<AffineLoadOp, memref::LoadOp>([&](auto op) {
- rewriter.replaceOpWithNewOp<decltype(op)>(loadOp, subViewOp.source(),
+ rewriter.replaceOpWithNewOp<decltype(op)>(loadOp, subViewOp.getSource(),
sourceIndices);
})
.Case([&](vector::TransferReadOp transferReadOp) {
rewriter.replaceOpWithNewOp<vector::TransferReadOp>(
- transferReadOp, transferReadOp.getVectorType(), subViewOp.source(),
- sourceIndices,
+ transferReadOp, transferReadOp.getVectorType(),
+ subViewOp.getSource(), sourceIndices,
getPermutationMapAttr(rewriter.getContext(), subViewOp,
transferReadOp.getPermutationMap()),
transferReadOp.getPadding(),
llvm::TypeSwitch<Operation *, void>(storeOp)
.Case<AffineStoreOp, memref::StoreOp>([&](auto op) {
rewriter.replaceOpWithNewOp<decltype(op)>(
- storeOp, storeOp.getValue(), subViewOp.source(), sourceIndices);
+ storeOp, storeOp.getValue(), subViewOp.getSource(), sourceIndices);
})
.Case([&](vector::TransferWriteOp op) {
rewriter.replaceOpWithNewOp<vector::TransferWriteOp>(
- op, op.getValue(), subViewOp.source(), sourceIndices,
+ op, op.getValue(), subViewOp.getSource(), sourceIndices,
getPermutationMapAttr(rewriter.getContext(), subViewOp,
op.getPermutationMap()),
op.getInBoundsAttr());