Skip to content

Commit c17bb2a

Browse files
committed
Addressed nit reviewer comments.
1 parent e2b78f4 commit c17bb2a

File tree

3 files changed

+43
-45
lines changed

3 files changed

+43
-45
lines changed

flang/lib/Lower/OpenMP/ClauseProcessor.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,20 @@ bool ClauseProcessor::processDepend(
751751
});
752752
}
753753

754+
bool ClauseProcessor::processHasDeviceAddr(
755+
llvm::SmallVectorImpl<mlir::Value> &operands,
756+
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
757+
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
758+
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> &isDeviceSymbols)
759+
const {
760+
return findRepeatableClause<omp::clause::HasDeviceAddr>(
761+
[&](const omp::clause::HasDeviceAddr &devAddrClause,
762+
const Fortran::parser::CharBlock &) {
763+
addUseDeviceClause(converter, devAddrClause.v, operands, isDeviceTypes,
764+
isDeviceLocs, isDeviceSymbols);
765+
});
766+
}
767+
754768
bool ClauseProcessor::processIf(
755769
omp::clause::If::DirectiveNameModifier directiveName,
756770
mlir::Value &result) const {
@@ -771,6 +785,20 @@ bool ClauseProcessor::processIf(
771785
return found;
772786
}
773787

788+
bool ClauseProcessor::processIsDevicePtr(
789+
llvm::SmallVectorImpl<mlir::Value> &operands,
790+
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
791+
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
792+
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> &isDeviceSymbols)
793+
const {
794+
return findRepeatableClause<omp::clause::IsDevicePtr>(
795+
[&](const omp::clause::IsDevicePtr &devPtrClause,
796+
const Fortran::parser::CharBlock &) {
797+
addUseDeviceClause(converter, devPtrClause.v, operands, isDeviceTypes,
798+
isDeviceLocs, isDeviceSymbols);
799+
});
800+
}
801+
774802
bool ClauseProcessor::processLink(
775803
llvm::SmallVectorImpl<DeclareTargetCapturePair> &result) const {
776804
return findRepeatableClause<omp::clause::Link>(
@@ -994,34 +1022,6 @@ bool ClauseProcessor::processUseDevicePtr(
9941022
});
9951023
}
9961024

997-
bool ClauseProcessor::processIsDevicePtr(
998-
llvm::SmallVectorImpl<mlir::Value> &operands,
999-
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
1000-
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
1001-
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> &isDeviceSymbols)
1002-
const {
1003-
return findRepeatableClause<omp::clause::IsDevicePtr>(
1004-
[&](const omp::clause::IsDevicePtr &devPtrClause,
1005-
const Fortran::parser::CharBlock &) {
1006-
addUseDeviceClause(converter, devPtrClause.v, operands, isDeviceTypes,
1007-
isDeviceLocs, isDeviceSymbols);
1008-
});
1009-
}
1010-
1011-
bool ClauseProcessor::processHasDeviceAddr(
1012-
llvm::SmallVectorImpl<mlir::Value> &operands,
1013-
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
1014-
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
1015-
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *> &isDeviceSymbols)
1016-
const {
1017-
return findRepeatableClause<omp::clause::HasDeviceAddr>(
1018-
[&](const omp::clause::HasDeviceAddr &devAddrClause,
1019-
const Fortran::parser::CharBlock &) {
1020-
addUseDeviceClause(converter, devAddrClause.v, operands, isDeviceTypes,
1021-
isDeviceLocs, isDeviceSymbols);
1022-
});
1023-
}
1024-
10251025
} // namespace omp
10261026
} // namespace lower
10271027
} // namespace Fortran

flang/lib/Lower/OpenMP/ClauseProcessor.h

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ class ClauseProcessor {
6666
bool processDeviceType(mlir::omp::DeclareTargetDeviceType &result) const;
6767
bool processFinal(Fortran::lower::StatementContext &stmtCtx,
6868
mlir::Value &result) const;
69+
bool
70+
processHasDeviceAddr(llvm::SmallVectorImpl<mlir::Value> &operands,
71+
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
72+
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
73+
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
74+
&isDeviceSymbols) const;
6975
bool processHint(mlir::IntegerAttr &result) const;
7076
bool processMergeable(mlir::UnitAttr &result) const;
7177
bool processNowait(mlir::UnitAttr &result) const;
@@ -104,6 +110,12 @@ class ClauseProcessor {
104110
bool processIf(omp::clause::If::DirectiveNameModifier directiveName,
105111
mlir::Value &result) const;
106112
bool
113+
processIsDevicePtr(llvm::SmallVectorImpl<mlir::Value> &operands,
114+
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
115+
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
116+
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
117+
&isDeviceSymbols) const;
118+
bool
107119
processLink(llvm::SmallVectorImpl<DeclareTargetCapturePair> &result) const;
108120

109121
// This method is used to process a map clause.
@@ -141,20 +153,6 @@ class ClauseProcessor {
141153
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
142154
&useDeviceSymbols) const;
143155

144-
bool
145-
processIsDevicePtr(llvm::SmallVectorImpl<mlir::Value> &operands,
146-
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
147-
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
148-
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
149-
&isDeviceSymbols) const;
150-
151-
bool
152-
processHasDeviceAddr(llvm::SmallVectorImpl<mlir::Value> &operands,
153-
llvm::SmallVectorImpl<mlir::Type> &isDeviceTypes,
154-
llvm::SmallVectorImpl<mlir::Location> &isDeviceLocs,
155-
llvm::SmallVectorImpl<const Fortran::semantics::Symbol *>
156-
&isDeviceSymbols) const;
157-
158156
template <typename T>
159157
bool processMotionClauses(Fortran::lower::StatementContext &stmtCtx,
160158
llvm::SmallVectorImpl<mlir::Value> &mapOperands);

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,11 +1635,11 @@ def TargetOp : OpenMP_Op<"target", [IsolatedFromAbove, MapClauseOwningOpInterfac
16351635
that specify the dependencies of this particular target task in relation to
16361636
other tasks.
16371637

1638-
The optional $is_device_ptr indicates list items are device pointers
1638+
The optional $is_device_ptr indicates list items are device pointers.
16391639

16401640
The optional $has_device_addr indicates that list items already have device
1641-
addresses, so may be directly accessed from target device. May include array
1642-
sections.
1641+
addresses, so they may be directly accessed from the target device. This
1642+
includes array sections.
16431643

16441644
The optional $map_operands maps data from the task’s environment to the
16451645
device environment.

0 commit comments

Comments
 (0)