-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang] Use createOpWithBody
for section op, NFC
#74659
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
Conversation
Replace explicit calls to ``` op = builder.create<SectionOp>(...) createBodyOfOp<SectionOp>(op, ...) ``` with a single call to ``` createOpWithBody<SectionOp>(...) ``` This is NFC, that's what the `createOpWithBody` function does.
@llvm/pr-subscribers-flang-openmp Author: Krzysztof Parzyszek (kparzysz) ChangesReplace explicit calls to
with a single call to
This is NFC, that's what the Full diff: https://github.com/llvm/llvm-project/pull/74659.diff 1 Files Affected:
diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 0fa1ac76d57edb..31d5df040c5d69 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -3233,7 +3233,6 @@ static void
genOMP(Fortran::lower::AbstractConverter &converter,
Fortran::lower::pft::Evaluation &eval,
const Fortran::parser::OpenMPSectionConstruct §ionConstruct) {
- fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
mlir::Location currentLocation = converter.getCurrentLocation();
const Fortran::parser::OpenMPConstruct *parentOmpConstruct =
eval.parentConstruct->getIf<Fortran::parser::OpenMPConstruct>();
@@ -3251,10 +3250,9 @@ genOMP(Fortran::lower::AbstractConverter &converter,
.t);
// Currently only private/firstprivate clause is handled, and
// all privatization is done within `omp.section` operations.
- mlir::omp::SectionOp sectionOp =
- firOpBuilder.create<mlir::omp::SectionOp>(currentLocation);
- createBodyOfOp<mlir::omp::SectionOp>(sectionOp, converter, currentLocation,
- eval, §ionsClauseList);
+ genOpWithBody<mlir::omp::SectionOp>(converter, eval, currentLocation,
+ /*outerCombined=*/false,
+ §ionsClauseList);
}
static void
|
@llvm/pr-subscribers-flang-fir-hlfir Author: Krzysztof Parzyszek (kparzysz) ChangesReplace explicit calls to
with a single call to
This is NFC, that's what the Full diff: https://github.com/llvm/llvm-project/pull/74659.diff 1 Files Affected:
diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 0fa1ac76d57edb..31d5df040c5d69 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -3233,7 +3233,6 @@ static void
genOMP(Fortran::lower::AbstractConverter &converter,
Fortran::lower::pft::Evaluation &eval,
const Fortran::parser::OpenMPSectionConstruct §ionConstruct) {
- fir::FirOpBuilder &firOpBuilder = converter.getFirOpBuilder();
mlir::Location currentLocation = converter.getCurrentLocation();
const Fortran::parser::OpenMPConstruct *parentOmpConstruct =
eval.parentConstruct->getIf<Fortran::parser::OpenMPConstruct>();
@@ -3251,10 +3250,9 @@ genOMP(Fortran::lower::AbstractConverter &converter,
.t);
// Currently only private/firstprivate clause is handled, and
// all privatization is done within `omp.section` operations.
- mlir::omp::SectionOp sectionOp =
- firOpBuilder.create<mlir::omp::SectionOp>(currentLocation);
- createBodyOfOp<mlir::omp::SectionOp>(sectionOp, converter, currentLocation,
- eval, §ionsClauseList);
+ genOpWithBody<mlir::omp::SectionOp>(converter, eval, currentLocation,
+ /*outerCombined=*/false,
+ §ionsClauseList);
}
static void
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a correct simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kparzysz for these cleanups.
Replace explicit calls to
with a single call to
This is NFC, that's what the
createOpWithBody
function does.