Skip to content

Commit 12c4d26

Browse files
authored
[Flang][OpenMP] NFC: DataSharingProcessor cleanup (#107391)
This patch removes unused and undefined method declarations from `DataSharingProcessor`, as well as the unused `hasLastPrivateOp` class member. The `insPt` class member is replaced by a local `InsertionGuard` in the only place it is set and used.
1 parent 78e1e6a commit 12c4d26

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

flang/lib/Lower/OpenMP/DataSharingProcessor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DataSharingProcessor::DataSharingProcessor(
3939
const List<Clause> &clauses, lower::pft::Evaluation &eval,
4040
bool shouldCollectPreDeterminedSymbols, bool useDelayedPrivatization,
4141
lower::SymMap *symTable)
42-
: hasLastPrivateOp(false), converter(converter), semaCtx(semaCtx),
42+
: converter(converter), semaCtx(semaCtx),
4343
firOpBuilder(converter.getFirOpBuilder()), clauses(clauses), eval(eval),
4444
shouldCollectPreDeterminedSymbols(shouldCollectPreDeterminedSymbols),
4545
useDelayedPrivatization(useDelayedPrivatization), symTable(symTable),
@@ -64,9 +64,8 @@ void DataSharingProcessor::processStep1(
6464
void DataSharingProcessor::processStep2(mlir::Operation *op, bool isLoop) {
6565
// 'sections' lastprivate is handled by genOMP()
6666
if (!mlir::isa<mlir::omp::SectionsOp>(op)) {
67-
insPt = firOpBuilder.saveInsertionPoint();
67+
mlir::OpBuilder::InsertionGuard guard(firOpBuilder);
6868
copyLastPrivatize(op);
69-
firOpBuilder.restoreInsertionPoint(insPt);
7069
}
7170

7271
if (isLoop) {
@@ -157,7 +156,6 @@ void DataSharingProcessor::collectSymbolsForPrivatization() {
157156
std::get_if<omp::clause::Lastprivate>(&clause.u)) {
158157
const ObjectList &objects = std::get<ObjectList>(lastPrivateClause->t);
159158
collectOmpObjectListSymbol(objects, explicitlyPrivatizedSymbols);
160-
hasLastPrivateOp = true;
161159
}
162160
}
163161

flang/lib/Lower/OpenMP/DataSharingProcessor.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ class DataSharingProcessor {
6868
lower::pft::Evaluation &eval) const;
6969
};
7070

71-
bool hasLastPrivateOp;
7271
mlir::OpBuilder::InsertPoint lastPrivIP;
73-
mlir::OpBuilder::InsertPoint insPt;
7472
llvm::SmallVector<mlir::Value> loopIVs;
7573
// Symbols in private, firstprivate, and/or lastprivate clauses.
7674
llvm::SetVector<const semantics::Symbol *> explicitlyPrivatizedSymbols;
@@ -106,12 +104,6 @@ class DataSharingProcessor {
106104
void collectImplicitSymbols();
107105
void collectPreDeterminedSymbols();
108106
void privatize(mlir::omp::PrivateClauseOps *clauseOps);
109-
void defaultPrivatize(
110-
mlir::omp::PrivateClauseOps *clauseOps,
111-
llvm::SmallVectorImpl<const semantics::Symbol *> *privateSyms);
112-
void implicitPrivatize(
113-
mlir::omp::PrivateClauseOps *clauseOps,
114-
llvm::SmallVectorImpl<const semantics::Symbol *> *privateSyms);
115107
void doPrivatize(const semantics::Symbol *sym,
116108
mlir::omp::PrivateClauseOps *clauseOps);
117109
void copyLastPrivatize(mlir::Operation *op);

0 commit comments

Comments
 (0)