Skip to content

Commit f0d749d

Browse files
committed
Changed renaming rules after discussion
1 parent 9484bb1 commit f0d749d

File tree

86 files changed

+460
-459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+460
-459
lines changed

flang/lib/Lower/OpenMP/ClauseProcessor.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,8 @@ bool ClauseProcessor::processMap(
870870

871871
Fortran::lower::AddrAndBoundsInfo info =
872872
Fortran::lower::gatherDataOperandAddrAndBounds<
873-
Fortran::parser::OmpObject, mlir::omp::DataBoundsOp,
874-
mlir::omp::DataBoundsType>(
873+
Fortran::parser::OmpObject, mlir::omp::MapBoundsOp,
874+
mlir::omp::MapBoundsType>(
875875
converter, firOpBuilder, semaCtx, stmtCtx, ompObject,
876876
clauseLocation, asFortran, bounds, treatIndexAsSection);
877877

@@ -914,8 +914,9 @@ bool ClauseProcessor::processReduction(
914914
[&](const omp::clause::Reduction &clause,
915915
const Fortran::parser::CharBlock &) {
916916
ReductionProcessor rp;
917-
rp.addReductionDecl(currentLocation, converter, clause, reductionVars,
918-
reductionDeclSymbols, reductionSymbols);
917+
rp.addDeclareReduction(currentLocation, converter, clause,
918+
reductionVars, reductionDeclSymbols,
919+
reductionSymbols);
919920
});
920921
}
921922

flang/lib/Lower/OpenMP/ClauseProcessor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ bool ClauseProcessor::processMotionClauses(
217217
std::stringstream asFortran;
218218
Fortran::lower::AddrAndBoundsInfo info =
219219
Fortran::lower::gatherDataOperandAddrAndBounds<
220-
Fortran::parser::OmpObject, mlir::omp::DataBoundsOp,
221-
mlir::omp::DataBoundsType>(
220+
Fortran::parser::OmpObject, mlir::omp::MapBoundsOp,
221+
mlir::omp::MapBoundsType>(
222222
converter, firOpBuilder, semaCtx, stmtCtx, ompObject,
223223
clauseLocation, asFortran, bounds, treatIndexAsSection);
224224

flang/lib/Lower/OpenMP/DataSharingProcessor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
208208
firOpBuilder.restoreInsertionPoint(unstructuredSectionsIP);
209209
}
210210
}
211-
} else if (mlir::isa<mlir::omp::WsLoopOp>(op)) {
211+
} else if (mlir::isa<mlir::omp::WsloopOp>(op)) {
212212
// Update the original variable just before exiting the worksharing
213213
// loop. Conversion as follows:
214214
//
@@ -237,8 +237,8 @@ void DataSharingProcessor::insertLastPrivateCompare(mlir::Operation *op) {
237237

238238
mlir::Value iv = op->getRegion(0).front().getArguments()[0];
239239
mlir::Value ub =
240-
mlir::dyn_cast<mlir::omp::WsLoopOp>(op).getUpperBound()[0];
241-
mlir::Value step = mlir::dyn_cast<mlir::omp::WsLoopOp>(op).getStep()[0];
240+
mlir::dyn_cast<mlir::omp::WsloopOp>(op).getUpperBound()[0];
241+
mlir::Value step = mlir::dyn_cast<mlir::omp::WsloopOp>(op).getStep()[0];
242242

243243
// v = iv + step
244244
// cmp = step < 0 ? v < ub : v > ub

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ static void createBodyOfOp(Op &op, OpWithBodyGenInfo &info) {
365365

366366
// Start with privatization, so that the lowering of the nested
367367
// code will use the right symbols.
368-
constexpr bool isLoop = std::is_same_v<Op, mlir::omp::WsLoopOp> ||
368+
constexpr bool isLoop = std::is_same_v<Op, mlir::omp::WsloopOp> ||
369369
std::is_same_v<Op, mlir::omp::SimdLoopOp>;
370370
bool privatize = info.clauses && !info.outerCombined;
371371

@@ -1162,15 +1162,15 @@ genTargetOp(Fortran::lower::AbstractConverter &converter,
11621162
converter.getCurrentLocation());
11631163
if (fir::unwrapRefType(info.addr.getType()).isa<fir::BaseBoxType>())
11641164
bounds =
1165-
Fortran::lower::genBoundsOpsFromBox<mlir::omp::DataBoundsOp,
1166-
mlir::omp::DataBoundsType>(
1165+
Fortran::lower::genBoundsOpsFromBox<mlir::omp::MapBoundsOp,
1166+
mlir::omp::MapBoundsType>(
11671167
converter.getFirOpBuilder(), converter.getCurrentLocation(),
11681168
converter, dataExv, info);
11691169
if (fir::unwrapRefType(info.addr.getType()).isa<fir::SequenceType>()) {
11701170
bool dataExvIsAssumedSize =
11711171
Fortran::semantics::IsAssumedSizeArray(sym.GetUltimate());
1172-
bounds = Fortran::lower::genBaseBoundsOps<mlir::omp::DataBoundsOp,
1173-
mlir::omp::DataBoundsType>(
1172+
bounds = Fortran::lower::genBaseBoundsOps<mlir::omp::MapBoundsOp,
1173+
mlir::omp::MapBoundsType>(
11741174
converter.getFirOpBuilder(), converter.getCurrentLocation(),
11751175
converter, dataExv, dataExvIsAssumedSize);
11761176
}
@@ -1625,7 +1625,7 @@ createSimdLoop(Fortran::lower::AbstractConverter &converter,
16251625
.setGenRegionEntryCb(ivCallback));
16261626
}
16271627

1628-
static void createWsLoop(Fortran::lower::AbstractConverter &converter,
1628+
static void createWsloop(Fortran::lower::AbstractConverter &converter,
16291629
Fortran::semantics::SemanticsContext &semaCtx,
16301630
Fortran::lower::pft::Evaluation &eval,
16311631
llvm::omp::Directive ompDirective,
@@ -1665,7 +1665,7 @@ static void createWsLoop(Fortran::lower::AbstractConverter &converter,
16651665
if (ReductionProcessor::doReductionByRef(reductionVars))
16661666
byrefOperand = firOpBuilder.getUnitAttr();
16671667

1668-
auto wsLoopOp = firOpBuilder.create<mlir::omp::WsLoopOp>(
1668+
auto wsLoopOp = firOpBuilder.create<mlir::omp::WsloopOp>(
16691669
loc, lowerBound, upperBound, step, linearVars, linearStepVars,
16701670
reductionVars,
16711671
reductionDeclSymbols.empty()
@@ -1712,15 +1712,15 @@ static void createWsLoop(Fortran::lower::AbstractConverter &converter,
17121712
reductionTypes);
17131713
};
17141714

1715-
createBodyOfOp<mlir::omp::WsLoopOp>(
1715+
createBodyOfOp<mlir::omp::WsloopOp>(
17161716
wsLoopOp, OpWithBodyGenInfo(converter, semaCtx, loc, *nestedEval)
17171717
.setClauses(&beginClauseList)
17181718
.setDataSharingProcessor(&dsp)
17191719
.setReductions(&reductionSymbols, &reductionTypes)
17201720
.setGenRegionEntryCb(ivCallback));
17211721
}
17221722

1723-
static void createSimdWsLoop(
1723+
static void createSimdWsloop(
17241724
Fortran::lower::AbstractConverter &converter,
17251725
Fortran::semantics::SemanticsContext &semaCtx,
17261726
Fortran::lower::pft::Evaluation &eval, llvm::omp::Directive ompDirective,
@@ -1740,7 +1740,7 @@ static void createSimdWsLoop(
17401740
// When support for vectorization is enabled, then we need to add handling of
17411741
// if clause. Currently if clause can be skipped because we always assume
17421742
// SIMD length = 1.
1743-
createWsLoop(converter, semaCtx, eval, ompDirective, beginClauseList,
1743+
createWsloop(converter, semaCtx, eval, ompDirective, beginClauseList,
17441744
endClauseList, loc);
17451745
}
17461746

@@ -1812,7 +1812,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
18121812

18131813
if (llvm::omp::allDoSimdSet.test(ompDirective)) {
18141814
// 2.9.3.2 Workshare SIMD construct
1815-
createSimdWsLoop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
1815+
createSimdWsloop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
18161816
endClauseList, currentLocation);
18171817

18181818
} else if (llvm::omp::allSimdSet.test(ompDirective)) {
@@ -1821,7 +1821,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
18211821
currentLocation);
18221822
genOpenMPReduction(converter, semaCtx, loopOpClauseList);
18231823
} else {
1824-
createWsLoop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
1824+
createWsloop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
18251825
endClauseList, currentLocation);
18261826
}
18271827
}
@@ -2260,7 +2260,7 @@ genOMP(Fortran::lower::AbstractConverter &converter,
22602260
mlir::Operation *Fortran::lower::genOpenMPTerminator(fir::FirOpBuilder &builder,
22612261
mlir::Operation *op,
22622262
mlir::Location loc) {
2263-
if (mlir::isa<mlir::omp::WsLoopOp, mlir::omp::ReductionDeclareOp,
2263+
if (mlir::isa<mlir::omp::WsloopOp, mlir::omp::DeclareReductionOp,
22642264
mlir::omp::AtomicUpdateOp, mlir::omp::SimdLoopOp>(op))
22652265
return builder.create<mlir::omp::YieldOp>(loc);
22662266
else

flang/lib/Lower/OpenMP/ReductionProcessor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ createReductionInitRegion(fir::FirOpBuilder &builder, mlir::Location loc,
456456
TODO(loc, "createReductionInitRegion for unsupported type");
457457
}
458458

459-
mlir::omp::ReductionDeclareOp ReductionProcessor::createReductionDecl(
459+
mlir::omp::DeclareReductionOp ReductionProcessor::createDeclareReduction(
460460
fir::FirOpBuilder &builder, llvm::StringRef reductionOpName,
461461
const ReductionIdentifier redId, mlir::Type type, mlir::Location loc,
462462
bool isByRef) {
@@ -467,7 +467,7 @@ mlir::omp::ReductionDeclareOp ReductionProcessor::createReductionDecl(
467467
TODO(loc, "Reduction of some types is not supported");
468468

469469
auto decl =
470-
module.lookupSymbol<mlir::omp::ReductionDeclareOp>(reductionOpName);
470+
module.lookupSymbol<mlir::omp::DeclareReductionOp>(reductionOpName);
471471
if (decl)
472472
return decl;
473473

@@ -476,7 +476,7 @@ mlir::omp::ReductionDeclareOp ReductionProcessor::createReductionDecl(
476476
if (!isByRef)
477477
type = valTy;
478478

479-
decl = modBuilder.create<mlir::omp::ReductionDeclareOp>(loc, reductionOpName,
479+
decl = modBuilder.create<mlir::omp::DeclareReductionOp>(loc, reductionOpName,
480480
type);
481481
builder.createBlock(&decl.getInitializerRegion(),
482482
decl.getInitializerRegion().end(), {type}, {loc});
@@ -520,7 +520,7 @@ bool ReductionProcessor::doReductionByRef(
520520
return false;
521521
}
522522

523-
void ReductionProcessor::addReductionDecl(
523+
void ReductionProcessor::addDeclareReduction(
524524
mlir::Location currentLocation,
525525
Fortran::lower::AbstractConverter &converter,
526526
const omp::clause::Reduction &reduction,
@@ -529,7 +529,7 @@ void ReductionProcessor::addReductionDecl(
529529
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
530530
*reductionSymbols) {
531531
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
532-
mlir::omp::ReductionDeclareOp decl;
532+
mlir::omp::DeclareReductionOp decl;
533533
const auto &redOperator{
534534
std::get<omp::clause::ReductionOperator>(reduction.t)};
535535
const auto &objectList{std::get<omp::ObjectList>(reduction.t)};
@@ -602,12 +602,12 @@ void ReductionProcessor::addReductionDecl(
602602
for (mlir::Value symVal : reductionVars) {
603603
auto redType = mlir::cast<fir::ReferenceType>(symVal.getType());
604604
if (redType.getEleTy().isa<fir::LogicalType>())
605-
decl = createReductionDecl(
605+
decl = createDeclareReduction(
606606
firOpBuilder,
607607
getReductionName(intrinsicOp, firOpBuilder.getI1Type(), isByRef),
608608
redId, redType, currentLocation, isByRef);
609609
else
610-
decl = createReductionDecl(
610+
decl = createDeclareReduction(
611611
firOpBuilder, getReductionName(intrinsicOp, redType, isByRef),
612612
redId, redType, currentLocation, isByRef);
613613
reductionDeclSymbols.push_back(mlir::SymbolRefAttr::get(
@@ -628,7 +628,7 @@ void ReductionProcessor::addReductionDecl(
628628
auto redType = symVal.getType().cast<fir::ReferenceType>();
629629
if (!redType.getEleTy().isIntOrIndexOrFloat())
630630
TODO(currentLocation, "User Defined Reduction on non-trivial type");
631-
decl = createReductionDecl(
631+
decl = createDeclareReduction(
632632
firOpBuilder,
633633
getReductionName(getRealName(*reductionIntrinsic).ToString(),
634634
redType, isByRef),

flang/lib/Lower/OpenMP/ReductionProcessor.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
namespace mlir {
2626
namespace omp {
27-
class ReductionDeclareOp;
27+
class DeclareReductionOp;
2828
} // namespace omp
2929
} // namespace mlir
3030

@@ -109,22 +109,22 @@ class ReductionProcessor {
109109
/// symbol table. The declaration has a constant initializer with the neutral
110110
/// value `initValue`, and the reduction combiner carried over from `reduce`.
111111
/// TODO: add atomic region.
112-
static mlir::omp::ReductionDeclareOp
113-
createReductionDecl(fir::FirOpBuilder &builder,
114-
llvm::StringRef reductionOpName,
115-
const ReductionIdentifier redId, mlir::Type type,
116-
mlir::Location loc, bool isByRef);
112+
static mlir::omp::DeclareReductionOp
113+
createDeclareReduction(fir::FirOpBuilder &builder,
114+
llvm::StringRef reductionOpName,
115+
const ReductionIdentifier redId, mlir::Type type,
116+
mlir::Location loc, bool isByRef);
117117

118118
/// Creates a reduction declaration and associates it with an OpenMP block
119119
/// directive.
120-
static void
121-
addReductionDecl(mlir::Location currentLocation,
122-
Fortran::lower::AbstractConverter &converter,
123-
const omp::clause::Reduction &reduction,
124-
llvm::SmallVectorImpl<mlir::Value> &reductionVars,
125-
llvm::SmallVectorImpl<mlir::Attribute> &reductionDeclSymbols,
126-
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
127-
*reductionSymbols = nullptr);
120+
static void addDeclareReduction(
121+
mlir::Location currentLocation,
122+
Fortran::lower::AbstractConverter &converter,
123+
const omp::clause::Reduction &reduction,
124+
llvm::SmallVectorImpl<mlir::Value> &reductionVars,
125+
llvm::SmallVectorImpl<mlir::Attribute> &reductionDeclSymbols,
126+
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
127+
*reductionSymbols = nullptr);
128128
};
129129

130130
template <typename FloatOp, typename IntegerOp>

flang/lib/Optimizer/Builder/FIRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ mlir::Block *fir::FirOpBuilder::getAllocaBlock() {
208208
.getParentOfType<mlir::omp::OutlineableOpenMPOpInterface>()) {
209209
return ompOutlineableIface.getAllocaBlock();
210210
}
211-
if (mlir::isa<mlir::omp::ReductionDeclareOp>(getRegion().getParentOp()))
211+
if (mlir::isa<mlir::omp::DeclareReductionOp>(getRegion().getParentOp()))
212212
return &getRegion().front();
213213
if (auto accRecipeIface =
214214
getRegion().getParentOfType<mlir::acc::RecipeInterface>()) {

flang/lib/Optimizer/CodeGen/CodeGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ class FIROpConversion : public mlir::ConvertOpToLLVMPattern<FromOp> {
410410
mlir::ConversionPatternRewriter &rewriter) const {
411411
auto thisPt = rewriter.saveInsertionPoint();
412412
mlir::Operation *parentOp = rewriter.getInsertionBlock()->getParentOp();
413-
if (mlir::isa<mlir::omp::ReductionDeclareOp>(parentOp)) {
414-
// ReductionDeclareOp has multiple child regions. We want to get the first
413+
if (mlir::isa<mlir::omp::DeclareReductionOp>(parentOp)) {
414+
// DeclareReductionOp has multiple child regions. We want to get the first
415415
// block of whichever of those regions we are currently in
416416
mlir::Region *parentRegion = rewriter.getInsertionBlock()->getParent();
417417
rewriter.setInsertionPointToStart(&parentRegion->front());

0 commit comments

Comments
 (0)