[PATCH] D120459: [flang] Support for dump OpenMP/OpenACC declarative directives PFT in module
Peixin Qiao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 24 00:25:31 PST 2022
peixin created this revision.
peixin added reviewers: jeanPerier, PeteSteinfeld, schweitz, klausler, clementval, kiranchandramohan, Chuanfeng, bryanpkc, arnamoy10.
peixin added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert, guansong, yaxunl.
Herald added a reviewer: sscalpone.
peixin requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.
OpenMP/OpenACC declarative directives can also be used in module unit.
Add support for dump them in module.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D120459
Files:
flang/lib/Lower/PFTBuilder.cpp
flang/test/Lower/pre-fir-tree06.f90
flang/test/Lower/pre-fir-tree07.f90
Index: flang/test/Lower/pre-fir-tree07.f90
===================================================================
--- /dev/null
+++ flang/test/Lower/pre-fir-tree07.f90
@@ -0,0 +1,12 @@
+! RUN: %flang_fc1 -fdebug-pre-fir-tree -fopenacc %s | FileCheck %s
+
+! Test structure of the Pre-FIR tree with OpenACC declarative construct
+
+! CHECK: ModuleLike
+module m
+ real, dimension(10) :: x
+ ! CHECK-NEXT: OpenACCDeclarativeConstruct
+ !$acc declare create(x)
+end
+! CHECK: End ModuleLike
+
Index: flang/test/Lower/pre-fir-tree06.f90
===================================================================
--- /dev/null
+++ flang/test/Lower/pre-fir-tree06.f90
@@ -0,0 +1,12 @@
+! RUN: %flang_fc1 -fdebug-pre-fir-tree -fopenmp %s | FileCheck %s
+
+! Test structure of the Pre-FIR tree with OpenMP declarative construct
+
+! CHECK: ModuleLike
+module m
+ real, dimension(10) :: x
+ ! CHECK-NEXT: OpenMPDeclarativeConstruct
+ !$omp threadprivate(x)
+end
+! CHECK: End ModuleLike
+
Index: flang/lib/Lower/PFTBuilder.cpp
===================================================================
--- flang/lib/Lower/PFTBuilder.cpp
+++ flang/lib/Lower/PFTBuilder.cpp
@@ -1163,8 +1163,9 @@
void dumpModuleLikeUnit(llvm::raw_ostream &outputStream,
const lower::pft::ModuleLikeUnit &moduleLikeUnit) {
outputStream << getNodeIndex(moduleLikeUnit) << " ";
- outputStream << "ModuleLike: ";
- outputStream << "\nContains\n";
+ outputStream << "ModuleLike:\n";
+ dumpEvaluationList(outputStream, moduleLikeUnit.evaluationList);
+ outputStream << "Contains\n";
for (const lower::pft::FunctionLikeUnit &func :
moduleLikeUnit.nestedFunctions)
dumpFunctionLikeUnit(outputStream, func);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120459.411023.patch
Type: text/x-patch
Size: 1732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220224/0cbd207e/attachment.bin>
More information about the llvm-commits
mailing list