Skip to content

Commit

Permalink
[flang][OpenMP] Make several function local to OpenMP.cpp, NFC (#86726)
Browse files Browse the repository at this point in the history
There were several functions, mostly reduction-related, that were only
called from OpenMP.cpp. Remove them from OpenMP.h, and make them local
in OpenMP.cpp:
- genOpenMPReduction
- findReductionChain
- getConvertFromReductionOp
- updateReduction
- removeStoreOp

Also, move the function bodies out of the "public" section.
  • Loading branch information
kparzysz committed Mar 28, 2024
1 parent 4ddd4ed commit 7919975
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 222 deletions.
12 changes: 0 additions & 12 deletions flang/include/flang/Lower/OpenMP.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <utility>

namespace mlir {
class Value;
class Operation;
class Location;
namespace omp {
Expand All @@ -30,7 +29,6 @@ enum class DeclareTargetCaptureClause : uint32_t;

namespace fir {
class FirOpBuilder;
class ConvertOp;
} // namespace fir

namespace Fortran {
Expand Down Expand Up @@ -84,16 +82,6 @@ void genOpenMPSymbolProperties(AbstractConverter &converter,
int64_t getCollapseValue(const Fortran::parser::OmpClauseList &clauseList);
void genThreadprivateOp(AbstractConverter &, const pft::Variable &);
void genDeclareTargetIntGlobal(AbstractConverter &, const pft::Variable &);
void genOpenMPReduction(AbstractConverter &,
Fortran::semantics::SemanticsContext &,
const Fortran::parser::OmpClauseList &clauseList);

mlir::Operation *findReductionChain(mlir::Value, mlir::Value * = nullptr);
fir::ConvertOp getConvertFromReductionOp(mlir::Operation *, mlir::Value);
void updateReduction(mlir::Operation *, fir::FirOpBuilder &, mlir::Value,
mlir::Value, fir::ConvertOp * = nullptr);
void removeStoreOp(mlir::Operation *, mlir::Value);

bool isOpenMPTargetConstruct(const parser::OpenMPConstruct &);
bool isOpenMPDeviceDeclareTarget(Fortran::lower::AbstractConverter &,
Fortran::semantics::SemanticsContext &,
Expand Down

0 comments on commit 7919975

Please sign in to comment.