[PATCH] D121117: [flang] Add OpenACC flag to bbc
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 9 09:37:41 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG140aabec43d6: [flang] Add OpenACC flag to bbc (authored by clementval).
Changed prior to commit:
https://reviews.llvm.org/D121117?vs=414125&id=414133#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121117/new/
https://reviews.llvm.org/D121117
Files:
flang/test/Lower/OpenACC/pre-fir-tree01.f90
flang/tools/bbc/bbc.cpp
Index: flang/tools/bbc/bbc.cpp
===================================================================
--- flang/tools/bbc/bbc.cpp
+++ flang/tools/bbc/bbc.cpp
@@ -84,6 +84,10 @@
llvm::cl::desc("enable openmp"),
llvm::cl::init(false));
+static llvm::cl::opt<bool> enableOpenACC("fopenacc",
+ llvm::cl::desc("enable openacc"),
+ llvm::cl::init(false));
+
#define FLANG_EXCLUDE_CODEGEN
#include "flang/Tools/CLOptions.inc"
@@ -251,6 +255,12 @@
options.predefinitions.emplace_back("_OPENMP", "201511");
}
+ // enable parsing of OpenACC
+ if (enableOpenACC) {
+ options.features.Enable(Fortran::common::LanguageFeature::OpenACC);
+ options.predefinitions.emplace_back("_OPENACC", "201911");
+ }
+
Fortran::common::IntrinsicTypeDefaultKinds defaultKinds;
Fortran::parser::AllSources allSources;
Fortran::parser::AllCookedSources allCookedSources(allSources);
Index: flang/test/Lower/OpenACC/pre-fir-tree01.f90
===================================================================
--- /dev/null
+++ flang/test/Lower/OpenACC/pre-fir-tree01.f90
@@ -0,0 +1,18 @@
+! RUN: bbc -fopenacc -pft-test -o %t %s | FileCheck %s
+! RUN: %flang_fc1 -fopenacc -fdebug-dump-pft -o %t %s | FileCheck %s
+
+! Test structure of the Pre-FIR tree with OpenACC
+
+subroutine sub1(a, b, n)
+ real :: a(:), b(:)
+ integer :: n, i
+ !$acc parallel loop present(a, b)
+ do i = 1, n
+ b(i) = exp(a(i))
+ end do
+end subroutine
+
+! CHECK-LABEL: Subroutine sub1
+! CHECK: <<OpenACCConstruct>>
+! CHECK: <<DoConstruct>>
+! CHECK: <<End OpenACCConstruct>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121117.414133.patch
Type: text/x-patch
Size: 1735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220309/26526fee/attachment.bin>
More information about the llvm-commits
mailing list