[flang] Added basic connect to lower OpenMP constructs

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D121382
This commit is contained in:
Shraiysh Vaishay 2022-03-10 22:40:23 +05:30
parent 589d51ea9f
commit e0f549a43a
2 changed files with 16 additions and 2 deletions

View File

@ -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 &) {

View File

@ -0,0 +1,6 @@
! RUN: bbc -fopenmp -emit-fir -o - %s | FileCheck %s
subroutine sample()
! CHECK: omp.barrier
!$omp barrier
end subroutine sample