-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[NFC][flang] Move ReductionProcessor
to Lower/Support
.
#146025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ergawy
wants to merge
2
commits into
users/ergawy/convert_locality_specs_to_clauses_5
Choose a base branch
from
users/ergawy/convert_locality_specs_to_clauses_6
base: users/ergawy/convert_locality_specs_to_clauses_5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[NFC][flang] Move ReductionProcessor
to Lower/Support
.
#146025
ergawy
wants to merge
2
commits into
users/ergawy/convert_locality_specs_to_clauses_5
from
users/ergawy/convert_locality_specs_to_clauses_6
+17
−18
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-flang-fir-hlfir Author: Kareem Ergawy (ergawy) ChangesWith #145837, the Full diff: https://github.com/llvm/llvm-project/pull/146025.diff 15 Files Affected:
diff --git a/flang/lib/Lower/OpenMP/Clauses.h b/flang/include/flang/Lower/OpenMP/Clauses.h
similarity index 100%
rename from flang/lib/Lower/OpenMP/Clauses.h
rename to flang/include/flang/Lower/OpenMP/Clauses.h
diff --git a/flang/lib/Lower/OpenMP/ReductionProcessor.h b/flang/include/flang/Lower/Support/ReductionProcessor.h
similarity index 99%
rename from flang/lib/Lower/OpenMP/ReductionProcessor.h
rename to flang/include/flang/Lower/Support/ReductionProcessor.h
index 95b4b077bdc46..72d8a0096f511 100644
--- a/flang/lib/Lower/OpenMP/ReductionProcessor.h
+++ b/flang/include/flang/Lower/Support/ReductionProcessor.h
@@ -13,7 +13,7 @@
#ifndef FORTRAN_LOWER_REDUCTIONPROCESSOR_H
#define FORTRAN_LOWER_REDUCTIONPROCESSOR_H
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
#include "flang/Optimizer/Dialect/FIRType.h"
#include "flang/Parser/parse-tree.h"
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index 2f896d273b580..59bdac9cf21fe 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -12,7 +12,6 @@
#include "flang/Lower/Bridge.h"
-#include "OpenMP/ReductionProcessor.h"
#include "flang/Lower/Allocatable.h"
#include "flang/Lower/CallInterface.h"
#include "flang/Lower/Coarray.h"
@@ -32,6 +31,7 @@
#include "flang/Lower/PFTBuilder.h"
#include "flang/Lower/Runtime.h"
#include "flang/Lower/StatementContext.h"
+#include "flang/Lower/Support/ReductionProcessor.h"
#include "flang/Lower/Support/Utils.h"
#include "flang/Optimizer/Builder/BoxValue.h"
#include "flang/Optimizer/Builder/CUFCommon.h"
diff --git a/flang/lib/Lower/CMakeLists.txt b/flang/lib/Lower/CMakeLists.txt
index 9c5db2b126510..2de7a9164fc7c 100644
--- a/flang/lib/Lower/CMakeLists.txt
+++ b/flang/lib/Lower/CMakeLists.txt
@@ -28,11 +28,11 @@ add_flang_library(FortranLower
OpenMP/DataSharingProcessor.cpp
OpenMP/Decomposer.cpp
OpenMP/OpenMP.cpp
- OpenMP/ReductionProcessor.cpp
OpenMP/Utils.cpp
PFTBuilder.cpp
Runtime.cpp
Support/PrivateReductionUtils.cpp
+ Support/ReductionProcessor.cpp
Support/Utils.cpp
SymbolMap.cpp
VectorSubscripts.cpp
diff --git a/flang/lib/Lower/OpenMP/ClauseFinder.h b/flang/lib/Lower/OpenMP/ClauseFinder.h
index 3b77f2ca1d4cb..af52585452833 100644
--- a/flang/lib/Lower/OpenMP/ClauseFinder.h
+++ b/flang/lib/Lower/OpenMP/ClauseFinder.h
@@ -12,7 +12,7 @@
#ifndef FORTRAN_LOWER_CLAUSEFINDER_H
#define FORTRAN_LOWER_CLAUSEFINDER_H
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
namespace Fortran {
namespace lower {
diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
index 5aebfc901e8ac..74087d42a8e6e 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
@@ -11,12 +11,12 @@
//===----------------------------------------------------------------------===//
#include "ClauseProcessor.h"
-#include "Clauses.h"
-#include "ReductionProcessor.h"
#include "Utils.h"
#include "flang/Lower/ConvertExprToHLFIR.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Lower/PFTBuilder.h"
+#include "flang/Lower/Support/ReductionProcessor.h"
#include "flang/Parser/tools.h"
#include "flang/Semantics/tools.h"
#include "llvm/Frontend/OpenMP/OMP.h.inc"
diff --git a/flang/lib/Lower/OpenMP/ClauseProcessor.h b/flang/lib/Lower/OpenMP/ClauseProcessor.h
index 46b749fb66c86..f8a1f7983b79b 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.h
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.h
@@ -13,11 +13,11 @@
#define FORTRAN_LOWER_CLAUSEPROCESSOR_H
#include "ClauseFinder.h"
-#include "Clauses.h"
#include "Utils.h"
#include "flang/Lower/AbstractConverter.h"
#include "flang/Lower/Bridge.h"
#include "flang/Lower/DirectivesCommon.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Optimizer/Builder/Todo.h"
#include "flang/Parser/dump-parse-tree.h"
#include "flang/Parser/parse-tree.h"
diff --git a/flang/lib/Lower/OpenMP/Clauses.cpp b/flang/lib/Lower/OpenMP/Clauses.cpp
index b599d69a36272..22a07219d3a50 100644
--- a/flang/lib/Lower/OpenMP/Clauses.cpp
+++ b/flang/lib/Lower/OpenMP/Clauses.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Common/idioms.h"
#include "flang/Evaluate/expression.h"
diff --git a/flang/lib/Lower/OpenMP/DataSharingProcessor.h b/flang/lib/Lower/OpenMP/DataSharingProcessor.h
index fded04c839fb4..6e9294e7c8252 100644
--- a/flang/lib/Lower/OpenMP/DataSharingProcessor.h
+++ b/flang/lib/Lower/OpenMP/DataSharingProcessor.h
@@ -12,7 +12,7 @@
#ifndef FORTRAN_LOWER_DATASHARINGPROCESSOR_H
#define FORTRAN_LOWER_DATASHARINGPROCESSOR_H
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Lower/AbstractConverter.h"
#include "flang/Lower/OpenMP.h"
#include "flang/Optimizer/Builder/FIRBuilder.h"
diff --git a/flang/lib/Lower/OpenMP/Decomposer.cpp b/flang/lib/Lower/OpenMP/Decomposer.cpp
index 251cba9204adc..9bfbf67bec88c 100644
--- a/flang/lib/Lower/OpenMP/Decomposer.cpp
+++ b/flang/lib/Lower/OpenMP/Decomposer.cpp
@@ -12,8 +12,8 @@
#include "Decomposer.h"
-#include "Clauses.h"
#include "Utils.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Lower/PFTBuilder.h"
#include "flang/Semantics/semantics.h"
#include "flang/Tools/CrossToolHelpers.h"
diff --git a/flang/lib/Lower/OpenMP/Decomposer.h b/flang/lib/Lower/OpenMP/Decomposer.h
index e3291b7c59e21..65492bd76280d 100644
--- a/flang/lib/Lower/OpenMP/Decomposer.h
+++ b/flang/lib/Lower/OpenMP/Decomposer.h
@@ -8,7 +8,7 @@
#ifndef FORTRAN_LOWER_OPENMP_DECOMPOSER_H
#define FORTRAN_LOWER_OPENMP_DECOMPOSER_H
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "mlir/IR/BuiltinOps.h"
#include "llvm/Frontend/OpenMP/ConstructDecompositionT.h"
#include "llvm/Frontend/OpenMP/OMP.h"
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 995f3d29ad89f..5217d937f3b67 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -13,7 +13,6 @@
#include "flang/Lower/OpenMP.h"
#include "ClauseProcessor.h"
-#include "Clauses.h"
#include "DataSharingProcessor.h"
#include "Decomposer.h"
#include "Utils.h"
@@ -22,6 +21,7 @@
#include "flang/Lower/ConvertExpr.h"
#include "flang/Lower/ConvertVariable.h"
#include "flang/Lower/DirectivesCommon.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Lower/StatementContext.h"
#include "flang/Lower/SymbolMap.h"
#include "flang/Optimizer/Builder/BoxValue.h"
diff --git a/flang/lib/Lower/OpenMP/Utils.cpp b/flang/lib/Lower/OpenMP/Utils.cpp
index c226c2558e7aa..062fd228c9ded 100644
--- a/flang/lib/Lower/OpenMP/Utils.cpp
+++ b/flang/lib/Lower/OpenMP/Utils.cpp
@@ -12,9 +12,9 @@
#include "Utils.h"
-#include "Clauses.h"
#include "ClauseFinder.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include <flang/Lower/AbstractConverter.h>
#include <flang/Lower/ConvertType.h>
#include <flang/Lower/DirectivesCommon.h>
diff --git a/flang/lib/Lower/OpenMP/Utils.h b/flang/lib/Lower/OpenMP/Utils.h
index a7eb2dc5ee664..1526bd4e90233 100644
--- a/flang/lib/Lower/OpenMP/Utils.h
+++ b/flang/lib/Lower/OpenMP/Utils.h
@@ -9,7 +9,7 @@
#ifndef FORTRAN_LOWER_OPENMPUTILS_H
#define FORTRAN_LOWER_OPENMPUTILS_H
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
#include "mlir/IR/Location.h"
#include "mlir/IR/Value.h"
diff --git a/flang/lib/Lower/OpenMP/ReductionProcessor.cpp b/flang/lib/Lower/Support/ReductionProcessor.cpp
similarity index 99%
rename from flang/lib/Lower/OpenMP/ReductionProcessor.cpp
rename to flang/lib/Lower/Support/ReductionProcessor.cpp
index 7cd5bc7b4928c..3991e326d8170 100644
--- a/flang/lib/Lower/OpenMP/ReductionProcessor.cpp
+++ b/flang/lib/Lower/Support/ReductionProcessor.cpp
@@ -10,9 +10,9 @@
//
//===----------------------------------------------------------------------===//
-#include "ReductionProcessor.h"
+#include "flang/Lower/Support/ReductionProcessor.h"
-#include "Clauses.h"
+#include "flang/Lower/OpenMP/Clauses.h"
#include "flang/Lower/AbstractConverter.h"
#include "flang/Lower/ConvertType.h"
#include "flang/Lower/Support/PrivateReductionUtils.h"
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
5073e7d
to
9021dbc
Compare
kparzysz
approved these changes
Jun 27, 2025
tblah
approved these changes
Jun 27, 2025
be636dd
to
51e15e6
Compare
9021dbc
to
6a7c71e
Compare
51e15e6
to
0095db8
Compare
With #145837, the `ReductionProcessor` component is now used by both OpenMP and `do concurrent`. Therefore, this PR moves it to a shared location: `flang/Lower/Support`.
926cb7c
to
aa3984a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With #145837, the
ReductionProcessor
component is now used by both OpenMP anddo concurrent
. Therefore, this PR moves it to a shared location:flang/Lower/Support
.PR stack:
reduce
to match reductions are modelled in OpenMP and OpenACC #145837ReductionProcessor
toLower/Support
. #146025 (this one)fir_DoConcurrentLoopOp
's defintion #146028do concurrent ... reduce
to OpenMP #146033