Skip to content

Commit f1500f8

Browse files
committed
Changed renaming rules after discussion
1 parent 0651bbb commit f1500f8

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
@@ -891,8 +891,8 @@ bool ClauseProcessor::processMap(
891891

892892
Fortran::lower::AddrAndBoundsInfo info =
893893
Fortran::lower::gatherDataOperandAddrAndBounds<
894-
Fortran::parser::OmpObject, mlir::omp::DataBoundsOp,
895-
mlir::omp::DataBoundsType>(
894+
Fortran::parser::OmpObject, mlir::omp::MapBoundsOp,
895+
mlir::omp::MapBoundsType>(
896896
converter, firOpBuilder, semaCtx, stmtCtx, ompObject,
897897
clauseLocation, asFortran, bounds, treatIndexAsSection);
898898

@@ -936,8 +936,9 @@ bool ClauseProcessor::processReduction(
936936
[&](const omp::clause::Reduction &clause,
937937
const Fortran::parser::CharBlock &) {
938938
ReductionProcessor rp;
939-
rp.addReductionDecl(currentLocation, converter, clause, reductionVars,
940-
reductionDeclSymbols, reductionSymbols);
939+
rp.addDeclareReduction(currentLocation, converter, clause,
940+
reductionVars, reductionDeclSymbols,
941+
reductionSymbols);
941942
reductionTypes.reserve(reductionVars.size());
942943
llvm::transform(reductionVars, std::back_inserter(reductionTypes),
943944
[](mlir::Value v) { return v.getType(); });

flang/lib/Lower/OpenMP/ClauseProcessor.h

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

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
@@ -347,7 +347,7 @@ static void createBodyOfOp(Op &op, OpWithBodyGenInfo &info) {
347347

348348
// Start with privatization, so that the lowering of the nested
349349
// code will use the right symbols.
350-
constexpr bool isLoop = std::is_same_v<Op, mlir::omp::WsLoopOp> ||
350+
constexpr bool isLoop = std::is_same_v<Op, mlir::omp::WsloopOp> ||
351351
std::is_same_v<Op, mlir::omp::SimdLoopOp>;
352352
bool privatize = info.clauses && !info.outerCombined;
353353

@@ -1140,15 +1140,15 @@ genTargetOp(Fortran::lower::AbstractConverter &converter,
11401140
converter.getCurrentLocation());
11411141
if (fir::unwrapRefType(info.addr.getType()).isa<fir::BaseBoxType>())
11421142
bounds =
1143-
Fortran::lower::genBoundsOpsFromBox<mlir::omp::DataBoundsOp,
1144-
mlir::omp::DataBoundsType>(
1143+
Fortran::lower::genBoundsOpsFromBox<mlir::omp::MapBoundsOp,
1144+
mlir::omp::MapBoundsType>(
11451145
converter.getFirOpBuilder(), converter.getCurrentLocation(),
11461146
converter, dataExv, info);
11471147
if (fir::unwrapRefType(info.addr.getType()).isa<fir::SequenceType>()) {
11481148
bool dataExvIsAssumedSize =
11491149
Fortran::semantics::IsAssumedSizeArray(sym.GetUltimate());
1150-
bounds = Fortran::lower::genBaseBoundsOps<mlir::omp::DataBoundsOp,
1151-
mlir::omp::DataBoundsType>(
1150+
bounds = Fortran::lower::genBaseBoundsOps<mlir::omp::MapBoundsOp,
1151+
mlir::omp::MapBoundsType>(
11521152
converter.getFirOpBuilder(), converter.getCurrentLocation(),
11531153
converter, dataExv, dataExvIsAssumedSize);
11541154
}
@@ -1580,7 +1580,7 @@ createSimdLoop(Fortran::lower::AbstractConverter &converter,
15801580
.setGenRegionEntryCb(ivCallback));
15811581
}
15821582

1583-
static void createWsLoop(Fortran::lower::AbstractConverter &converter,
1583+
static void createWsloop(Fortran::lower::AbstractConverter &converter,
15841584
Fortran::semantics::SemanticsContext &semaCtx,
15851585
Fortran::lower::pft::Evaluation &eval,
15861586
llvm::omp::Directive ompDirective,
@@ -1616,7 +1616,7 @@ static void createWsLoop(Fortran::lower::AbstractConverter &converter,
16161616
if (ReductionProcessor::doReductionByRef(reductionVars))
16171617
byrefOperand = firOpBuilder.getUnitAttr();
16181618

1619-
auto wsLoopOp = firOpBuilder.create<mlir::omp::WsLoopOp>(
1619+
auto wsLoopOp = firOpBuilder.create<mlir::omp::WsloopOp>(
16201620
loc, lowerBound, upperBound, step, linearVars, linearStepVars,
16211621
reductionVars,
16221622
reductionDeclSymbols.empty()
@@ -1658,15 +1658,15 @@ static void createWsLoop(Fortran::lower::AbstractConverter &converter,
16581658
reductionTypes);
16591659
};
16601660

1661-
createBodyOfOp<mlir::omp::WsLoopOp>(
1661+
createBodyOfOp<mlir::omp::WsloopOp>(
16621662
wsLoopOp, OpWithBodyGenInfo(converter, semaCtx, loc, *nestedEval)
16631663
.setClauses(&beginClauseList)
16641664
.setDataSharingProcessor(&dsp)
16651665
.setReductions(&reductionSymbols, &reductionTypes)
16661666
.setGenRegionEntryCb(ivCallback));
16671667
}
16681668

1669-
static void createSimdWsLoop(
1669+
static void createSimdWsloop(
16701670
Fortran::lower::AbstractConverter &converter,
16711671
Fortran::semantics::SemanticsContext &semaCtx,
16721672
Fortran::lower::pft::Evaluation &eval, llvm::omp::Directive ompDirective,
@@ -1686,7 +1686,7 @@ static void createSimdWsLoop(
16861686
// When support for vectorization is enabled, then we need to add handling of
16871687
// if clause. Currently if clause can be skipped because we always assume
16881688
// SIMD length = 1.
1689-
createWsLoop(converter, semaCtx, eval, ompDirective, beginClauseList,
1689+
createWsloop(converter, semaCtx, eval, ompDirective, beginClauseList,
16901690
endClauseList, loc);
16911691
}
16921692

@@ -1758,7 +1758,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
17581758

17591759
if (llvm::omp::allDoSimdSet.test(ompDirective)) {
17601760
// 2.9.3.2 Workshare SIMD construct
1761-
createSimdWsLoop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
1761+
createSimdWsloop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
17621762
endClauseList, currentLocation);
17631763

17641764
} else if (llvm::omp::allSimdSet.test(ompDirective)) {
@@ -1767,7 +1767,7 @@ static void genOMP(Fortran::lower::AbstractConverter &converter,
17671767
currentLocation);
17681768
genOpenMPReduction(converter, semaCtx, loopOpClauseList);
17691769
} else {
1770-
createWsLoop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
1770+
createWsloop(converter, semaCtx, eval, ompDirective, loopOpClauseList,
17711771
endClauseList, currentLocation);
17721772
}
17731773
}
@@ -2206,7 +2206,7 @@ genOMP(Fortran::lower::AbstractConverter &converter,
22062206
mlir::Operation *Fortran::lower::genOpenMPTerminator(fir::FirOpBuilder &builder,
22072207
mlir::Operation *op,
22082208
mlir::Location loc) {
2209-
if (mlir::isa<mlir::omp::WsLoopOp, mlir::omp::ReductionDeclareOp,
2209+
if (mlir::isa<mlir::omp::WsloopOp, mlir::omp::DeclareReductionOp,
22102210
mlir::omp::AtomicUpdateOp, mlir::omp::SimdLoopOp>(op))
22112211
return builder.create<mlir::omp::YieldOp>(loc);
22122212
else

flang/lib/Lower/OpenMP/ReductionProcessor.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,15 +281,15 @@ mlir::Value ReductionProcessor::createScalarCombiner(
281281
return reductionOp;
282282
}
283283

284-
mlir::omp::ReductionDeclareOp ReductionProcessor::createReductionDecl(
284+
mlir::omp::DeclareReductionOp ReductionProcessor::createDeclareReduction(
285285
fir::FirOpBuilder &builder, llvm::StringRef reductionOpName,
286286
const ReductionIdentifier redId, mlir::Type type, mlir::Location loc,
287287
bool isByRef) {
288288
mlir::OpBuilder::InsertionGuard guard(builder);
289289
mlir::ModuleOp module = builder.getModule();
290290

291291
auto decl =
292-
module.lookupSymbol<mlir::omp::ReductionDeclareOp>(reductionOpName);
292+
module.lookupSymbol<mlir::omp::DeclareReductionOp>(reductionOpName);
293293
if (decl)
294294
return decl;
295295

@@ -298,7 +298,7 @@ mlir::omp::ReductionDeclareOp ReductionProcessor::createReductionDecl(
298298
if (!isByRef)
299299
type = valTy;
300300

301-
decl = modBuilder.create<mlir::omp::ReductionDeclareOp>(loc, reductionOpName,
301+
decl = modBuilder.create<mlir::omp::DeclareReductionOp>(loc, reductionOpName,
302302
type);
303303
builder.createBlock(&decl.getInitializerRegion(),
304304
decl.getInitializerRegion().end(), {type}, {loc});
@@ -359,7 +359,7 @@ bool ReductionProcessor::doReductionByRef(
359359
return false;
360360
}
361361

362-
void ReductionProcessor::addReductionDecl(
362+
void ReductionProcessor::addDeclareReduction(
363363
mlir::Location currentLocation,
364364
Fortran::lower::AbstractConverter &converter,
365365
const omp::clause::Reduction &reduction,
@@ -368,7 +368,7 @@ void ReductionProcessor::addReductionDecl(
368368
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
369369
*reductionSymbols) {
370370
fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
371-
mlir::omp::ReductionDeclareOp decl;
371+
mlir::omp::DeclareReductionOp decl;
372372
const auto &redOperator{
373373
std::get<omp::clause::ReductionOperator>(reduction.t)};
374374
const auto &objectList{std::get<omp::ObjectList>(reduction.t)};
@@ -425,12 +425,12 @@ void ReductionProcessor::addReductionDecl(
425425
symVal = declOp.getBase();
426426
auto redType = symVal.getType().cast<fir::ReferenceType>();
427427
if (redType.getEleTy().isa<fir::LogicalType>())
428-
decl = createReductionDecl(
428+
decl = createDeclareReduction(
429429
firOpBuilder,
430430
getReductionName(intrinsicOp, firOpBuilder.getI1Type(), isByRef),
431431
redId, redType, currentLocation, isByRef);
432432
else if (redType.getEleTy().isIntOrIndexOrFloat()) {
433-
decl = createReductionDecl(
433+
decl = createDeclareReduction(
434434
firOpBuilder, getReductionName(intrinsicOp, redType, isByRef),
435435
redId, redType, currentLocation, isByRef);
436436
} else {
@@ -454,7 +454,7 @@ void ReductionProcessor::addReductionDecl(
454454
auto redType = symVal.getType().cast<fir::ReferenceType>();
455455
assert(redType.getEleTy().isIntOrIndexOrFloat() &&
456456
"Unsupported reduction type");
457-
decl = createReductionDecl(
457+
decl = createDeclareReduction(
458458
firOpBuilder,
459459
getReductionName(getRealName(*reductionIntrinsic).ToString(),
460460
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: Generalize this for non-integer types, 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)