forked from OSchip/llvm-project
[flang] Added basic connect to lower OpenMP constructs
Reviewed By: clementval Differential Revision: https://reviews.llvm.org/D121382
This commit is contained in:
parent
589d51ea9f
commit
e0f549a43a
|
@ -20,6 +20,7 @@
|
|||
#include "flang/Lower/IO.h"
|
||||
#include "flang/Lower/IterationSpace.h"
|
||||
#include "flang/Lower/Mangler.h"
|
||||
#include "flang/Lower/OpenMP.h"
|
||||
#include "flang/Lower/PFTBuilder.h"
|
||||
#include "flang/Lower/Runtime.h"
|
||||
#include "flang/Lower/StatementContext.h"
|
||||
|
@ -1200,8 +1201,15 @@ private:
|
|||
TODO(toLocation(), "OpenACCDeclarativeConstruct lowering");
|
||||
}
|
||||
|
||||
void genFIR(const Fortran::parser::OpenMPConstruct &) {
|
||||
TODO(toLocation(), "OpenMPConstruct lowering");
|
||||
void genFIR(const Fortran::parser::OpenMPConstruct &omp) {
|
||||
mlir::OpBuilder::InsertPoint insertPt = builder->saveInsertionPoint();
|
||||
localSymbols.pushScope();
|
||||
Fortran::lower::genOpenMPConstruct(*this, getEval(), omp);
|
||||
|
||||
for (Fortran::lower::pft::Evaluation &e : getEval().getNestedEvaluations())
|
||||
genFIR(e);
|
||||
localSymbols.popScope();
|
||||
builder->restoreInsertionPoint(insertPt);
|
||||
}
|
||||
|
||||
void genFIR(const Fortran::parser::OpenMPDeclarativeConstruct &) {
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
! RUN: bbc -fopenmp -emit-fir -o - %s | FileCheck %s
|
||||
|
||||
subroutine sample()
|
||||
! CHECK: omp.barrier
|
||||
!$omp barrier
|
||||
end subroutine sample
|
Loading…
Reference in New Issue