Skip to content

Commit 8f30317

Browse files
committed
Addressed @schweitzpgi review comments
- Replace switch case with individual case statement as per enum. - Modified test case to use tco tool for validating lowering to llvmir.
1 parent 36eb7eb commit 8f30317

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,23 @@ void Fortran::lower::genOMP(
2424
std::get<Fortran::parser::OmpSimpleStandaloneDirective>(
2525
simpleStandaloneConstruct.t);
2626
switch (directive.v) {
27-
default:
28-
TODO();
29-
case parser::OmpSimpleStandaloneDirective::Directive::Barrier: {
27+
28+
case parser::OmpSimpleStandaloneDirective::Directive::Barrier:
3029
absConv.getFirOpBuilder().create<mlir::omp::BarrierOp>(
3130
absConv.getCurrentLocation());
3231
break;
33-
}
32+
case parser::OmpSimpleStandaloneDirective::Directive::Taskwait:
33+
TODO();
34+
case parser::OmpSimpleStandaloneDirective::Directive::Taskyield:
35+
TODO();
36+
case parser::OmpSimpleStandaloneDirective::Directive::TargetEnterData:
37+
TODO();
38+
case parser::OmpSimpleStandaloneDirective::Directive::TargetExitData:
39+
TODO();
40+
case parser::OmpSimpleStandaloneDirective::Directive::TargetUpdate:
41+
TODO();
42+
case parser::OmpSimpleStandaloneDirective::Directive::Ordered:
43+
TODO();
3444
}
3545
}
3646

flang/test/Lower/omp-barrier.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
! RUN: FileCheck %s --check-prefix=FIRDialect
55
! RUN: bbc -fopenmp -emit-llvm %s -o - | \
66
! RUN: FileCheck %s --check-prefix=LLVMIRDialect
7-
! RUN: bbc -fopenmp -emit-llvm %s -o - | \
8-
! RUN: mlir-translate -mlir-to-llvmir - | FileCheck %s --check-prefix=LLVMIR
7+
! RUN: bbc -fopenmp -emit-fir %s -o - | \
8+
! RUN: tco | FileCheck %s --check-prefix=LLVMIR
99

1010
program barrier
1111

0 commit comments

Comments
 (0)